Milky2018/diago/engine_api does not have a README file

    LayoutEngine

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

    Layout engine interface.

    Engines receive a graph whose object and edge lookup fields use canonical absolute source syntax. They must not mutate the input graph and return a patch whose keys belong to that graph.

    LayoutError

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

    Layout error
    impl Show for LayoutError

    LayoutError::equal

    #deprecated("`LayoutError::equal` is deprecated, use `Eq::equal` instead.")
    fn LayoutError::equal(LayoutError, LayoutError) -> Bool

    LayoutError::not_equal

    #deprecated("`LayoutError::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn LayoutError::not_equal(x : LayoutError, y : LayoutError) -> Bool

    LayoutError::output

    #deprecated("`LayoutError::output` is deprecated, use `Show::output` instead.")
    fn LayoutError::output(self : LayoutError, logger : &Logger) -> Unit

    LayoutError::to_repr

    #deprecated("`LayoutError::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn LayoutError::to_repr(LayoutError) ->
    Repr

    LayoutError::to_string

    fn LayoutError::to_string(self : LayoutError) -> String

    Direction

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

    Layout direction
    impl Show for Direction

    Direction::equal

    #deprecated("`Direction::equal` is deprecated, use `Eq::equal` instead.")
    fn Direction::equal(Direction, Direction) -> Bool

    Direction::not_equal

    #deprecated("`Direction::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn Direction::not_equal(x : Direction, y : Direction) -> Bool

    Direction::output

    #deprecated("`Direction::output` is deprecated, use `Show::output` instead.")
    fn Direction::output(self : Direction, logger : &Logger) -> Unit

    Direction::to_repr

    #deprecated("`Direction::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn Direction::to_repr(Direction) ->
    Repr

    Direction::to_string

    fn Direction::to_string(self : Direction) -> String

    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::to_repr

    #deprecated("`LayoutConfig::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn LayoutConfig::to_repr(LayoutConfig) ->
    Repr

    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.

    LayoutFeature::equal

    #deprecated("`LayoutFeature::equal` is deprecated, use `Eq::equal` instead.")
    fn LayoutFeature::equal(LayoutFeature, LayoutFeature) -> Bool

    LayoutFeature::not_equal

    #deprecated("`LayoutFeature::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn LayoutFeature::not_equal(x : LayoutFeature, y : LayoutFeature) -> Bool

    LayoutFeature::to_repr

    #deprecated("`LayoutFeature::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn LayoutFeature::to_repr(LayoutFeature) ->
    Repr

    cycle_detected

    fn cycle_detected(message : String) -> LayoutError

    estimate_nested_grid_layout_like_d2

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

    Estimate a real nested grid container, including D2's outside-label margins and container padding, from backend-produced child sizes.

    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