@diagrammo/dgmo 0.24.0 → 0.25.0
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/LICENSE +1 -1
- package/dist/advanced.cjs +14 -18
- package/dist/advanced.js +14 -18
- package/dist/auto.cjs +15 -19
- package/dist/auto.js +99 -99
- package/dist/auto.mjs +15 -19
- package/dist/cli.cjs +132 -132
- package/dist/index.cjs +14 -18
- package/dist/index.js +14 -18
- package/dist/internal.cjs +14 -18
- package/dist/internal.js +14 -18
- package/package.json +1 -1
- package/src/diagnostics.ts +0 -19
- package/src/map/geo.ts +0 -5
- package/src/sequence/parser.ts +0 -4
- package/src/utils/brand.ts +0 -17
- package/src/utils/legend-d3.ts +18 -8
- package/src/utils/parsing.ts +0 -16
- package/src/utils/reserved-key-registry.ts +0 -12
package/LICENSE
CHANGED
package/dist/advanced.cjs
CHANGED
|
@@ -840,7 +840,7 @@ function withTagAliases(base, aliases) {
|
|
|
840
840
|
function isReservedKey(registry, key) {
|
|
841
841
|
return registry.keys.has(key) || registry.tagAliases.has(key);
|
|
842
842
|
}
|
|
843
|
-
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY,
|
|
843
|
+
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY, KANBAN_REGISTRY, SITEMAP_REGISTRY, GANTT_REGISTRY, PERT_REGISTRY, BOXES_AND_LINES_REGISTRY, TIMELINE_REGISTRY, MINDMAP_REGISTRY, TECH_RADAR_REGISTRY, CYCLE_REGISTRY, JOURNEY_MAP_REGISTRY, PYRAMID_REGISTRY, RING_REGISTRY, RACI_REGISTRY;
|
|
844
844
|
var init_reserved_key_registry = __esm({
|
|
845
845
|
"src/utils/reserved-key-registry.ts"() {
|
|
846
846
|
"use strict";
|
|
@@ -884,10 +884,6 @@ var init_reserved_key_registry = __esm({
|
|
|
884
884
|
"description",
|
|
885
885
|
"domain"
|
|
886
886
|
]);
|
|
887
|
-
CLASS_REGISTRY = staticRegistry([
|
|
888
|
-
"color",
|
|
889
|
-
"description"
|
|
890
|
-
]);
|
|
891
887
|
KANBAN_REGISTRY = staticRegistry([
|
|
892
888
|
"color",
|
|
893
889
|
"description",
|
|
@@ -963,7 +959,6 @@ var init_reserved_key_registry = __esm({
|
|
|
963
959
|
"color",
|
|
964
960
|
"description"
|
|
965
961
|
]);
|
|
966
|
-
WIREFRAME_REGISTRY = staticRegistry([]);
|
|
967
962
|
}
|
|
968
963
|
});
|
|
969
964
|
|
|
@@ -4236,6 +4231,9 @@ var init_legend_layout = __esm({
|
|
|
4236
4231
|
});
|
|
4237
4232
|
|
|
4238
4233
|
// src/utils/legend-d3.ts
|
|
4234
|
+
function centerText(sel) {
|
|
4235
|
+
return sel.attr("dy", LEGEND_TEXT_DY);
|
|
4236
|
+
}
|
|
4239
4237
|
function renderLegendD3(container, config, state, palette, isDark, callbacks, containerWidth) {
|
|
4240
4238
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
4241
4239
|
let currentState = { ...state };
|
|
@@ -4318,21 +4316,21 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4318
4316
|
const pill = capsule.pill;
|
|
4319
4317
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", palette.bg);
|
|
4320
4318
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", "none").attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4321
|
-
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").
|
|
4319
|
+
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.text).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(capsule.groupName);
|
|
4322
4320
|
if (capsule.gradient) {
|
|
4323
4321
|
const gr = capsule.gradient;
|
|
4324
4322
|
const gradId = `dgmo-legend-ramp-${capsule.groupName.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
|
|
4325
4323
|
const def = g.append("defs").append("linearGradient").attr("id", gradId);
|
|
4326
4324
|
def.append("stop").attr("offset", "0%").attr("stop-color", mix(gr.hue, gr.base, 15));
|
|
4327
4325
|
def.append("stop").attr("offset", "100%").attr("stop-color", gr.hue);
|
|
4328
|
-
g.append("text").attr("x", gr.minX).attr("y", gr.textY).
|
|
4326
|
+
g.append("text").attr("x", gr.minX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
|
|
4329
4327
|
g.append("rect").attr("class", "dgmo-legend-gradient-ramp").attr("data-ramp-min", gr.min).attr("data-ramp-max", gr.max).attr("x", gr.rampX).attr("y", gr.rampY).attr("width", gr.rampW).attr("height", gr.rampH).attr("rx", 2).attr("fill", `url(#${gradId})`);
|
|
4330
|
-
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).
|
|
4328
|
+
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
|
|
4331
4329
|
}
|
|
4332
4330
|
for (const entry of capsule.entries) {
|
|
4333
4331
|
const entryG = g.append("g").attr("data-legend-entry", entry.value.toLowerCase()).attr("data-series-name", entry.value).style("cursor", "pointer");
|
|
4334
4332
|
entryG.append("circle").attr("cx", entry.dotCx).attr("cy", entry.dotCy).attr("r", LEGEND_DOT_R).attr("fill", entry.color);
|
|
4335
|
-
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).
|
|
4333
|
+
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
|
|
4336
4334
|
if (callbacks?.onEntryHover) {
|
|
4337
4335
|
const groupName = capsule.groupName;
|
|
4338
4336
|
const entryValue = entry.value;
|
|
@@ -4352,7 +4350,7 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4352
4350
|
function renderPill(parent, pill, palette, groupBg, callbacks) {
|
|
4353
4351
|
const g = parent.append("g").attr("transform", `translate(${pill.x},${pill.y})`).attr("data-legend-group", pill.groupName.toLowerCase()).style("cursor", "pointer");
|
|
4354
4352
|
g.append("rect").attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", groupBg);
|
|
4355
|
-
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").
|
|
4353
|
+
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(pill.groupName);
|
|
4356
4354
|
if (callbacks?.onGroupToggle) {
|
|
4357
4355
|
const cb = callbacks.onGroupToggle;
|
|
4358
4356
|
const name = pill.groupName;
|
|
@@ -4375,7 +4373,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4375
4373
|
textX = 8 + 14 + LEGEND_ENTRY_DOT_GAP + measureLegendText(ctrl.label, LEGEND_PILL_FONT_SIZE) / 2;
|
|
4376
4374
|
}
|
|
4377
4375
|
if (ctrl.label) {
|
|
4378
|
-
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4376
|
+
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(ctrl.label);
|
|
4379
4377
|
}
|
|
4380
4378
|
if (ctrl.children) {
|
|
4381
4379
|
let cx = ctrl.width + 4;
|
|
@@ -4385,7 +4383,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4385
4383
|
"fill",
|
|
4386
4384
|
child.isActive ? palette.primary ?? palette.text : "none"
|
|
4387
4385
|
).attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4388
|
-
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4386
|
+
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
|
|
4389
4387
|
const configCtrl2 = configControls?.find((c) => c.id === ctrl.id);
|
|
4390
4388
|
const configChild = configCtrl2?.children?.find((c) => c.id === child.id);
|
|
4391
4389
|
if (configChild?.onClick) {
|
|
@@ -4439,7 +4437,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4439
4437
|
} else {
|
|
4440
4438
|
entryG.append("circle").attr("cx", tl.dotCx).attr("cy", tl.dotCy).attr("r", LEGEND_TOGGLE_DOT_R).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1);
|
|
4441
4439
|
}
|
|
4442
|
-
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).
|
|
4440
|
+
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("opacity", tl.active ? 1 : LEGEND_TOGGLE_OFF_OPACITY).attr("font-family", FONT_FAMILY).text(tl.label);
|
|
4443
4441
|
if (callbacks?.onControlsToggle && toggle) {
|
|
4444
4442
|
const cb = callbacks.onControlsToggle;
|
|
4445
4443
|
const id = tl.id;
|
|
@@ -4452,6 +4450,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4452
4450
|
}
|
|
4453
4451
|
}
|
|
4454
4452
|
}
|
|
4453
|
+
var LEGEND_TEXT_DY;
|
|
4455
4454
|
var init_legend_d3 = __esm({
|
|
4456
4455
|
"src/utils/legend-d3.ts"() {
|
|
4457
4456
|
"use strict";
|
|
@@ -4459,6 +4458,7 @@ var init_legend_d3 = __esm({
|
|
|
4459
4458
|
init_legend_layout();
|
|
4460
4459
|
init_color_utils();
|
|
4461
4460
|
init_fonts();
|
|
4461
|
+
LEGEND_TEXT_DY = "0.32em";
|
|
4462
4462
|
}
|
|
4463
4463
|
});
|
|
4464
4464
|
|
|
@@ -4644,7 +4644,6 @@ var init_name_normalize = __esm({
|
|
|
4644
4644
|
var parser_exports = {};
|
|
4645
4645
|
__export(parser_exports, {
|
|
4646
4646
|
isSequenceBlock: () => isSequenceBlock,
|
|
4647
|
-
isSequenceMessage: () => isSequenceMessage,
|
|
4648
4647
|
isSequenceNote: () => isSequenceNote,
|
|
4649
4648
|
isSequenceSection: () => isSequenceSection,
|
|
4650
4649
|
looksLikeSequence: () => looksLikeSequence,
|
|
@@ -4660,9 +4659,6 @@ function isHardRemovedToken(remainder) {
|
|
|
4660
4659
|
}
|
|
4661
4660
|
return { removed: false };
|
|
4662
4661
|
}
|
|
4663
|
-
function isSequenceMessage(el) {
|
|
4664
|
-
return el.kind === "message";
|
|
4665
|
-
}
|
|
4666
4662
|
function isSequenceBlock(el) {
|
|
4667
4663
|
return el.kind === "block";
|
|
4668
4664
|
}
|
package/dist/advanced.js
CHANGED
|
@@ -838,7 +838,7 @@ function withTagAliases(base, aliases) {
|
|
|
838
838
|
function isReservedKey(registry, key) {
|
|
839
839
|
return registry.keys.has(key) || registry.tagAliases.has(key);
|
|
840
840
|
}
|
|
841
|
-
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY,
|
|
841
|
+
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY, KANBAN_REGISTRY, SITEMAP_REGISTRY, GANTT_REGISTRY, PERT_REGISTRY, BOXES_AND_LINES_REGISTRY, TIMELINE_REGISTRY, MINDMAP_REGISTRY, TECH_RADAR_REGISTRY, CYCLE_REGISTRY, JOURNEY_MAP_REGISTRY, PYRAMID_REGISTRY, RING_REGISTRY, RACI_REGISTRY;
|
|
842
842
|
var init_reserved_key_registry = __esm({
|
|
843
843
|
"src/utils/reserved-key-registry.ts"() {
|
|
844
844
|
"use strict";
|
|
@@ -882,10 +882,6 @@ var init_reserved_key_registry = __esm({
|
|
|
882
882
|
"description",
|
|
883
883
|
"domain"
|
|
884
884
|
]);
|
|
885
|
-
CLASS_REGISTRY = staticRegistry([
|
|
886
|
-
"color",
|
|
887
|
-
"description"
|
|
888
|
-
]);
|
|
889
885
|
KANBAN_REGISTRY = staticRegistry([
|
|
890
886
|
"color",
|
|
891
887
|
"description",
|
|
@@ -961,7 +957,6 @@ var init_reserved_key_registry = __esm({
|
|
|
961
957
|
"color",
|
|
962
958
|
"description"
|
|
963
959
|
]);
|
|
964
|
-
WIREFRAME_REGISTRY = staticRegistry([]);
|
|
965
960
|
}
|
|
966
961
|
});
|
|
967
962
|
|
|
@@ -4234,6 +4229,9 @@ var init_legend_layout = __esm({
|
|
|
4234
4229
|
});
|
|
4235
4230
|
|
|
4236
4231
|
// src/utils/legend-d3.ts
|
|
4232
|
+
function centerText(sel) {
|
|
4233
|
+
return sel.attr("dy", LEGEND_TEXT_DY);
|
|
4234
|
+
}
|
|
4237
4235
|
function renderLegendD3(container, config, state, palette, isDark, callbacks, containerWidth) {
|
|
4238
4236
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
4239
4237
|
let currentState = { ...state };
|
|
@@ -4316,21 +4314,21 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4316
4314
|
const pill = capsule.pill;
|
|
4317
4315
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", palette.bg);
|
|
4318
4316
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", "none").attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4319
|
-
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").
|
|
4317
|
+
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.text).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(capsule.groupName);
|
|
4320
4318
|
if (capsule.gradient) {
|
|
4321
4319
|
const gr = capsule.gradient;
|
|
4322
4320
|
const gradId = `dgmo-legend-ramp-${capsule.groupName.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
|
|
4323
4321
|
const def = g.append("defs").append("linearGradient").attr("id", gradId);
|
|
4324
4322
|
def.append("stop").attr("offset", "0%").attr("stop-color", mix(gr.hue, gr.base, 15));
|
|
4325
4323
|
def.append("stop").attr("offset", "100%").attr("stop-color", gr.hue);
|
|
4326
|
-
g.append("text").attr("x", gr.minX).attr("y", gr.textY).
|
|
4324
|
+
g.append("text").attr("x", gr.minX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
|
|
4327
4325
|
g.append("rect").attr("class", "dgmo-legend-gradient-ramp").attr("data-ramp-min", gr.min).attr("data-ramp-max", gr.max).attr("x", gr.rampX).attr("y", gr.rampY).attr("width", gr.rampW).attr("height", gr.rampH).attr("rx", 2).attr("fill", `url(#${gradId})`);
|
|
4328
|
-
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).
|
|
4326
|
+
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
|
|
4329
4327
|
}
|
|
4330
4328
|
for (const entry of capsule.entries) {
|
|
4331
4329
|
const entryG = g.append("g").attr("data-legend-entry", entry.value.toLowerCase()).attr("data-series-name", entry.value).style("cursor", "pointer");
|
|
4332
4330
|
entryG.append("circle").attr("cx", entry.dotCx).attr("cy", entry.dotCy).attr("r", LEGEND_DOT_R).attr("fill", entry.color);
|
|
4333
|
-
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).
|
|
4331
|
+
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
|
|
4334
4332
|
if (callbacks?.onEntryHover) {
|
|
4335
4333
|
const groupName = capsule.groupName;
|
|
4336
4334
|
const entryValue = entry.value;
|
|
@@ -4350,7 +4348,7 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4350
4348
|
function renderPill(parent, pill, palette, groupBg, callbacks) {
|
|
4351
4349
|
const g = parent.append("g").attr("transform", `translate(${pill.x},${pill.y})`).attr("data-legend-group", pill.groupName.toLowerCase()).style("cursor", "pointer");
|
|
4352
4350
|
g.append("rect").attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", groupBg);
|
|
4353
|
-
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").
|
|
4351
|
+
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(pill.groupName);
|
|
4354
4352
|
if (callbacks?.onGroupToggle) {
|
|
4355
4353
|
const cb = callbacks.onGroupToggle;
|
|
4356
4354
|
const name = pill.groupName;
|
|
@@ -4373,7 +4371,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4373
4371
|
textX = 8 + 14 + LEGEND_ENTRY_DOT_GAP + measureLegendText(ctrl.label, LEGEND_PILL_FONT_SIZE) / 2;
|
|
4374
4372
|
}
|
|
4375
4373
|
if (ctrl.label) {
|
|
4376
|
-
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4374
|
+
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(ctrl.label);
|
|
4377
4375
|
}
|
|
4378
4376
|
if (ctrl.children) {
|
|
4379
4377
|
let cx = ctrl.width + 4;
|
|
@@ -4383,7 +4381,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4383
4381
|
"fill",
|
|
4384
4382
|
child.isActive ? palette.primary ?? palette.text : "none"
|
|
4385
4383
|
).attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4386
|
-
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4384
|
+
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
|
|
4387
4385
|
const configCtrl2 = configControls?.find((c) => c.id === ctrl.id);
|
|
4388
4386
|
const configChild = configCtrl2?.children?.find((c) => c.id === child.id);
|
|
4389
4387
|
if (configChild?.onClick) {
|
|
@@ -4437,7 +4435,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4437
4435
|
} else {
|
|
4438
4436
|
entryG.append("circle").attr("cx", tl.dotCx).attr("cy", tl.dotCy).attr("r", LEGEND_TOGGLE_DOT_R).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1);
|
|
4439
4437
|
}
|
|
4440
|
-
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).
|
|
4438
|
+
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("opacity", tl.active ? 1 : LEGEND_TOGGLE_OFF_OPACITY).attr("font-family", FONT_FAMILY).text(tl.label);
|
|
4441
4439
|
if (callbacks?.onControlsToggle && toggle) {
|
|
4442
4440
|
const cb = callbacks.onControlsToggle;
|
|
4443
4441
|
const id = tl.id;
|
|
@@ -4450,6 +4448,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4450
4448
|
}
|
|
4451
4449
|
}
|
|
4452
4450
|
}
|
|
4451
|
+
var LEGEND_TEXT_DY;
|
|
4453
4452
|
var init_legend_d3 = __esm({
|
|
4454
4453
|
"src/utils/legend-d3.ts"() {
|
|
4455
4454
|
"use strict";
|
|
@@ -4457,6 +4456,7 @@ var init_legend_d3 = __esm({
|
|
|
4457
4456
|
init_legend_layout();
|
|
4458
4457
|
init_color_utils();
|
|
4459
4458
|
init_fonts();
|
|
4459
|
+
LEGEND_TEXT_DY = "0.32em";
|
|
4460
4460
|
}
|
|
4461
4461
|
});
|
|
4462
4462
|
|
|
@@ -4642,7 +4642,6 @@ var init_name_normalize = __esm({
|
|
|
4642
4642
|
var parser_exports = {};
|
|
4643
4643
|
__export(parser_exports, {
|
|
4644
4644
|
isSequenceBlock: () => isSequenceBlock,
|
|
4645
|
-
isSequenceMessage: () => isSequenceMessage,
|
|
4646
4645
|
isSequenceNote: () => isSequenceNote,
|
|
4647
4646
|
isSequenceSection: () => isSequenceSection,
|
|
4648
4647
|
looksLikeSequence: () => looksLikeSequence,
|
|
@@ -4658,9 +4657,6 @@ function isHardRemovedToken(remainder) {
|
|
|
4658
4657
|
}
|
|
4659
4658
|
return { removed: false };
|
|
4660
4659
|
}
|
|
4661
|
-
function isSequenceMessage(el) {
|
|
4662
|
-
return el.kind === "message";
|
|
4663
|
-
}
|
|
4664
4660
|
function isSequenceBlock(el) {
|
|
4665
4661
|
return el.kind === "block";
|
|
4666
4662
|
}
|
package/dist/auto.cjs
CHANGED
|
@@ -743,7 +743,7 @@ function withTagAliases(base, aliases) {
|
|
|
743
743
|
function isReservedKey(registry, key) {
|
|
744
744
|
return registry.keys.has(key) || registry.tagAliases.has(key);
|
|
745
745
|
}
|
|
746
|
-
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY,
|
|
746
|
+
var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY, KANBAN_REGISTRY, SITEMAP_REGISTRY, GANTT_REGISTRY, PERT_REGISTRY, BOXES_AND_LINES_REGISTRY, TIMELINE_REGISTRY, MINDMAP_REGISTRY, TECH_RADAR_REGISTRY, CYCLE_REGISTRY, JOURNEY_MAP_REGISTRY, PYRAMID_REGISTRY, RING_REGISTRY, RACI_REGISTRY;
|
|
747
747
|
var init_reserved_key_registry = __esm({
|
|
748
748
|
"src/utils/reserved-key-registry.ts"() {
|
|
749
749
|
"use strict";
|
|
@@ -787,10 +787,6 @@ var init_reserved_key_registry = __esm({
|
|
|
787
787
|
"description",
|
|
788
788
|
"domain"
|
|
789
789
|
]);
|
|
790
|
-
CLASS_REGISTRY = staticRegistry([
|
|
791
|
-
"color",
|
|
792
|
-
"description"
|
|
793
|
-
]);
|
|
794
790
|
KANBAN_REGISTRY = staticRegistry([
|
|
795
791
|
"color",
|
|
796
792
|
"description",
|
|
@@ -866,7 +862,6 @@ var init_reserved_key_registry = __esm({
|
|
|
866
862
|
"color",
|
|
867
863
|
"description"
|
|
868
864
|
]);
|
|
869
|
-
WIREFRAME_REGISTRY = staticRegistry([]);
|
|
870
865
|
}
|
|
871
866
|
});
|
|
872
867
|
|
|
@@ -4135,6 +4130,9 @@ var init_legend_layout = __esm({
|
|
|
4135
4130
|
});
|
|
4136
4131
|
|
|
4137
4132
|
// src/utils/legend-d3.ts
|
|
4133
|
+
function centerText(sel) {
|
|
4134
|
+
return sel.attr("dy", LEGEND_TEXT_DY);
|
|
4135
|
+
}
|
|
4138
4136
|
function renderLegendD3(container, config, state, palette, isDark, callbacks, containerWidth) {
|
|
4139
4137
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
4140
4138
|
let currentState = { ...state };
|
|
@@ -4217,21 +4215,21 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4217
4215
|
const pill = capsule.pill;
|
|
4218
4216
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", palette.bg);
|
|
4219
4217
|
g.append("rect").attr("x", pill.x).attr("y", pill.y).attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", "none").attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4220
|
-
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").
|
|
4218
|
+
g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.text).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(capsule.groupName);
|
|
4221
4219
|
if (capsule.gradient) {
|
|
4222
4220
|
const gr = capsule.gradient;
|
|
4223
4221
|
const gradId = `dgmo-legend-ramp-${capsule.groupName.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
|
|
4224
4222
|
const def = g.append("defs").append("linearGradient").attr("id", gradId);
|
|
4225
4223
|
def.append("stop").attr("offset", "0%").attr("stop-color", mix(gr.hue, gr.base, 15));
|
|
4226
4224
|
def.append("stop").attr("offset", "100%").attr("stop-color", gr.hue);
|
|
4227
|
-
g.append("text").attr("x", gr.minX).attr("y", gr.textY).
|
|
4225
|
+
g.append("text").attr("x", gr.minX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
|
|
4228
4226
|
g.append("rect").attr("class", "dgmo-legend-gradient-ramp").attr("data-ramp-min", gr.min).attr("data-ramp-max", gr.max).attr("x", gr.rampX).attr("y", gr.rampY).attr("width", gr.rampW).attr("height", gr.rampH).attr("rx", 2).attr("fill", `url(#${gradId})`);
|
|
4229
|
-
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).
|
|
4227
|
+
g.append("text").attr("x", gr.maxX).attr("y", gr.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
|
|
4230
4228
|
}
|
|
4231
4229
|
for (const entry of capsule.entries) {
|
|
4232
4230
|
const entryG = g.append("g").attr("data-legend-entry", entry.value.toLowerCase()).attr("data-series-name", entry.value).style("cursor", "pointer");
|
|
4233
4231
|
entryG.append("circle").attr("cx", entry.dotCx).attr("cy", entry.dotCy).attr("r", LEGEND_DOT_R).attr("fill", entry.color);
|
|
4234
|
-
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).
|
|
4232
|
+
entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
|
|
4235
4233
|
if (callbacks?.onEntryHover) {
|
|
4236
4234
|
const groupName = capsule.groupName;
|
|
4237
4235
|
const entryValue = entry.value;
|
|
@@ -4251,7 +4249,7 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
|
|
|
4251
4249
|
function renderPill(parent, pill, palette, groupBg, callbacks) {
|
|
4252
4250
|
const g = parent.append("g").attr("transform", `translate(${pill.x},${pill.y})`).attr("data-legend-group", pill.groupName.toLowerCase()).style("cursor", "pointer");
|
|
4253
4251
|
g.append("rect").attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", groupBg);
|
|
4254
|
-
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").
|
|
4252
|
+
g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(pill.groupName);
|
|
4255
4253
|
if (callbacks?.onGroupToggle) {
|
|
4256
4254
|
const cb = callbacks.onGroupToggle;
|
|
4257
4255
|
const name = pill.groupName;
|
|
@@ -4274,7 +4272,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4274
4272
|
textX = 8 + 14 + LEGEND_ENTRY_DOT_GAP + measureLegendText(ctrl.label, LEGEND_PILL_FONT_SIZE) / 2;
|
|
4275
4273
|
}
|
|
4276
4274
|
if (ctrl.label) {
|
|
4277
|
-
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4275
|
+
g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_PILL_FONT_SIZE).attr("font-weight", 500).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(ctrl.label);
|
|
4278
4276
|
}
|
|
4279
4277
|
if (ctrl.children) {
|
|
4280
4278
|
let cx = ctrl.width + 4;
|
|
@@ -4284,7 +4282,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
|
|
|
4284
4282
|
"fill",
|
|
4285
4283
|
child.isActive ? palette.primary ?? palette.text : "none"
|
|
4286
4284
|
).attr("stroke", pillBorder).attr("stroke-width", 0.75);
|
|
4287
|
-
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").
|
|
4285
|
+
childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
|
|
4288
4286
|
const configCtrl2 = configControls?.find((c) => c.id === ctrl.id);
|
|
4289
4287
|
const configChild = configCtrl2?.children?.find((c) => c.id === child.id);
|
|
4290
4288
|
if (configChild?.onClick) {
|
|
@@ -4338,7 +4336,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4338
4336
|
} else {
|
|
4339
4337
|
entryG.append("circle").attr("cx", tl.dotCx).attr("cy", tl.dotCy).attr("r", LEGEND_TOGGLE_DOT_R).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1);
|
|
4340
4338
|
}
|
|
4341
|
-
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).
|
|
4339
|
+
entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).call(centerText).attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("opacity", tl.active ? 1 : LEGEND_TOGGLE_OFF_OPACITY).attr("font-family", FONT_FAMILY).text(tl.label);
|
|
4342
4340
|
if (callbacks?.onControlsToggle && toggle) {
|
|
4343
4341
|
const cb = callbacks.onControlsToggle;
|
|
4344
4342
|
const id = tl.id;
|
|
@@ -4351,6 +4349,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
|
|
|
4351
4349
|
}
|
|
4352
4350
|
}
|
|
4353
4351
|
}
|
|
4352
|
+
var LEGEND_TEXT_DY;
|
|
4354
4353
|
var init_legend_d3 = __esm({
|
|
4355
4354
|
"src/utils/legend-d3.ts"() {
|
|
4356
4355
|
"use strict";
|
|
@@ -4358,6 +4357,7 @@ var init_legend_d3 = __esm({
|
|
|
4358
4357
|
init_legend_layout();
|
|
4359
4358
|
init_color_utils();
|
|
4360
4359
|
init_fonts();
|
|
4360
|
+
LEGEND_TEXT_DY = "0.32em";
|
|
4361
4361
|
}
|
|
4362
4362
|
});
|
|
4363
4363
|
|
|
@@ -4608,7 +4608,6 @@ var init_arrows = __esm({
|
|
|
4608
4608
|
var parser_exports = {};
|
|
4609
4609
|
__export(parser_exports, {
|
|
4610
4610
|
isSequenceBlock: () => isSequenceBlock,
|
|
4611
|
-
isSequenceMessage: () => isSequenceMessage,
|
|
4612
4611
|
isSequenceNote: () => isSequenceNote,
|
|
4613
4612
|
isSequenceSection: () => isSequenceSection,
|
|
4614
4613
|
looksLikeSequence: () => looksLikeSequence,
|
|
@@ -4624,9 +4623,6 @@ function isHardRemovedToken(remainder) {
|
|
|
4624
4623
|
}
|
|
4625
4624
|
return { removed: false };
|
|
4626
4625
|
}
|
|
4627
|
-
function isSequenceMessage(el) {
|
|
4628
|
-
return el.kind === "message";
|
|
4629
|
-
}
|
|
4630
4626
|
function isSequenceBlock(el) {
|
|
4631
4627
|
return el.kind === "block";
|
|
4632
4628
|
}
|
|
@@ -59293,7 +59289,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
59293
59289
|
|
|
59294
59290
|
// src/auto/index.ts
|
|
59295
59291
|
init_safe_href();
|
|
59296
|
-
var VERSION = "0.
|
|
59292
|
+
var VERSION = "0.25.0";
|
|
59297
59293
|
var DEFAULTS = {
|
|
59298
59294
|
theme: "auto",
|
|
59299
59295
|
palette: "nord",
|