@diagrammo/dgmo 0.2.19 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -33
- package/dist/cli.cjs +150 -144
- package/dist/index.cjs +9475 -8087
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +124 -1
- package/dist/index.d.ts +124 -1
- package/dist/index.js +9345 -7965
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chart.ts +40 -9
- package/src/class/parser.ts +37 -6
- package/src/class/renderer.ts +11 -8
- package/src/class/types.ts +4 -0
- package/src/cli.ts +38 -3
- package/src/d3.ts +159 -48
- package/src/dgmo-mermaid.ts +7 -1
- package/src/dgmo-router.ts +74 -4
- package/src/diagnostics.ts +77 -0
- package/src/echarts.ts +23 -14
- package/src/er/layout.ts +49 -7
- package/src/er/parser.ts +31 -4
- package/src/er/renderer.ts +2 -1
- package/src/er/types.ts +3 -0
- package/src/graph/flowchart-parser.ts +34 -4
- package/src/graph/flowchart-renderer.ts +35 -32
- package/src/graph/types.ts +4 -0
- package/src/index.ts +22 -0
- package/src/kanban/mutations.ts +183 -0
- package/src/kanban/parser.ts +389 -0
- package/src/kanban/renderer.ts +564 -0
- package/src/kanban/types.ts +45 -0
- package/src/org/layout.ts +97 -66
- package/src/org/parser.ts +50 -15
- package/src/org/renderer.ts +91 -159
- package/src/org/resolver.ts +470 -0
- package/src/sequence/parser.ts +90 -33
- package/src/sequence/renderer.ts +13 -5
package/src/sequence/renderer.ts
CHANGED
|
@@ -275,6 +275,7 @@ function renderDatabaseParticipant(
|
|
|
275
275
|
|
|
276
276
|
// Filled body (no stroke) to hide the top arc of the bottom ellipse
|
|
277
277
|
g.append('rect')
|
|
278
|
+
.attr('class', 'participant-body')
|
|
278
279
|
.attr('x', -W / 2)
|
|
279
280
|
.attr('y', topY)
|
|
280
281
|
.attr('width', W)
|
|
@@ -333,6 +334,7 @@ function renderQueueParticipant(
|
|
|
333
334
|
|
|
334
335
|
// Body rect (no stroke) to hide left arc of right ellipse
|
|
335
336
|
g.append('rect')
|
|
337
|
+
.attr('class', 'participant-body')
|
|
336
338
|
.attr('x', leftX)
|
|
337
339
|
.attr('y', 0)
|
|
338
340
|
.attr('width', bodyW)
|
|
@@ -380,6 +382,7 @@ function renderCacheParticipant(
|
|
|
380
382
|
const s = stroke(palette);
|
|
381
383
|
const dash = '4 3';
|
|
382
384
|
|
|
385
|
+
// Bottom ellipse (back face)
|
|
383
386
|
g.append('ellipse')
|
|
384
387
|
.attr('cx', 0)
|
|
385
388
|
.attr('cy', topY + bodyH)
|
|
@@ -391,6 +394,7 @@ function renderCacheParticipant(
|
|
|
391
394
|
.attr('stroke-dasharray', dash);
|
|
392
395
|
|
|
393
396
|
g.append('rect')
|
|
397
|
+
.attr('class', 'participant-body')
|
|
394
398
|
.attr('x', -W / 2)
|
|
395
399
|
.attr('y', topY)
|
|
396
400
|
.attr('width', W)
|
|
@@ -415,6 +419,7 @@ function renderCacheParticipant(
|
|
|
415
419
|
.attr('stroke-width', SW)
|
|
416
420
|
.attr('stroke-dasharray', dash);
|
|
417
421
|
|
|
422
|
+
// Top ellipse cap
|
|
418
423
|
g.append('ellipse')
|
|
419
424
|
.attr('cx', 0)
|
|
420
425
|
.attr('cy', topY)
|
|
@@ -906,11 +911,13 @@ export function renderSequenceDiagram(
|
|
|
906
911
|
msgToLastStep.set(step.messageIndex, si);
|
|
907
912
|
});
|
|
908
913
|
|
|
909
|
-
// Map a note to the
|
|
910
|
-
// (the
|
|
914
|
+
// Map a note to the last render-step index of its preceding message
|
|
915
|
+
// (the return arrow if present, otherwise the call arrow).
|
|
916
|
+
// This ensures notes are positioned below the return arrow so they
|
|
917
|
+
// don't overlap it.
|
|
911
918
|
// If the note's closest preceding message is hidden (collapsed section), return -1
|
|
912
919
|
// so the note is hidden along with its section.
|
|
913
|
-
const
|
|
920
|
+
const findAssociatedLastStep = (note: SequenceNote): number => {
|
|
914
921
|
// First find the closest preceding message (ignoring hidden filter)
|
|
915
922
|
let closestMsgIndex = -1;
|
|
916
923
|
let closestLine = -1;
|
|
@@ -928,7 +935,7 @@ export function renderSequenceDiagram(
|
|
|
928
935
|
return -1;
|
|
929
936
|
}
|
|
930
937
|
if (closestMsgIndex < 0) return -1;
|
|
931
|
-
return
|
|
938
|
+
return msgToLastStep.get(closestMsgIndex) ?? -1;
|
|
932
939
|
};
|
|
933
940
|
|
|
934
941
|
// Find the first visible message index in an element subtree
|
|
@@ -1254,7 +1261,7 @@ export function renderSequenceDiagram(
|
|
|
1254
1261
|
for (let i = 0; i < els.length; i++) {
|
|
1255
1262
|
const el = els[i];
|
|
1256
1263
|
if (isSequenceNote(el)) {
|
|
1257
|
-
const si =
|
|
1264
|
+
const si = findAssociatedLastStep(el);
|
|
1258
1265
|
if (si < 0) continue;
|
|
1259
1266
|
// Check if there's a preceding note that we should stack below
|
|
1260
1267
|
const prevNote = i > 0 && isSequenceNote(els[i - 1]) ? (els[i - 1] as SequenceNote) : null;
|
|
@@ -1728,6 +1735,7 @@ export function renderSequenceDiagram(
|
|
|
1728
1735
|
.attr('stroke-opacity', 0.5)
|
|
1729
1736
|
.attr('data-participant-id', act.participantId)
|
|
1730
1737
|
.attr('data-msg-lines', coveredLines.join(','))
|
|
1738
|
+
.attr('data-line-number', coveredLines[0] ?? '')
|
|
1731
1739
|
.attr('class', 'activation');
|
|
1732
1740
|
});
|
|
1733
1741
|
|