diff --git a/gallery/example3.pdf b/gallery/example3.pdf index 60c3e2b..21602b3 100644 Binary files a/gallery/example3.pdf and b/gallery/example3.pdf differ diff --git a/gallery/example3.typ b/gallery/example3.typ index 3cdce3a..4c48a04 100644 --- a/gallery/example3.typ +++ b/gallery/example3.typ @@ -133,4 +133,15 @@ chronos.diagram({ _seq("a", "a", end-tip: ("o", "//"), comment: `-//o`) _seq("a", "a", start-tip: "x", end-tip: ("o", ">"), comment: `x->o`) }) -) \ No newline at end of file +) + +#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() +}) \ No newline at end of file diff --git a/src/participant.typ b/src/participant.typ index 9d7ad3d..d1ec7ef 100644 --- a/src/participant.typ +++ b/src/participant.typ @@ -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 ),) } diff --git a/src/renderer.typ b/src/renderer.typ index f55aa8f..ace3830 100644 --- a/src/renderer.typ +++ b/src/renderer.typ @@ -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,7 +417,9 @@ } // Draw participants (end) - draw-par(p, y: y, bottom: true) + if p.show-bottom { + draw-par(p, y: y, bottom: true) + } } })