Sign in

    This version of the module is deprecated: Moved to moonbit-community/diago. Use moonbit-community/diago@0.4.0 or later and update import paths.

    Milky2018/diago/diagram does not have a README file

    Config

    pub struct Config {
    sketch : Bool?
    theme_id : Int?
    dark_theme_id : Int?
    theme_overrides : Map[String, String]
    dark_theme_overrides : Map[String, String]
    pad : Double?
    center : Bool?
    layout_engine : String?
    scale : Double?
    no_xml_tag : Bool?
    salt : String?
    omit_version : Bool?
    data : Map[String, String]
    }

    Configuration extracted from source (vars/config).

    Caller-provided options may override these values.
    impl Show for Config

    Config::from_parts

    fn Config::from_parts(sketch : Bool?, theme_id : Int?, dark_theme_id : Int?, theme_overrides : Map[String, String], dark_theme_overrides : Map[String, String], pad : Double?, center : Bool?, layout_engine : String?, scale : Double?, no_xml_tag : Bool?, salt : String?, omit_version : Bool?, data : Map[String, String]) -> Config

    Config::new

    fn Config::new() -> Config

    Connection

    pub struct Connection {
    index : Int
    src_id : String
    dst_id : String
    src_arrow : Bool
    dst_arrow : Bool
    src_arrowhead :
    ArrowheadType

    dst_arrowhead :
    ArrowheadType

    src_arrowhead_label : String?
    dst_arrowhead_label : String?
    src_arrowhead_label_color : String?
    dst_arrowhead_label_color : String?
    src_anchor : String?
    dst_anchor : String?
    label : String
    style :
    StyleInput

    route : Array[
    Point
    ]
    bend_points : Array[
    Point
    ]?
    is_curve : Bool
    z_index : Int
    reference_count : Int
    label_box :
    Box
    ?
    src_column_index : Int?
    dst_column_index : Int?
    }

    Renderable connection.

    This is derived from @graph.EdgeInput after layout has been applied.
    impl Show for Connection

    Diagram

    pub struct Diagram {
    name : String
    config : Config?
    root : Shape
    shapes : Array[Shape]
    connections : Array[Connection]
    activation_boxes : Array[(String,
    Box
    )]
    sequence_notes : Array[(String, String,
    Box
    )]
    sequence_fragments : Array[
    SequenceFragmentLayout
    ]
    layers : Array[Diagram]
    scenarios : Array[Diagram]
    steps : Array[Diagram]
    legend :
    LegendInput
    ?
    }

    Render-ready diagram.

    shapes does not include root.
    impl Show for Diagram

    Diagram::find_object

    fn Diagram::find_object(self : Diagram, id : String) -> Shape?

    Diagram::get_board

    fn Diagram::get_board(self : Diagram, board_path : Array[String]) -> Diagram?

    Get a board by path.

    Supports both explicit and shorthand paths:
    • Explicit: ["layers", "x", "scenarios", "y"]
    • Shorthand: ["x", "y"]

    Diagram::get_edges

    fn Diagram::get_edges(self : Diagram) -> Array[Connection]

    Diagram::get_objects

    fn Diagram::get_objects(self : Diagram) -> Array[Shape]

    Diagram::has_layers

    fn Diagram::has_layers(self : Diagram) -> Bool

    Diagram::has_legend

    fn Diagram::has_legend(self : Diagram) -> Bool

    Diagram::has_scenarios

    fn Diagram::has_scenarios(self : Diagram) -> Bool

    Diagram::has_steps

    fn Diagram::has_steps(self : Diagram) -> Bool

    Shape

    pub struct Shape {
    id : String
    label : String
    shape_type :
    ShapeType

    style :
    StyleInput

    box :
    Box
    ?
    label_box :
    Box
    ?
    child_ids : Array[String]
    z_index : Int
    icon : String?
    tooltip : String?
    link : String?
    classes : Array[String]
    grid_rows : Int?
    grid_columns : Int?
    grid_gap : Double?
    horizontal_gap : Double?
    vertical_gap : Double?
    grid_column_span : Int?
    grid_row_span : Int?
    near : String?
    }

    Renderable shape.

    This is derived from @graph.ObjectInput after layout has been applied.
    impl Show for Shape

    Shape::center

    Shape::get_box

    fn Shape::get_box(self : Shape) ->
    Box
    ?

    Shape::get_id

    fn Shape::get_id(self : Shape) -> String

    from_graph

    fn from_graph(graph :
    GraphInput
    , config : Config?) -> Diagram

    Convert a laid-out graph to a render-ready diagram.

    This is the only conversion renderers should need.

    Source Files