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.

Source

ChannelStyle::equal

fn ChannelStyle::equal(ChannelStyle, ChannelStyle) -> Bool

Source

ChannelStyle::hidden

fn ChannelStyle::hidden() -> ChannelStyle

A hidden channel.

Source

ChannelStyle::new

fn ChannelStyle::new(visible? : Bool, color? : @moonrockz/diagrams-svg/theme.Color, width? : Double, dashed? : Bool) -> ChannelStyle

Source

ChannelStyle::not_equal

fn ChannelStyle::not_equal(x : ChannelStyle, y : ChannelStyle) -> Bool

Source

ChannelStyle::to_repr

fn ChannelStyle::to_repr(ChannelStyle) -> @moonbitlang/core/debug.Repr

Source

ConnectorCommand

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.

Source

ConnectorCommand::equal

fn ConnectorCommand::equal(ConnectorCommand, ConnectorCommand) -> Bool

Source

ConnectorCommand::not_equal

fn ConnectorCommand::not_equal(x : ConnectorCommand, y : ConnectorCommand) -> Bool

Source

ConnectorCommand::to_repr

fn ConnectorCommand::to_repr(ConnectorCommand) -> @moonbitlang/core/debug.Repr

Source

ConnectorGeometry

pub struct ConnectorGeometry {
  paths : ReadOnlyArray[ResolvedConnector]
  diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
} derive(Eq, @moonbitlang/core/debug.Debug)

Source

ConnectorGeometry::equal

fn ConnectorGeometry::equal(ConnectorGeometry, ConnectorGeometry) -> Bool

Source

ConnectorGeometry::not_equal

fn ConnectorGeometry::not_equal(x : ConnectorGeometry, y : ConnectorGeometry) -> Bool

Source

ConnectorGeometry::to_repr

fn ConnectorGeometry::to_repr(ConnectorGeometry) -> @moonbitlang/core/debug.Repr

Source

ConnectorLimits

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.

Source

ConnectorLimits::equal

fn ConnectorLimits::equal(ConnectorLimits, ConnectorLimits) -> Bool

Source

ConnectorLimits::new

fn ConnectorLimits::new(candidates? : Int, subdivisions? : Int, segments? : Int, crossings? : Int, output_units? : Int) -> ConnectorLimits

Source

ConnectorLimits::not_equal

fn ConnectorLimits::not_equal(x : ConnectorLimits, y : ConnectorLimits) -> Bool

Source

ConnectorLimits::to_repr

fn ConnectorLimits::to_repr(ConnectorLimits) -> @moonbitlang/core/debug.Repr

Source

ConnectorObstacle

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.

Source

ConnectorObstacle::equal

fn ConnectorObstacle::equal(ConnectorObstacle, ConnectorObstacle) -> Bool

Source

ConnectorObstacle::not_equal

fn ConnectorObstacle::not_equal(x : ConnectorObstacle, y : ConnectorObstacle) -> Bool

Source

ConnectorObstacle::to_repr

fn ConnectorObstacle::to_repr(ConnectorObstacle) -> @moonbitlang/core/debug.Repr

Source

ConnectorOptions

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)

Source

ConnectorOptions::equal

fn ConnectorOptions::equal(ConnectorOptions, ConnectorOptions) -> Bool

Source

ConnectorOptions::new

fn ConnectorOptions::new(style? : ConnectorStyle, crossing? : CrossingMode, minimum_approach? : Double, corner_radius? : Double, bridge_radius? : Double, style_supplied_bpmn? : Bool, limits? : ConnectorLimits) -> ConnectorOptions

Source

ConnectorOptions::not_equal

fn ConnectorOptions::not_equal(x : ConnectorOptions, y : ConnectorOptions) -> Bool

Source

ConnectorOptions::to_repr

fn ConnectorOptions::to_repr(ConnectorOptions) -> @moonbitlang/core/debug.Repr

Source

ConnectorPath

pub struct ConnectorPath {
  commands : ReadOnlyArray[ConnectorCommand]
} derive(Eq, @moonbitlang/core/debug.Debug)

Source

ConnectorPath::equal

fn ConnectorPath::equal(ConnectorPath, ConnectorPath) -> Bool

Source

ConnectorPath::new

