added show-top / -bottom options to participants
This commit is contained in:
parent
b9bbe6f93d
commit
eb05c41810
Binary file not shown.
@ -134,3 +134,14 @@ chronos.diagram({
|
||||
_seq("a", "a", start-tip: "x", end-tip: ("o", ">"), comment: `x->o`)
|
||||
})
|
||||
)
|
||||
|
||||
#chronos.diagram({
|
||||
import chronos: *
|
||||
|
||||
_par("a", display-name: "Alice")
|
||||
_par("b", display-name: "Bob", show-bottom: false)
|
||||
_par("c", display-name: "Caleb", show-top: false)
|
||||
_par("d", display-name: "Danny", show-bottom: false, show-top: false)
|
||||
|
||||
_gap()
|
||||
})
|
@ -21,7 +21,9 @@
|
||||
invisible: false,
|
||||
shape: "participant",
|
||||
color: rgb("#E2E2F0"),
|
||||
custom-image: none
|
||||
custom-image: none,
|
||||
show-bottom: true,
|
||||
show-top: true,
|
||||
) = {
|
||||
return ((
|
||||
type: "par",
|
||||
@ -31,7 +33,9 @@
|
||||
invisible: invisible,
|
||||
shape: shape,
|
||||
color: color,
|
||||
custom-image: custom-image
|
||||
custom-image: custom-image,
|
||||
show-bottom: show-bottom,
|
||||
show-top: show-top
|
||||
),)
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@
|
||||
|
||||
// Draw participants (start)
|
||||
for p in participants {
|
||||
if p.from-start and not p.invisible {
|
||||
if p.from-start and not p.invisible and p.show-top {
|
||||
shapes += draw-par(p)
|
||||
}
|
||||
}
|
||||
@ -417,8 +417,10 @@
|
||||
}
|
||||
|
||||
// Draw participants (end)
|
||||
if p.show-bottom {
|
||||
draw-par(p, y: y, bottom: true)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
shapes
|
||||
|
Loading…
Reference in New Issue
Block a user