@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/dist/index.cjs CHANGED
@@ -818,7 +818,7 @@ function withTagAliases(base, aliases) {
818
818
  function isReservedKey(registry, key) {
819
819
  return registry.keys.has(key) || registry.tagAliases.has(key);
820
820
  }
821
- var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY, CLASS_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, WIREFRAME_REGISTRY;
821
+ 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;
822
822
  var init_reserved_key_registry = __esm({
823
823
  "src/utils/reserved-key-registry.ts"() {
824
824
  "use strict";
@@ -862,10 +862,6 @@ var init_reserved_key_registry = __esm({
862
862
  "description",
863
863
  "domain"
864
864
  ]);
865
- CLASS_REGISTRY = staticRegistry([
866
- "color",
867
- "description"
868
- ]);
869
865
  KANBAN_REGISTRY = staticRegistry([
870
866
  "color",
871
867
  "description",
@@ -941,7 +937,6 @@ var init_reserved_key_registry = __esm({
941
937
  "color",
942
938
  "description"
943
939
  ]);
944
- WIREFRAME_REGISTRY = staticRegistry([]);
945
940
  }
946
941
  });
947
942
 
@@ -4210,6 +4205,9 @@ var init_legend_layout = __esm({
4210
4205
  });
4211
4206
 
4212
4207
  // src/utils/legend-d3.ts
4208
+ function centerText(sel) {
4209
+ return sel.attr("dy", LEGEND_TEXT_DY);
4210
+ }
4213
4211
  function renderLegendD3(container, config, state, palette, isDark, callbacks, containerWidth) {
4214
4212
  const width = containerWidth ?? parseFloat(container.attr("width") || "800");
4215
4213
  let currentState = { ...state };
@@ -4292,21 +4290,21 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
4292
4290
  const pill = capsule.pill;
4293
4291
  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);
4294
4292
  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);
4295
- g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").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);
4293
+ 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);
4296
4294
  if (capsule.gradient) {
4297
4295
  const gr = capsule.gradient;
4298
4296
  const gradId = `dgmo-legend-ramp-${capsule.groupName.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
4299
4297
  const def = g.append("defs").append("linearGradient").attr("id", gradId);
4300
4298
  def.append("stop").attr("offset", "0%").attr("stop-color", mix(gr.hue, gr.base, 15));
4301
4299
  def.append("stop").attr("offset", "100%").attr("stop-color", gr.hue);
4302
- g.append("text").attr("x", gr.minX).attr("y", gr.textY).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
4300
+ 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);
4303
4301
  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})`);
4304
- g.append("text").attr("x", gr.maxX).attr("y", gr.textY).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
4302
+ 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);
4305
4303
  }
4306
4304
  for (const entry of capsule.entries) {
4307
4305
  const entryG = g.append("g").attr("data-legend-entry", entry.value.toLowerCase()).attr("data-series-name", entry.value).style("cursor", "pointer");
4308
4306
  entryG.append("circle").attr("cx", entry.dotCx).attr("cy", entry.dotCy).attr("r", LEGEND_DOT_R).attr("fill", entry.color);
4309
- entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
4307
+ 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);
4310
4308
  if (callbacks?.onEntryHover) {
4311
4309
  const groupName = capsule.groupName;
4312
4310
  const entryValue = entry.value;
@@ -4326,7 +4324,7 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
4326
4324
  function renderPill(parent, pill, palette, groupBg, callbacks) {
4327
4325
  const g = parent.append("g").attr("transform", `translate(${pill.x},${pill.y})`).attr("data-legend-group", pill.groupName.toLowerCase()).style("cursor", "pointer");
4328
4326
  g.append("rect").attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", groupBg);
4329
- g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").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);
4327
+ 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);
4330
4328
  if (callbacks?.onGroupToggle) {
4331
4329
  const cb = callbacks.onGroupToggle;
4332
4330
  const name = pill.groupName;
@@ -4349,7 +4347,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
4349
4347
  textX = 8 + 14 + LEGEND_ENTRY_DOT_GAP + measureLegendText(ctrl.label, LEGEND_PILL_FONT_SIZE) / 2;
4350
4348
  }
4351
4349
  if (ctrl.label) {
4352
- g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").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);
4350
+ 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);
4353
4351
  }
4354
4352
  if (ctrl.children) {
4355
4353
  let cx = ctrl.width + 4;
@@ -4359,7 +4357,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
4359
4357
  "fill",
4360
4358
  child.isActive ? palette.primary ?? palette.text : "none"
4361
4359
  ).attr("stroke", pillBorder).attr("stroke-width", 0.75);
