moonrockz/diagrams/sequence
Types
Autonumber
pub(all) enum Autonumber {
On(start~ : Double?, step~ : Double?)
Off
} derive(Eq, @moonbitlang/core/debug.Debug)A numbering change at this point in the event stream.
Autonumber::equal
fn Autonumber::equal(Autonumber, Autonumber) -> BoolAutonumber::not_equal
fn Autonumber::not_equal(x : Autonumber, y : Autonumber) -> BoolAutonumber::to_repr
fn Autonumber::to_repr(Autonumber) -> @moonbitlang/core/debug.ReprBoxGroup
pub struct BoxGroup {
id : String
label : String
colour : String?
} derive(Eq, @moonbitlang/core/debug.Debug)A box group. id distinguishes groups that have the same label.
BoxGroup::equal
fn BoxGroup::equal(BoxGroup, BoxGroup) -> BoolBoxGroup::new
fn BoxGroup::new(id : String, label : String, colour? : String) -> BoxGroupBoxGroup::not_equal
fn BoxGroup::not_equal(x : BoxGroup, y : BoxGroup) -> BoolBoxGroup::to_repr
fn BoxGroup::to_repr(BoxGroup) -> @moonbitlang/core/debug.ReprEvent
pub(all) enum Event {
Message(Message)
Note(Note)
Activate(String)
Deactivate(String)
Create(String)
Destroy(String)
Frame(Frame)
Autonumber(Autonumber)
} derive(Eq, @moonbitlang/core/debug.Debug)One event of a sequence, in diagram order.
Event::equal
fn Event::equal(Event, Event) -> BoolEvent::not_equal
fn Event::not_equal(x : Event, y : Event) -> BoolEvent::to_repr
fn Event::to_repr(Event) -> @moonbitlang/core/debug.ReprFrame
pub struct Frame {
kind : FrameKind
sections : ReadOnlyArray[Section]
colour : String?
} derive(Eq, @moonbitlang/core/debug.Debug)A nested frame. A first section is required; colour belongs to rect frames.
The colour is stored on the frame rather than as a section label.
Frame::equal
fn Frame::equal(Frame, Frame) -> BoolFrame::new
fn Frame::new(kind : FrameKind, first : Section, rest? : ArrayView[Section], colour? : String) -> FrameFrame::not_equal
fn Frame::not_equal(x : Frame, y : Frame) -> BoolFrame::to_repr
fn Frame::to_repr(Frame) -> @moonbitlang/core/debug.ReprFrameKind
pub(all) enum FrameKind {
Loop
Alt
Opt
Par
ParOver
Critical
Break
Rect
Try
} derive(Eq, @moonbitlang/core/debug.Debug)The meaning of a frame. ParOver permits overlapping parallel sections.
FrameKind::equal
fn FrameKind::equal(FrameKind, FrameKind) -> BoolFrameKind::not_equal
fn FrameKind::not_equal(x : FrameKind, y : FrameKind) -> BoolFrameKind::to_repr
fn FrameKind::to_repr(FrameKind) -> @moonbitlang/core/debug.ReprHead
pub(all) enum Head {
NoHead
Arrow
OpenArrow
Cross
Async
HalfArrow(upper~ : Bool, filled~ : Bool)
Central(Head)
} derive(Eq, @moonbitlang/core/debug.Debug)What a message line has at one of its ends.
Head::equal
fn Head::equal(Head, Head) -> BoolHead::not_equal
fn Head::not_equal(x : Head, y : Head) -> BoolHead::to_repr
fn Head::to_repr(Head) -> @moonbitlang/core/debug.ReprLineStyle
pub(all) enum LineStyle {
Solid
Dotted
} derive(Eq, @moonbitlang/core/debug.Debug)The line of a message.
LineStyle::equal
fn LineStyle::equal(LineStyle, LineStyle) -> BoolLineStyle::not_equal
fn LineStyle::not_equal(x : LineStyle, y : LineStyle) -> BoolLineStyle::to_repr
fn LineStyle::to_repr(LineStyle) -> @moonbitlang/core/debug.ReprLink
pub struct Link {
scheme : LinkScheme
target : String
} derive(Eq, @moonbitlang/core/debug.Debug)A format-independent link. Smithy targets use the canonical # spelling.
Link::equal
fn Link::equal(Link, Link) -> BoolLink::new
fn Link::new(scheme : LinkScheme, target : String) -> LinkLink::not_equal
fn Link::not_equal(x : Link, y : Link) -> BoolLink::to_repr
fn Link::to_repr(Link) -> @moonbitlang/core/debug.ReprLinkScheme
pub(all) enum LinkScheme {
Smithy
OpenRpc
} derive(Eq, @moonbitlang/core/debug.Debug)The schemes understood by diagram adapters.
LinkScheme::equal
fn LinkScheme::equal(LinkScheme, LinkScheme) -> BoolLinkScheme::not_equal
fn LinkScheme::not_equal(x : LinkScheme, y : LinkScheme) -> BoolLinkScheme::to_repr
fn LinkScheme::to_repr(LinkScheme) -> @moonbitlang/core/debug.ReprMessage
pub struct Message {
sender : String
receiver : String
line : LineStyle
sender_head : Head
receiver_head : Head
label : String
link : Link?
properties : MessageProperties?
number : Double?
} derive(Eq, @moonbitlang/core/debug.Debug)A message from sender to receiver.
Message::equal
fn Message::equal(Message, Message) -> BoolMessage::new
fn Message::new(sender : String, receiver : String, label : String, line? : LineStyle, sender_head? : Head, receiver_head? : Head, link? : Link, properties? : MessageProperties, number? : Double) -> MessageA message. The default is a solid line with an arrowhead at the receiver.
Message::not_equal
fn Message::not_equal(x : Message, y : Message) -> BoolMessage::to_repr
fn Message::to_repr(Message) -> @moonbitlang/core/debug.ReprMessage::with_properties
fn Message::with_properties(self : Message, properties : MessageProperties) -> MessageMessageProperties
pub struct MessageProperties {
sublabel : String?
description : String?
} derive(Eq, @moonbitlang/core/debug.Debug)Additional message text supplied by an adapter.
MessageProperties::equal
fn MessageProperties::equal(MessageProperties, MessageProperties) -> BoolMessageProperties::new
fn MessageProperties::new(sublabel? : String, description? : String) -> MessagePropertiesMessageProperties::not_equal
fn MessageProperties::not_equal(x : MessageProperties, y : MessageProperties) -> BoolMessageProperties::to_repr
fn MessageProperties::to_repr(MessageProperties) -> @moonbitlang/core/debug.ReprNote
pub struct Note {
placement : Placement
participants : ReadOnlyArray[String]
text : String
} derive(Eq, @moonbitlang/core/debug.Debug)A note on one or more participants.
Note::equal
fn Note::equal(Note, Note) -> BoolNote::new
fn Note::new(placement : Placement, participants : ArrayView[String], text : String) -> NoteNote::not_equal
fn Note::not_equal(x : Note, y : Note) -> BoolNote::to_repr
fn Note::to_repr(Note) -> @moonbitlang/core/debug.ReprParticipant
pub struct Participant {
id : String
label : String
kind : ParticipantKind
group : BoxGroup?
link : Link?
icon : @moonrockz/diagrams/icons.Reference?
properties : ParticipantProperties?
} derive(Eq, @moonbitlang/core/debug.Debug)One participant of a sequence. id is unique in the sequence.
Participant::equal
fn Participant::equal(Participant, Participant) -> BoolParticipant::new
fn Participant::new(id : String, label? : String, kind? : ParticipantKind, group? : BoxGroup, link? : Link, properties? : ParticipantProperties, icon? : @moonrockz/diagrams/icons.Reference) -> ParticipantA participant. The label is the id when no label is given.
Participant::not_equal
fn Participant::not_equal(x : Participant, y : Participant) -> BoolParticipant::render_kind
fn Participant::render_kind(self : Participant) -> ParticipantKindThe kind for rendering, falling back to the declared kind.
Participant::to_repr
fn Participant::to_repr(Participant) -> @moonbitlang/core/debug.ReprParticipant::with_properties
fn Participant::with_properties(self : Participant, properties : ParticipantProperties) -> ParticipantReturn a participant with new render properties, leaving the input unchanged.
ParticipantKind
pub(all) enum ParticipantKind {
Participant
Actor
Boundary
Control
Entity
Database
Collections
Queue
Service
Resource
Client
} derive(Eq, @moonbitlang/core/debug.Debug)What a participant is. A renderer uses the kind to select a style.
ParticipantKind::equal
fn ParticipantKind::equal(ParticipantKind, ParticipantKind) -> BoolParticipantKind::not_equal
fn ParticipantKind::not_equal(x : ParticipantKind, y : ParticipantKind) -> BoolParticipantKind::to_repr
fn ParticipantKind::to_repr(ParticipantKind) -> @moonbitlang/core/debug.ReprParticipantProperties
pub struct ParticipantProperties {
kind : ParticipantKind?
sublabel : String?
description : String?
} derive(Eq, @moonbitlang/core/debug.Debug)Properties supplied by an adapter. The declared kind stays on the participant.
ParticipantProperties::equal
fn ParticipantProperties::equal(ParticipantProperties, ParticipantProperties) -> BoolParticipantProperties::new
fn ParticipantProperties::new(kind? : ParticipantKind, sublabel? : String, description? : String) -> ParticipantPropertiesParticipantProperties::not_equal
fn ParticipantProperties::not_equal(x : ParticipantProperties, y : ParticipantProperties) -> BoolParticipantProperties::to_repr
fn ParticipantProperties::to_repr(ParticipantProperties) -> @moonbitlang/core/debug.ReprPlacement
pub(all) enum Placement {
LeftOf
RightOf
Over
} derive(Eq, @moonbitlang/core/debug.Debug)The placement of a note.
Placement::equal
fn Placement::equal(Placement, Placement) -> BoolPlacement::not_equal
fn Placement::not_equal(x : Placement, y : Placement) -> BoolPlacement::to_repr
fn Placement::to_repr(Placement) -> @moonbitlang/core/debug.ReprResolution
pub struct Resolution {
sequence : Sequence
diagnostics : ReadOnlyArray[@moonrockz/diagrams.Diagnostic]
}A resolved model and warnings for targets absent from the source.
Section
pub struct Section {
role : SectionRole
label : String?
events : ReadOnlyArray[Event]
} derive(Eq, @moonbitlang/core/debug.Debug)Section::equal
fn Section::equal(Section, Section) -> BoolSection::new
fn Section::new(events : ArrayView[Event], label? : String, role? : SectionRole) -> SectionSection::not_equal
fn Section::not_equal(x : Section, y : Section) -> BoolSection::to_repr
fn Section::to_repr(Section) -> @moonbitlang/core/debug.ReprSectionRole
pub(all) enum SectionRole {
Plain
Try
Catch
Finally
} derive(Eq, @moonbitlang/core/debug.Debug)One ordered section of a frame.
SectionRole::equal
fn SectionRole::equal(SectionRole, SectionRole) -> BoolSectionRole::not_equal
fn SectionRole::not_equal(x : SectionRole, y : SectionRole) -> BoolSectionRole::to_repr
fn SectionRole::to_repr(SectionRole) -> @moonbitlang/core/debug.ReprSequence
pub struct Sequence {
participants : ReadOnlyArray[Participant]
events : ReadOnlyArray[Event]
title : String?
accessibility_title : String?
accessibility_description : String?
} derive(Eq, @moonbitlang/core/debug.Debug)A sequence diagram without a link to one diagram format.
Sequence::equal
fn Sequence::equal(Sequence, Sequence) -> BoolSequence::new
fn Sequence::new(participants : ArrayView[Participant], events : ArrayView[Event], title? : String, accessibility_title? : String, accessibility_description? : String) -> SequenceA sequence. The model keeps copies of participants and events, so a
later change to the input arrays does not change it.
Sequence::not_equal
fn Sequence::not_equal(x : Sequence, y : Sequence) -> BoolSequence::participant
fn Sequence::participant(self : Sequence, id : String) -> Participant?The participant with the id id.
Sequence::to_repr
fn Sequence::to_repr(Sequence) -> @moonbitlang/core/debug.ReprTraits
LinkSource
pub(open) trait LinkSource {
fn participant(Self, Link) -> ParticipantProperties?
fn message(Self, Link) -> MessageProperties?
}A pure adapter for a source such as a Smithy model. Implementations return
only render properties. resolve keeps all diagram structure and links.
Values
resolve
fn[S : LinkSource] resolve(sequence : Sequence, source : S) -> ResolutionResolve links without changing the input or allowing the source to replace participants, events, labels, numbering or links. Existing properties remain when a source does not know a target.