51 lines
1.9 KiB
Plaintext
51 lines
1.9 KiB
Plaintext
/// Possible participant shapes
|
|
/// #box(width: 100%, align(center)[
|
|
/// #chronos.diagram({
|
|
/// import chronos: *
|
|
/// let _par = _par.with(show-bottom: false)
|
|
/// _par("Foo", display-name: "participant", shape: "participant")
|
|
/// _par("Foo1", display-name: "actor", shape: "actor")
|
|
/// _par("Foo2", display-name: "boundary", shape: "boundary")
|
|
/// _par("Foo3", display-name: "control", shape: "control")
|
|
/// _par("Foo4", display-name: "entity", shape: "entity")
|
|
/// _par("Foo5", display-name: "database", shape: "database")
|
|
/// _par("Foo6", display-name: "collections", shape: "collections")
|
|
/// _par("Foo7", display-name: "queue", shape: "queue")
|
|
/// _par("Foo8", display-name: "custom", shape: "custom", custom-image: TYPST)
|
|
/// _gap()
|
|
/// })
|
|
/// ])
|
|
#let SHAPES = (
|
|
"participant",
|
|
"actor",
|
|
"boundary",
|
|
"control",
|
|
"entity",
|
|
"database",
|
|
"collections",
|
|
"queue",
|
|
"custom"
|
|
)
|
|
|
|
/// Creates a new participant
|
|
/// - name (str): Unique participant name used as reference in other functions
|
|
/// - display-name (auto, content): Name to display in the diagram. If set to `auto`, `name` is used
|
|
/// - from-start (bool): If set to true, the participant is created at the top of the diagram. Otherwise, it is created at the first reference
|
|
/// - invisible (bool): If set to true, the participant will not be shown
|
|
/// - shape (str): The shape of the participant. Possible values in @@SHAPES
|
|
/// - color (color): The participant's color
|
|
/// - custom-image (none, image): If shape is 'custom', sets the custom image to display
|
|
/// - show-bottom (bool): Whether to display the bottom shape
|
|
/// - show-top (bool): Whether to display the top shape
|
|
/// -> array
|
|
#let _par(
|
|
name,
|
|
display-name: auto,
|
|
from-start: true,
|
|
invisible: false,
|
|
shape: "participant",
|
|
color: rgb("#E2E2F0"),
|
|
custom-image: none,
|
|
show-bottom: true,
|
|
show-top: true,
|
|
) = {} |