4362
- childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
4360
+ 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);
4363
4361
  const configCtrl2 = configControls?.find((c) => c.id === ctrl.id);
4364
4362
  const configChild = configCtrl2?.children?.find((c) => c.id === child.id);
4365
4363
  if (configChild?.onClick) {
@@ -4413,7 +4411,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
4413
4411
  } else {
4414
4412
  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);
4415
4413
  }
4416
- entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).attr("dominant-baseline", "central").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);
4414
+ 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);
4417
4415
  if (callbacks?.onControlsToggle && toggle) {
4418
4416
  const cb = callbacks.onControlsToggle;
4419
4417
  const id = tl.id;
@@ -4426,6 +4424,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
4426
4424
  }
4427
4425
  }
4428
4426
  }
4427
+ var LEGEND_TEXT_DY;
4429
4428
  var init_legend_d3 = __esm({
4430
4429
  "src/utils/legend-d3.ts"() {
4431
4430
  "use strict";
@@ -4433,6 +4432,7 @@ var init_legend_d3 = __esm({
4433
4432
  init_legend_layout();
4434
4433
  init_color_utils();
4435
4434
  init_fonts();
4435
+ LEGEND_TEXT_DY = "0.32em";
4436
4436
  }
4437
4437
  });
4438
4438
 
@@ -4683,7 +4683,6 @@ var init_arrows = __esm({
4683
4683
  var parser_exports = {};
4684
4684
  __export(parser_exports, {
4685
4685
  isSequenceBlock: () => isSequenceBlock,
4686
- isSequenceMessage: () => isSequenceMessage,
4687
4686
  isSequenceNote: () => isSequenceNote,
4688
4687
  isSequenceSection: () => isSequenceSection,
4689
4688
  looksLikeSequence: () => looksLikeSequence,
@@ -4699,9 +4698,6 @@ function isHardRemovedToken(remainder) {
4699
4698
  }
4700
4699
  return { removed: false };
4701
4700
  }
4702
- function isSequenceMessage(el) {
4703
- return el.kind === "message";
4704
- }
4705
4701
  function isSequenceBlock(el) {
4706
4702
  return el.kind === "block";
4707
4703
  }
package/dist/index.js CHANGED
@@ -816,7 +816,7 @@ function withTagAliases(base, aliases) {
816
816
  function isReservedKey(registry, key) {
817
817
  return registry.keys.has(key) || registry.tagAliases.has(key);
818
818
  }
819
- var SEQUENCE_REGISTRY, INFRA_REGISTRY, MAP_REGISTRY, ORG_REGISTRY, C4_REGISTRY, ER_REGISTRY, CLASS_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, WIREFRAME_REGISTRY;
819
+ 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;
820
820
  var init_reserved_key_registry = __esm({
821
821
  "src/utils/reserved-key-registry.ts"() {
822
822
  "use strict";
@@ -860,10 +860,6 @@ var init_reserved_key_registry = __esm({
860
860
  "description",
861
861
  "domain"
862
862
  ]);
863
- CLASS_REGISTRY = staticRegistry([
864
- "color",
865
- "description"
866
- ]);
867
863
  KANBAN_REGISTRY = staticRegistry([
868
864
  "color",
869
865
  "description",
@@ -939,7 +935,6 @@ var init_reserved_key_registry = __esm({
939
935
  "color",
940
936
  "description"
941
937
  ]);
942
- WIREFRAME_REGISTRY = staticRegistry([]);
943
938
  }
944
939
  });
945
940
 
@@ -4208,6 +4203,9 @@ var init_legend_layout = __esm({
4208
4203
  });
4209
4204
 
4210
4205
  // src/utils/legend-d3.ts
4206
+ function centerText(sel) {
4207
+ return sel.attr("dy", LEGEND_TEXT_DY);
4208
+ }
4211
4209
  function renderLegendD3(container, config, state, palette, isDark, callbacks, containerWidth) {
4212
4210
  const width = containerWidth ?? parseFloat(container.attr("width") || "800");
4213
4211
  let currentState = { ...state };
@@ -4290,21 +4288,21 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
4290
4288
  const pill = capsule.pill;
4291
4289
  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);
4292
4290
  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);
4293
- g.append("text").attr("x", pill.x + pill.width / 2).attr("y", LEGEND_HEIGHT / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").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);
4291
+ 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);
4294
4292
  if (capsule.gradient) {
4295
4293
  const gr = capsule.gradient;
4296
4294
  const gradId = `dgmo-legend-ramp-${capsule.groupName.toLowerCase().replace(/[^a-z0-9]+/g, "-")}`;
4297
4295
  const def = g.append("defs").append("linearGradient").attr("id", gradId);
4298
4296
  def.append("stop").attr("offset", "0%").attr("stop-color", mix(gr.hue, gr.base, 15));
4299
4297
  def.append("stop").attr("offset", "100%").attr("stop-color", gr.hue);
4300
- g.append("text").attr("x", gr.minX).attr("y", gr.textY).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
4298
+ 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);
4301
4299
  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})`);
4302
- g.append("text").attr("x", gr.maxX).attr("y", gr.textY).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
4300
+ 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);
4303
4301
  }
4304
4302
  for (const entry of capsule.entries) {
4305
4303
  const entryG = g.append("g").attr("data-legend-entry", entry.value.toLowerCase()).attr("data-series-name", entry.value).style("cursor", "pointer");
4306
4304
  entryG.append("circle").attr("cx", entry.dotCx).attr("cy", entry.dotCy).attr("r", LEGEND_DOT_R).attr("fill", entry.color);
4307
- entryG.append("text").attr("x", entry.textX).attr("y", entry.textY).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
4305
+ 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);
4308
4306
  if (callbacks?.onEntryHover) {
4309
4307
  const groupName = capsule.groupName;
4310
4308
  const entryValue = entry.value;
@@ -4324,7 +4322,7 @@ function renderCapsule(parent, capsule, palette, groupBg, pillBorder, _isDark, c
4324
4322
  function renderPill(parent, pill, palette, groupBg, callbacks) {
4325
4323
  const g = parent.append("g").attr("transform", `translate(${pill.x},${pill.y})`).attr("data-legend-group", pill.groupName.toLowerCase()).style("cursor", "pointer");
4326
4324
  g.append("rect").attr("width", pill.width).attr("height", pill.height).attr("rx", pill.height / 2).attr("fill", groupBg);
4327
- g.append("text").attr("x", pill.width / 2).attr("y", pill.height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").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);
4325
+ 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);
4328
4326
  if (callbacks?.onGroupToggle) {
4329
4327
  const cb = callbacks.onGroupToggle;
4330
4328
  const name = pill.groupName;
@@ -4347,7 +4345,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
4347
4345
  textX = 8 + 14 + LEGEND_ENTRY_DOT_GAP + measureLegendText(ctrl.label, LEGEND_PILL_FONT_SIZE) / 2;
4348
4346
  }
4349
4347
  if (ctrl.label) {
4350
- g.append("text").attr("x", textX).attr("y", ctrl.height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").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);
4348
+ 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);
4351
4349
  }
4352
4350
  if (ctrl.children) {
4353
4351
  let cx = ctrl.width + 4;
@@ -4357,7 +4355,7 @@ function renderControl(parent, ctrl, palette, _groupBg, pillBorder, _isDark, con
4357
4355
  "fill",
4358
4356
  child.isActive ? palette.primary ?? palette.text : "none"
4359
4357
  ).attr("stroke", pillBorder).attr("stroke-width", 0.75);
4360
- childG.append("text").attr("x", child.width / 2).attr("y", ctrl.height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
4358
+ 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);
4361
4359
  const configCtrl2 = configControls?.find((c) => c.id === ctrl.id);
4362
4360
  const configChild = configCtrl2?.children?.find((c) => c.id === child.id);
4363
4361
  if (configChild?.onClick) {
@@ -4411,7 +4409,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
4411
4409
  } else {
4412
4410
  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);
4413
4411
  }
4414
- entryG.append("text").attr("x", tl.textX).attr("y", tl.textY).attr("dominant-baseline", "central").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);
4412
+ 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);
4415
4413
  if (callbacks?.onControlsToggle && toggle) {
4416
4414
  const cb = callbacks.onControlsToggle;
4417
4415
  const id = tl.id;
@@ -4424,6 +4422,7 @@ function renderControlsGroup(parent, layout, palette, groupBg, pillBorder, callb
4424
4422
  }
4425
4423
  }
4426
4424
  }
4425
+ var LEGEND_TEXT_DY;
4427
4426
  var init_legend_d3 = __esm({
4428
4427
  "src/utils/legend-d3.ts"() {
4429
4428
  "use strict";
@@ -4431,6 +4430,7 @@ var init_legend_d3 = __esm({
4431
4430
  init_legend_layout();
4432
4431
  init_color_utils();
4433
4432
  init_fonts();
4433
+ LEGEND_TEXT_DY = "0.32em";
4434
4434
  }
4435
4435
  });
4436
4436
 
@@ -4681,7 +4681,6 @@ var init_arrows = __esm({
4681
4681
  var parser_exports = {};
4682
4682
  __export(parser_exports, {
4683
4683
  isSequenceBlock: () => isSequenceBlock,
4684
- isSequenceMessage: () => isSequenceMessage,
4685
4684
  isSequenceNote: () => isSequenceNote,
4686
4685
  isSequenceSection: () => isSequenceSection,
4687
4686
  looksLikeSequence: () => looksLikeSequence,
@@ -4697,9 +4696,6 @@ function isHardRemovedToken(remainder) {
4697
4696
  }
4698
4697
  return { removed: false };
4699
4698
  }
4700
- function isSequenceMessage(el) {
4701
- return el.kind === "message";
4702
- }
4703
4699
  function isSequenceBlock(el) {
4704
4700
  return el.kind === "block";
4705
4701
  }
package/dist/internal.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, CLASS_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, WIREFRAME_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").attr("dominant-baseline", "central").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);
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).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
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).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
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).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
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").attr("dominant-baseline", "central").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);
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").attr("dominant-baseline", "central").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);
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").attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
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).attr("dominant-baseline", "central").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);
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/internal.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, CLASS_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, WIREFRAME_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").attr("dominant-baseline", "central").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);
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).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.minText);
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).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("pointer-events", "none").attr("font-family", FONT_FAMILY).text(gr.maxText);
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).attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).text(entry.displayValue ?? entry.value);
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").attr("dominant-baseline", "central").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);
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").attr("dominant-baseline", "central").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);
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").attr("dominant-baseline", "central").attr("font-size", LEGEND_ENTRY_FONT_SIZE).attr("fill", child.isActive ? palette.bg : palette.textMuted).attr("font-family", FONT_FAMILY).text(child.label);
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).attr("dominant-baseline", "central").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);
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagrammo/dgmo",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "DGMO diagram markup language — parser, renderer, and color system",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -347,13 +347,6 @@ export function bareDescriptionRemovedMessage(args: {
347
347
  return `'|' description shorthand removed in ${args.chartType} — use 'description: ${quoted}'`;
348
348
  }
349
349
 
350
- /**
351
- * Canonical message for `E_TAG_DECLARED_AFTER_CONTENT`.
352
- */
353
- export function tagDeclaredAfterContentMessage(tagName: string): string {
354
- return `'tag ${tagName}' must appear before content — move it above diagram lines`;
355
- }
356
-
357
350
  /**
358
351
  * Canonical message for `W_EMPTY_METADATA_VALUE`. Emitted when a
359
352
  * `key:` token has no value following the colon.
@@ -364,15 +357,3 @@ export function emptyMetadataValueMessage(key: string): string {
364
357
  `Provide a value or remove the key.`
365
358
  );
366
359
  }
367
-
368
- /**
369
- * Canonical message for `W_ATTRIBUTE_AT_PARENT_INDENT`. Emitted
370
- * when an indented reserved-key attribute appears at the same indent
371
- * level as preceding structural children.
372
- */
373
- export function attributeAtParentIndentMessage(key: string): string {
374
- return (
375
- `Attribute '${key}:' attaches to the parent above — ` +
376
- `indent further if you meant it on the preceding structural child.`
377
- );
378
- }
package/src/map/geo.ts CHANGED
@@ -42,11 +42,6 @@ export function featureIndex(
42
42
  return idx;
43
43
  }
44
44
 
45
- /** Set of geometry ids (ISO codes) present in a topology. */
46
- export function idSet(topo: BoundaryTopology): Set<string> {
47
- return new Set(geomObject(topo).geometries.map((g) => g.id));
48
- }
49
-
50
45
  // Memoize adjacency on the RAW asset object (never the per-render-mutated
51
46
  // `worldLayer`). Keyed by topology identity — the assets are stable singletons
52
47
  // from load-data.ts, so one build per topology lasts the process (G13).
@@ -200,10 +200,6 @@ export type SequenceElement =
200
200
  | SequenceSection
201
201
  | SequenceNote;
202
202
 
203
- export function isSequenceMessage(el: SequenceElement): el is SequenceMessage {
204
- return el.kind === 'message';
205
- }
206
-
207
203
  export function isSequenceBlock(el: SequenceElement): el is SequenceBlock {
208
204
  return el.kind === 'block';
209
205
  }