fn ConnectorPath::new(commands : ArrayView[ConnectorCommand]) -> ConnectorPath?

Construct immutable absolute geometry, refusing invalid numeric coordinates.

Source

ConnectorPath::not_equal

fn ConnectorPath::not_equal(x : ConnectorPath, y : ConnectorPath) -> Bool

Source

ConnectorPath::parse

fn ConnectorPath::parse(source : String) -> ConnectorPath?

Read the renderer's absolute path dialect. No author markup is interpreted.

Source

ConnectorPath::svg

fn ConnectorPath::svg(self : ConnectorPath) -> String

Source

ConnectorPath::to_repr

fn ConnectorPath::to_repr(ConnectorPath) -> @moonbitlang/core/debug.Repr

Source

ConnectorPoint

pub(all) struct ConnectorPoint {
  x : Double
  y : Double
} derive(Eq, @moonbitlang/core/debug.Debug)

Source

ConnectorPoint::equal

fn ConnectorPoint::equal(ConnectorPoint, ConnectorPoint) -> Bool

Source

ConnectorPoint::not_equal

fn ConnectorPoint::not_equal(x : ConnectorPoint, y : ConnectorPoint) -> Bool

Source

ConnectorPoint::to_repr

fn ConnectorPoint::to_repr(ConnectorPoint) -> @moonbitlang/core/debug.Repr

Source

ConnectorStyle

pub(all) enum ConnectorStyle {
  Elbow
  Rounded
  Curved
} derive(Eq, @moonbitlang/core/debug.Debug)

Explicit presentation style. Omission preserves intrinsic family geometry.

Source

ConnectorStyle::equal

fn ConnectorStyle::equal(ConnectorStyle, ConnectorStyle) -> Bool

Source

ConnectorStyle::not_equal

fn ConnectorStyle::not_equal(x : ConnectorStyle, y : ConnectorStyle) -> Bool

Source

ConnectorStyle::to_repr

fn ConnectorStyle::to_repr(ConnectorStyle) -> @moonbitlang/core/debug.Repr

Source

CrossingMode

pub(all) enum CrossingMode {
  Bridge
  Plain
} derive(Eq, @moonbitlang/core/debug.Debug)

Source

CrossingMode::equal

fn CrossingMode::equal(CrossingMode, CrossingMode) -> Bool

Source

CrossingMode::not_equal

fn CrossingMode::not_equal(x : CrossingMode, y : CrossingMode) -> Bool

Source

CrossingMode::to_repr

fn CrossingMode::to_repr(CrossingMode) -> @moonbitlang/core/debug.Repr

Source

Mode

pub(all) enum Mode {
  Adaptive
  Fixed(Variant)
} derive(Eq, @moonbitlang/core/debug.Debug)

Adaptive uses CSS variables; fixed writes literal presentation attributes.

Source

Mode::equal

fn Mode::equal(Mode, Mode) -> Bool

Source

Mode::not_equal

fn Mode::not_equal(x : Mode, y : Mode) -> Bool

Source

Mode::to_repr

fn Mode::to_repr(Mode) -> @moonbitlang/core/debug.Repr

Source

NodeBinding

pub struct NodeBinding {
  endpoint : String
  kind : NodeBindingKind
}

Source

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)

Source

NodeBindingKind::equal

fn NodeBindingKind::equal(NodeBindingKind, NodeBindingKind) -> Bool

Source

NodeBindingKind::not_equal

fn NodeBindingKind::not_equal(x : NodeBindingKind, y : NodeBindingKind) -> Bool

Source

NodeBindingKind::to_repr

fn NodeBindingKind::to_repr(NodeBindingKind) -> @moonbitlang/core/debug.Repr

Source

PathBinding

pub struct PathBinding {
  occurrence : @moonrockz/diagrams/animation.Occurrence
  id : String
  path : String
  mask : String?
}

Source

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.

Source

ResolvedConnector::equal

fn ResolvedConnector::equal(ResolvedConnector, ResolvedConnector) -> Bool

Source

ResolvedConnector::not_equal

fn ResolvedConnector::not_equal(x : ResolvedConnector, y : ResolvedConnector) -> Bool

Source

ResolvedConnector::to_repr

