diff --git a/src/core/draw/delay.typ b/src/core/draw/delay.typ index 9a204ea..3b0a000 100644 --- a/src/core/draw/delay.typ +++ b/src/core/draw/delay.typ @@ -1,5 +1,6 @@ -#import "../utils.typ": get-ctx, set-ctx -#import "../../cetz.typ": draw +#import "/src/cetz.typ": draw + +#import "/src/core/utils.typ": get-ctx, set-ctx #let render(delay) = get-ctx(ctx => { let y0 = ctx.y diff --git a/src/core/draw/event.typ b/src/core/draw/event.typ index df9c027..bc39297 100644 --- a/src/core/draw/event.typ +++ b/src/core/draw/event.typ @@ -1,5 +1,5 @@ -#import "../utils.typ": get-ctx, set-ctx -#import "../../consts.typ": * +#import "/src/consts.typ": * +#import "/src/core/utils.typ": get-ctx, set-ctx #let render(evt) = get-ctx(ctx => { let par-name = evt.participant diff --git a/src/core/draw/group.typ b/src/core/draw/group.typ index 631091a..083aa09 100644 --- a/src/core/draw/group.typ +++ b/src/core/draw/group.typ @@ -1,6 +1,7 @@ -#import "../utils.typ": get-ctx, set-ctx -#import "../../consts.typ": * -#import "../../cetz.typ": draw +#import "/src/cetz.typ": draw + +#import "/src/consts.typ": * +#import "/src/core/utils.typ": get-ctx, set-ctx #let render-start(grp) = get-ctx(ctx => { let grp = grp diff --git a/src/core/draw/note.typ b/src/core/draw/note.typ index af80923..004f1c7 100644 --- a/src/core/draw/note.typ +++ b/src/core/draw/note.typ @@ -1,6 +1,7 @@ -#import "../../consts.typ": * -#import "../utils.typ": get-ctx, set-ctx -#import "../../cetz.typ": draw +#import "/src/cetz.typ": draw + +#import "/src/consts.typ": * +#import "/src/core/utils.typ": get-ctx, set-ctx #let get-size(note) = { let PAD = if note.shape == "hex" {NOTE-HEX-PAD} else {NOTE-PAD} diff --git a/src/core/draw/participant.typ b/src/core/draw/participant.typ index 5f76a4d..e93d715 100644 --- a/src/core/draw/participant.typ +++ b/src/core/draw/participant.typ @@ -1,6 +1,7 @@ -#import "../../consts.typ": * -#import "../../cetz.typ": draw -#import "../utils.typ": get-ctx, set-ctx, get-style +#import "/src/cetz.typ": draw + +#import "/src/consts.typ": * +#import "/src/core/utils.typ": get-ctx, get-style, set-ctx #let get-size(par) = { if par.invisible { diff --git a/src/core/draw/separator.typ b/src/core/draw/separator.typ index 44b0f23..ecc0db2 100644 --- a/src/core/draw/separator.typ +++ b/src/core/draw/separator.typ @@ -1,6 +1,7 @@ -#import "../utils.typ": get-ctx, set-ctx -#import "../../consts.typ": * -#import "../../cetz.typ": draw +#import "/src/cetz.typ": draw + +#import "/src/consts.typ": * +#import "/src/core/utils.typ": get-ctx, set-ctx #let render(sep) = get-ctx(ctx => { ctx.y -= Y-SPACE diff --git a/src/core/draw/sequence.typ b/src/core/draw/sequence.typ index 17c5ffc..81c591a 100644 --- a/src/core/draw/sequence.typ +++ b/src/core/draw/sequence.typ @@ -1,8 +1,8 @@ -#import "../utils.typ": get-ctx, set-ctx -#import "../../consts.typ": * -#import "../../cetz.typ": draw, vector -#import "note.typ" +#import "/src/cetz.typ": draw, vector +#import "note.typ" +#import "/src/consts.typ": * +#import "/src/core/utils.typ": get-ctx, set-ctx #let get-arrow-marks(sym, color) = { if sym == none { diff --git a/src/core/draw/sync.typ b/src/core/draw/sync.typ index 6c63522..1a300a7 100644 --- a/src/core/draw/sync.typ +++ b/src/core/draw/sync.typ @@ -1,4 +1,4 @@ -#import "../utils.typ": get-ctx, set-ctx, is-elmt +#import "/src/core/utils.typ": get-ctx, is-elmt, set-ctx #let render(sync) = get-ctx(ctx => { set-ctx(c => { diff --git a/src/core/renderer.typ b/src/core/renderer.typ index 4f604d8..a4d341a 100644 --- a/src/core/renderer.typ +++ b/src/core/renderer.typ @@ -1,14 +1,13 @@ -#import "/src/cetz.typ" as cetz: canvas, draw -#import "utils.typ": * -#import "../group.typ" -//#import "../participant.typ" -//#import participant: PAR-SPECIALS -#import "draw/participant.typ" -#import "../sequence.typ" -#import "../separator.typ" -#import "../sync.typ" -#import "../consts.typ": * +#import "/src/cetz.typ": canvas, draw + #import "draw/note.typ": get-box as get-note-box, get-size as get-note-size +#import "draw/participant.typ" +#import "utils.typ": * +#import "/src/consts.typ": * +#import "/src/group.typ" +#import "/src/separator.typ" +#import "/src/sequence.typ" +#import "/src/sync.typ" #let DEBUG-INVISIBLE = false diff --git a/src/core/setup.typ b/src/core/setup.typ index 85b9444..3d8f7fe 100644 --- a/src/core/setup.typ +++ b/src/core/setup.typ @@ -1,6 +1,7 @@ -#import "utils.typ": is-elmt, get-group-span -#import "../participant.typ": _exists as par-exists, _par #import "draw/group.typ": render-end as grp-render-end +#import "utils.typ": get-group-span, is-elmt +#import "/src/participant.typ": _exists as par-exists, _par +#import "/src/sequence.typ": _seq #let flatten-group(elmts, i) = { let group = elmts.at(i) diff --git a/src/core/utils.typ b/src/core/utils.typ index dfc682a..7698037 100644 --- a/src/core/utils.typ +++ b/src/core/utils.typ @@ -1,4 +1,4 @@ -#import "../cetz.typ": draw +#import "/src/cetz.typ": draw #let is-elmt(elmt) = { if type(elmt) != dictionary { diff --git a/src/diagram.typ b/src/diagram.typ index 41335c4..aafa73b 100644 --- a/src/diagram.typ +++ b/src/diagram.typ @@ -1,9 +1,7 @@ -#import "core/utils.typ": fit-canvas, set-ctx -#import "core/renderer.typ": render -#import "participant.typ" as participant: _par, PAR-SPECIALS -#import "sequence.typ": _seq #import "core/draw/event.typ": render as evt-render +#import "core/renderer.typ": render #import "core/setup.typ": setup +#import "core/utils.typ": fit-canvas, set-ctx #let gap-render(gap) = set-ctx(ctx => { ctx.y -= gap.size diff --git a/src/group.typ b/src/group.typ index fcaa43d..8e29d6f 100644 --- a/src/group.typ +++ b/src/group.typ @@ -1,5 +1,3 @@ -#import "/src/cetz.typ": draw -#import "consts.typ": * #import "core/draw/group.typ" #let _grp(name, desc: none, type: "default", elmts) = { diff --git a/src/note.typ b/src/note.typ index 0c62e5c..948b8d5 100644 --- a/src/note.typ +++ b/src/note.typ @@ -1,4 +1,3 @@ -#import "/src/cetz.typ": draw #import "consts.typ": * #import "core/draw/note.typ" diff --git a/src/participant.typ b/src/participant.typ index 1c2ca3e..57f0383 100644 --- a/src/participant.typ +++ b/src/participant.typ @@ -1,6 +1,4 @@ -#import "/src/cetz.typ": draw -#import "consts.typ": * -#import "core/draw/participant.typ": render as par-render +#import "core/draw/participant.typ" #let PAR-SPECIALS = "?[]" #let SHAPES = ( @@ -37,7 +35,7 @@ } return (( type: "par", - draw: par-render, + draw: participant.render, name: name, display-name: if display-name == auto {name} else {display-name}, from-start: from-start, diff --git a/src/separator.typ b/src/separator.typ index 68de017..46815e8 100644 --- a/src/separator.typ +++ b/src/separator.typ @@ -1,7 +1,5 @@ -#import "/src/cetz.typ": draw -#import "consts.typ": * -#import "core/draw/separator.typ" #import "core/draw/delay.typ" +#import "core/draw/separator.typ" #let _sep(name) = { return (( diff --git a/src/sequence.typ b/src/sequence.typ index a3e367c..c99df3a 100644 --- a/src/sequence.typ +++ b/src/sequence.typ @@ -1,7 +1,3 @@ -#import "/src/cetz.typ": draw, vector -#import "consts.typ": * -#import "participant.typ" -#import "note.typ" #import "core/draw/sequence.typ" #let _seq( diff --git a/src/sync.typ b/src/sync.typ index 85106ff..5d6ce2e 100644 --- a/src/sync.typ +++ b/src/sync.typ @@ -1,4 +1,3 @@ -#import "sequence.typ" #import "core/draw/sync.typ" #let _sync(elmts) = {