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/engine_api does not have a README file

    LayoutEngine

    pub(open) trait LayoutEngine {
    layout(Self,
    GraphInput
    , LayoutConfig, Direction) ->
    LayoutPatch
    raise LayoutError
    engine_name(Self) -> String
    features(Self) -> Array[LayoutFeature]
    }

    Layout engine interface.

    Engines must not mutate their input graph. They return a patch that can be applied by the caller.

    LayoutError

    pub(all) suberror LayoutError {
    InvalidGraph(String)
    CycleDetected(String)
    Unsupported(String)
    } derive(Eq,
    Debug
    )

    Layout error
    impl Show for LayoutError

    Direction

    pub(all) enum Direction {
    Down
    Right
    Up
    Left
    } derive(Eq,
    Debug
    )

    Layout direction
    impl Show for Direction

    LayoutConfig

    pub struct LayoutConfig {
    horizontal_spacing : Double
    vertical_spacing : Double
    container_padding : Double
    default_width : Double
    default_height : Double
    edge_padding : Double
    } derive(
    Debug
    )

    Layout configuration

    LayoutConfig::new

    LayoutConfig::with_spacing

    fn LayoutConfig::with_spacing(horizontal : Double, vertical : Double) -> LayoutConfig

    LayoutFeature

    pub(all) enum LayoutFeature {
    NearObject
    ContainerDimensions
    TopLeft
    DescendantEdges
    } derive(Eq,
    Debug
    )

    Layout engine capability flags aligned with the reference's layout feature model.

    cycle_detected

    fn cycle_detected(message : String) -> LayoutError

    estimate_root_grid_child_boxes

    fn estimate_root_grid_child_boxes(parent :
    ObjectInput
    , child_ids : Array[String], child_size_by_id : Map[String, (Double, Double)]) -> Map[String,
    Box
    ]?

    invalid_graph

    fn invalid_graph(message : String) -> LayoutError

    Construct an engine_api.LayoutError from outside this package.

    layout_with_engine

    fn[Engine : LayoutEngine] layout_with_engine(engine : Engine, graph :
    GraphInput
    , config : LayoutConfig, direction : Direction) ->
    GraphInput
    raise LayoutError

    Perform layout on a graph (including variants) with a specific engine.

    Returns a new graph with layout applied.

    unsupported

    fn unsupported(message : String) -> LayoutError

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io