fn ResolvedConnector::to_repr(ResolvedConnector) -> @moonbitlang/core/debug.Repr

Source

Scene

pub struct Scene {
  canonical_svg : String
  display_svg : String
  catalog : @moonrockz/diagrams/animation.Catalog
  paths : ReadOnlyArray[PathBinding]
  nodes : ReadOnlyArray[NodeBinding]
}

Source

SceneResult

pub struct SceneResult {
  scene : Scene?
  diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}

Source

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.

Source

SvgRenderer::connector_geometry

fn SvgRenderer::connector_geometry(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram) -> ConnectorGeometry

Render and inspect in one layout pass. Diagnostics include refused styling.

Source

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) -> SvgRenderer

Source

SvgRenderer::render

fn SvgRenderer::render(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram) -> @moonrockz/diagrams/render.Rendered

Source

SvgRenderer::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) -> TracedRender

Invoke 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.

Source

SvgRenderer::scene

fn SvgRenderer::scene(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram, sequence_view_id? : String, limits? : @moonrockz/diagrams/animation.Limits, output_units? : Int) -> SceneResult

Both 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.

Source

impl Renderer for SvgRenderer

Renderer::render

fn render(self : SvgRenderer, diagram : @moonrockz/diagrams/render.Diagram) -> @moonrockz/diagrams/render.Rendered

Source

TraceHighlight

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.

Source

TraceHighlight::equal

fn TraceHighlight::equal(TraceHighlight, TraceHighlight) -> Bool

Source

TraceHighlight::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) -> TraceHighlight

Source

TraceHighlight::not_equal

fn TraceHighlight::not_equal(x : TraceHighlight, y : TraceHighlight) -> Bool

Source

TraceHighlight::to_repr

fn TraceHighlight::to_repr(TraceHighlight) -> @moonbitlang/core/debug.Repr

Source

TracedRender

pub struct TracedRender {
  run : @moonrockz/diagrams/railroad-trace.TraceRun
  rendered : @moonrockz/diagrams/render.Rendered
}

The result of the explicit provider-and-render driver.

Source

TracedRender::refused

fn TracedRender::refused(diagnostics : ArrayView[@moonrockz/diagrams.Diagnostic]) -> TracedRender

A traced render that did not reach a provider, with the reasons.

Source

Variant

pub(all) enum Variant {
  Dark
  Light
} derive(Eq, @moonbitlang/core/debug.Debug)

The palette selected by fixed output.

Source

Variant::equal

fn Variant::equal(Variant, Variant) -> Bool

Source

Variant::not_equal

fn Variant::not_equal(x : Variant, y : Variant) -> Bool

Source

Variant::to_repr

fn Variant::to_repr(Variant) -> @moonbitlang/core/debug.Repr

Source

Values

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.

Source

bpmn_path

fn bpmn_path(flow : @moonrockz/diagrams/bpmn.Flow) -> String

Integer convenience path retained for the first motion-plan API.

Source

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.

Source

flowchart_path

fn flowchart_path(edge : @moonrockz/diagrams-svg/flowchart-layout.Connection) -> String

Source

inspect_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.

Source

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.Rendered

Source

render_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.Rendered

Render 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.

Source

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.Rendered

Render a grammar railroad with the same options as SvgRenderer.

Source

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.Rendered

Render a standalone flowchart using the shared themes and vector primitives.

Source

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.Rendered

Render a regex railroad with the same options as SvgRenderer. A supplied trace adds static highlights; no provider is invoked.

Source

render_sequence

fn render_sequence(sequence : @moonrockz/diagrams/sequence.Sequence, theme? : @moonrockz/diagrams-svg/theme.Theme, mode? : Mode, id_prefix? : String, connectors? : ConnectorOptions) -> String

Render one standalone SVG. Adaptive is the default; fixed selects a palette.

Source

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.Rendered

Render a standalone state using the shared themes and vector primitives.

Source

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.Rendered

Render a standalone swimlane with the same caller-supplied options as SvgRenderer.

Source

state_path

fn state_path(edge : @moonrockz/diagrams-svg/state-layout.Connection) -> String

Source

swimlane_path

fn swimlane_path(edge : @moonrockz/diagrams-svg/swimlane-layout.Connection) -> String

Source