moonrockz/diagrams-svg
Types
ChannelStyle
pub struct ChannelStyle {
visible : Bool
color : @moonrockz/diagrams-svg/theme.Color?
width : Double
dashed : Bool
} derive(Eq, @moonbitlang/core/debug.Debug)The visibility and style of one static trace highlight channel. A missing colour selects the theme default for the channel.
ChannelStyle::equal
fn ChannelStyle::equal(ChannelStyle, ChannelStyle) -> BoolChannelStyle::hidden
fn ChannelStyle::hidden() -> ChannelStyleA hidden channel.
ChannelStyle::new
fn ChannelStyle::new(visible? : Bool, color? : @moonrockz/diagrams-svg/theme.Color, width? : Double, dashed? : Bool) -> ChannelStyleChannelStyle::not_equal
fn ChannelStyle::not_equal(x : ChannelStyle, y : ChannelStyle) -> BoolChannelStyle::to_repr
fn ChannelStyle::to_repr(ChannelStyle) -> @moonbitlang/core/debug.ReprConnectorCommand
pub(all) enum ConnectorCommand {
Move(ConnectorPoint)
Line(ConnectorPoint)
Quadratic(ConnectorPoint, ConnectorPoint)
Cubic(ConnectorPoint, ConnectorPoint, ConnectorPoint)
} derive(Eq, @moonbitlang/core/debug.Debug)Absolute SVG commands. Source route points remain separate from these values.
ConnectorCommand::equal
fn ConnectorCommand::equal(ConnectorCommand, ConnectorCommand) -> BoolConnectorCommand::not_equal
fn ConnectorCommand::not_equal(x : ConnectorCommand, y : ConnectorCommand) -> BoolConnectorCommand::to_repr
fn ConnectorCommand::to_repr(ConnectorCommand) -> @moonbitlang/core/debug.ReprConnectorGeometry
pub struct ConnectorGeometry {
paths : ReadOnlyArray[ResolvedConnector]
diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
} derive(Eq, @moonbitlang/core/debug.Debug)ConnectorGeometry::equal
fn ConnectorGeometry::equal(ConnectorGeometry, ConnectorGeometry) -> BoolConnectorGeometry::not_equal
fn ConnectorGeometry::not_equal(x : ConnectorGeometry, y : ConnectorGeometry) -> BoolConnectorGeometry::to_repr
fn ConnectorGeometry::to_repr(ConnectorGeometry) -> @moonbitlang/core/debug.ReprConnectorLimits
pub struct ConnectorLimits {
candidates : Int
subdivisions : Int
segments : Int
crossings : Int
output_units : Int
} derive(Eq, @moonbitlang/core/debug.Debug)Per-call connector budgets. Every candidate and generated segment is charged.
ConnectorLimits::equal
fn ConnectorLimits::equal(ConnectorLimits, ConnectorLimits) -> BoolConnectorLimits::new
fn ConnectorLimits::new(candidates? : Int, subdivisions? : Int, segments? : Int, crossings? : Int, output_units? : Int) -> ConnectorLimitsConnectorLimits::not_equal
fn ConnectorLimits::not_equal(x : ConnectorLimits, y : ConnectorLimits) -> BoolConnectorLimits::to_repr
fn ConnectorLimits::to_repr(ConnectorLimits) -> @moonbitlang/core/debug.ReprConnectorObstacle
pub(all) struct ConnectorObstacle {
owner : String
x : Double
y : Double
width : Double
height : Double
} derive(Eq, @moonbitlang/core/debug.Debug)A protected outline or label rectangle. owner can identify an endpoint
whose attachment is intentional. Use an empty owner for unrelated content.
ConnectorObstacle::equal
fn ConnectorObstacle::equal(ConnectorObstacle, ConnectorObstacle) -> BoolConnectorObstacle::not_equal
fn ConnectorObstacle::not_equal(x : ConnectorObstacle, y : ConnectorObstacle) -> BoolConnectorObstacle::to_repr
fn ConnectorObstacle::to_repr(ConnectorObstacle) -> @moonbitlang/core/debug.ReprConnectorOptions
pub struct ConnectorOptions {
style : ConnectorStyle?
crossing : CrossingMode
minimum_approach : Double
corner_radius : Double
bridge_radius : Double
style_supplied_bpmn : Bool
limits : ConnectorLimits
} derive(Eq, @moonbitlang/core/debug.Debug)ConnectorOptions::equal
fn ConnectorOptions::equal(ConnectorOptions, ConnectorOptions) -> BoolConnectorOptions::new
fn ConnectorOptions::new(style? : ConnectorStyle, crossing? : CrossingMode, minimum_approach? : Double, corner_radius? : Double, bridge_radius? : Double, style_supplied_bpmn? : Bool, limits? : ConnectorLimits) -> ConnectorOptionsConnectorOptions::not_equal
fn ConnectorOptions::not_equal(x : ConnectorOptions, y : ConnectorOptions) -> BoolConnectorOptions::to_repr
fn ConnectorOptions::to_repr(ConnectorOptions) -> @moonbitlang/core/debug.ReprConnectorPath
pub struct ConnectorPath {
commands : ReadOnlyArray[ConnectorCommand]
} derive(Eq, @moonbitlang/core/debug.Debug)ConnectorPath::equal
fn ConnectorPath::equal(ConnectorPath, ConnectorPath) -> BoolConnectorPath::new
fn ConnectorPath::new(commands : ArrayView[ConnectorCommand]) -> ConnectorPath?Construct immutable absolute geometry, refusing invalid numeric coordinates.
ConnectorPath::not_equal
fn ConnectorPath::not_equal(x : ConnectorPath, y : ConnectorPath) -> BoolConnectorPath::parse
fn ConnectorPath::parse(source : String) -> ConnectorPath?Read the renderer's absolute path dialect. No author markup is interpreted.
ConnectorPath::svg
fn ConnectorPath::svg(self : ConnectorPath) -> StringConnectorPath::to_repr
fn ConnectorPath::to_repr(ConnectorPath) -> @moonbitlang/core/debug.ReprConnectorPoint
pub(all) struct ConnectorPoint {
x : Double
y : Double
} derive(Eq, @moonbitlang/core/debug.Debug)ConnectorPoint::equal
fn ConnectorPoint::equal(ConnectorPoint, ConnectorPoint) -> BoolConnectorPoint::not_equal
fn ConnectorPoint::not_equal(x : ConnectorPoint, y : ConnectorPoint) -> BoolConnectorPoint::to_repr
fn ConnectorPoint::to_repr(ConnectorPoint) -> @moonbitlang/core/debug.ReprConnectorStyle
pub(all) enum ConnectorStyle {
Elbow
Rounded
Curved
} derive(Eq, @moonbitlang/core/debug.Debug)Explicit presentation style. Omission preserves intrinsic family geometry.
ConnectorStyle::equal
fn ConnectorStyle::equal(ConnectorStyle, ConnectorStyle) -> BoolConnectorStyle::not_equal
fn ConnectorStyle::not_equal(x : ConnectorStyle, y : ConnectorStyle) -> BoolConnectorStyle::to_repr
fn ConnectorStyle::to_repr(ConnectorStyle) -> @moonbitlang/core/debug.ReprCrossingMode
pub(all) enum CrossingMode {
Bridge
Plain
} derive(Eq, @moonbitlang/core/debug.Debug)CrossingMode::equal
fn CrossingMode::equal(CrossingMode, CrossingMode) -> BoolCrossingMode::not_equal
fn CrossingMode::not_equal(x : CrossingMode, y : CrossingMode) -> BoolCrossingMode::to_repr
fn CrossingMode::to_repr(CrossingMode) -> @moonbitlang/core/debug.ReprMode
pub(all) enum Mode {
Adaptive
Fixed(Variant)
} derive(Eq, @moonbitlang/core/debug.Debug)Adaptive uses CSS variables; fixed writes literal presentation attributes.
Mode::equal
fn Mode::equal(Mode, Mode) -> BoolMode::not_equal
fn Mode::not_equal(x : Mode, y : Mode) -> BoolMode::to_repr
fn Mode::to_repr(Mode) -> @moonbitlang/core/debug.ReprNodeBinding
pub struct NodeBinding {
endpoint : String
kind : NodeBindingKind
}NodeBindingKind
pub(all) enum NodeBindingKind {
Bpmn(String)
Message(Int)
Frame(Int)
Swimlane(String)
Flowchart(String)
State(String)
Architecture(String)
RailroadTerm(String)
DataRow(String)
DataBox(String)
} derive(Eq, @moonbitlang/core/debug.Debug)NodeBindingKind::equal
fn NodeBindingKind::equal(NodeBindingKind, NodeBindingKind) -> BoolNodeBindingKind::not_equal
fn NodeBindingKind::not_equal(x : NodeBindingKind, y : NodeBindingKind) -> BoolNodeBindingKind::to_repr
fn NodeBindingKind::to_repr(NodeBindingKind) -> @moonbitlang/core/debug.ReprPathBinding
pub struct PathBinding {
occurrence : @moonrockz/diagrams/animation.Occurrence
id : String
path : String
mask : String?
}ResolvedConnector
pub struct ResolvedConnector {
id : String
source : String
target : String
route : ConnectorPath
path : ConnectorPath
mask : String?
} derive(Eq, @moonbitlang/core/debug.Debug)One final visible connector and its untouched original route. Identities refer to source connections, message indices or hierarchy/grammar occurrences.
ResolvedConnector::equal
fn ResolvedConnector::equal(ResolvedConnector, ResolvedConnector) -> BoolResolvedConnector::not_equal
fn ResolvedConnector::not_equal(x : ResolvedConnector, y : ResolvedConnector) -> BoolResolvedConnector::to_repr
fn ResolvedConnector::to_repr(ResolvedConnector) -> @moonbitlang/core/debug.ReprScene
pub struct Scene {
canonical_svg : String
display_svg : String
catalog : @moonrockz/diagrams/animation.Catalog
paths : ReadOnlyArray[PathBinding]
nodes : ReadOnlyArray[NodeBinding]
}SceneResult
pub struct SceneResult {
scene : Scene?
diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}SvgRenderer
pub struct SvgRenderer {
theme : @moonrockz/diagrams-svg/theme.Theme
mode : Mode
id_prefix : String?
bpmn_policy : @moonrockz/diagrams/bpmn.GeometryPolicy
bpmn_limits : @moonrockz/diagrams-svg/bpmn-layout.Limits
architecture_limits : @moonrockz/diagrams-svg/architecture-layout.Limits
swimlane_limits : @moonrockz/diagrams-svg/swimlane-layout.Limits
state_limits : @moonrockz/diagrams-svg/state-layout.Limits
flowchart_limits : @moonrockz/diagrams-svg/flowchart-layout.Limits
railroad_limits : @moonrockz/diagrams-svg/railroad-layout.Limits
data_tree_limits : @moonrockz/diagrams-svg/data-tree-layout.Limits
connectors : ConnectorOptions
trace : TraceHighlight?
}A renderer that writes one standalone SVG document.
SvgRenderer::connector_geometry
fn SvgRenderer::connector_geometry(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram) -> ConnectorGeometryRender and inspect in one layout pass. Diagnostics include refused styling.
SvgRenderer::new
fn SvgRenderer::new(theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, bpmn_policy? : @moonrockz/diagrams/bpmn.GeometryPolicy, bpmn_limits? : @moonrockz/diagrams-svg/bpmn-layout.Limits, architecture_limits? : @moonrockz/diagrams-svg/architecture-layout.Limits, swimlane_limits? : @moonrockz/diagrams-svg/swimlane-layout.Limits, state_limits? : @moonrockz/diagrams-svg/state-layout.Limits, flowchart_limits? : @moonrockz/diagrams-svg/flowchart-layout.Limits, railroad_limits? : @moonrockz/diagrams-svg/railroad-layout.Limits, data_tree_limits? : @moonrockz/diagrams-svg/data-tree-layout.Limits, trace? : TraceHighlight, connectors? : ConnectorOptions) -> SvgRendererSvgRenderer::render
fn SvgRenderer::render(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram) -> @moonrockz/diagrams/render.RenderedSvgRenderer::render_traced
fn[P : @moonrockz/diagrams/railroad-trace.RailroadTraceProvider] SvgRenderer::render_traced(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram, provider : P, input : String, start_rule? : String, limits? : @moonrockz/diagrams/railroad-trace.TraceLimits, attempts? : ArrayView[String], matched? : ChannelStyle, not_matched? : ChannelStyle, taken? : ChannelStyle, failure? : ChannelStyle) -> TracedRenderInvoke provider once for input and render its validated trace with
the given channels. This is the only renderer entry point that calls a
provider. Unsupported, exhausted and error outcomes give diagnostics and
no SVG; a completed non-match renders its evidence.
SvgRenderer::scene
fn SvgRenderer::scene(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram, sequence_view_id? : String, limits? : @moonrockz/diagrams/animation.Limits, output_units? : Int) -> SceneResultBoth copies and their motion bindings use one measured geometry. Ordinary render output remains the canonical artifact; only the display copy gains invisible, scoped numeric paths. No scripts or active references are added.
impl Renderer for SvgRenderer
Renderer::render
fn render(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram) -> @moonrockz/diagrams/render.RenderedTraceHighlight
pub struct TraceHighlight {
trace : @moonrockz/diagrams/railroad-trace.Trace
attempts : ReadOnlyArray[String]?
matched : ChannelStyle
not_matched : ChannelStyle
taken : ChannelStyle
failure : ChannelStyle
limits : @moonrockz/diagrams/railroad-trace.TraceLimits
} derive(Eq, @moonbitlang/core/debug.Debug)A per-render request to draw supplied trace evidence on a regex or EBNF
diagram. Each channel is independent: matched paths, non-matched paths,
the taken path or prefix, and failure points. attempts selects attempt
identities; None selects every attempt. The request never changes the
diagram model, its source or its geometry.
TraceHighlight::equal
fn TraceHighlight::equal(TraceHighlight, TraceHighlight) -> BoolTraceHighlight::new
fn TraceHighlight::new(trace : @moonrockz/diagrams/railroad-trace.Trace, attempts? : ArrayView[String], matched? : ChannelStyle, not_matched? : ChannelStyle, taken? : ChannelStyle, failure? : ChannelStyle, limits? : @moonrockz/diagrams/railroad-trace.TraceLimits) -> TraceHighlightTraceHighlight::not_equal
fn TraceHighlight::not_equal(x : TraceHighlight, y : TraceHighlight) -> BoolTraceHighlight::to_repr
fn TraceHighlight::to_repr(TraceHighlight) -> @moonbitlang/core/debug.ReprTracedRender
pub struct TracedRender {
run : @moonrockz/diagrams/railroad-trace.TraceRun
rendered : @moonrockz/diagrams/render.Rendered
}The result of the explicit provider-and-render driver.
TracedRender::refused
fn TracedRender::refused(diagnostics : ArrayView[@moonrockz/diagrams.Diagnostic]) -> TracedRenderA traced render that did not reach a provider, with the reasons.
Variant
pub(all) enum Variant {
Dark
Light
} derive(Eq, @moonbitlang/core/debug.Debug)The palette selected by fixed output.
Variant::equal
fn Variant::equal(Variant, Variant) -> BoolVariant::not_equal
fn Variant::not_equal(x : Variant, y : Variant) -> BoolVariant::to_repr
fn Variant::to_repr(Variant) -> @moonbitlang/core/debug.ReprValues
bpmn_geometry_path
fn bpmn_geometry_path(edge : @moonrockz/diagrams-svg/bpmn-layout.Connection, max_units? : Int) -> String?Exact authored or deterministically computed path. The limit is checked before appending each segment; no partially returned path escapes.
bpmn_path
fn bpmn_path(flow : @moonrockz/diagrams/bpmn.Flow) -> StringInteger convenience path retained for the first motion-plan API.
check_connectors
fn check_connectors(paths : ArrayView[ResolvedConnector], obstacles : ArrayView[ConnectorObstacle], width~ : Double, height~ : Double, limits? : ConnectorLimits) -> ReadOnlyArray[@moonrockz/diagrams.Diagnostic]Check the actual flattened curves, including every bridge. Underpass masks exempt no shape or label. Intentional endpoint attachment is owner-scoped. Work exhaustion is an error and never a successful incomplete check.
flowchart_path
fn flowchart_path(edge : @moonrockz/diagrams-svg/flowchart-layout.Connection) -> Stringinspect_connectors
fn inspect_connectors(canonical_svg : String) -> ReadOnlyArray[ResolvedConnector]Inspect a rendered artifact. This accepts only this renderer's generated SVG, not general XML. Original routes and final geometry are immutable values.
render_architecture
fn render_architecture(model : @moonrockz/diagrams/architecture.Architecture, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/architecture-layout.Limits, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.Renderedrender_data_tree
fn render_data_tree(view : @moonrockz/diagrams/data-tree.DataTree, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/data-tree-layout.Limits, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.RenderedRender one standalone data-tree SVG with the same caller-supplied options
as SvgRenderer. Keys and values are escaped text; a stereotype of a
highlight is never style. Highlights use the theme colours.
render_ebnf
fn render_ebnf(grammar : @moonrockz/diagrams/ebnf.Grammar, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/railroad-layout.Limits, trace? : TraceHighlight, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.RenderedRender a grammar railroad with the same options as SvgRenderer.
render_flowchart
fn render_flowchart(view : @moonrockz/diagrams/flowchart.Flowchart, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/flowchart-layout.Limits, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.RenderedRender a standalone flowchart using the shared themes and vector primitives.
render_regex
fn render_regex(model : @moonrockz/diagrams/regex.Regex, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/railroad-layout.Limits, trace? : TraceHighlight, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.RenderedRender a regex railroad with the same options as SvgRenderer. A
supplied trace adds static highlights; no provider is invoked.
render_sequence
fn render_sequence(sequence : @moonrockz/diagrams/sequence.Sequence, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, connectors? : ConnectorOptions) -> StringRender one standalone SVG. Adaptive is the default; fixed selects a palette.
render_state
fn render_state(view : @moonrockz/diagrams/state.StateDiagram, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/state-layout.Limits, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.RenderedRender a standalone state using the shared themes and vector primitives.
render_swimlane
fn render_swimlane(view : @moonrockz/diagrams/swimlane.Swimlane, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, limits? : @moonrockz/diagrams-svg/swimlane-layout.Limits, connectors? : ConnectorOptions) -> @moonrockz/diagrams/render.RenderedRender a standalone swimlane with the same caller-supplied options as SvgRenderer.
state_path
fn state_path(edge : @moonrockz/diagrams-svg/state-layout.Connection) -> Stringswimlane_path
fn swimlane_path(edge : @moonrockz/diagrams-svg/swimlane-layout.Connection) -> String