@diagrammo/dgmo 0.8.11 → 0.8.12

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.d.cts CHANGED
@@ -1751,6 +1751,7 @@ declare function renderBoxesAndLinesForExport(container: HTMLDivElement, parsed:
1751
1751
  width: number;
1752
1752
  height: number;
1753
1753
  };
1754
+ activeTagGroup?: string | null;
1754
1755
  }): void;
1755
1756
 
1756
1757
  interface BLCollapseResult {
@@ -2266,6 +2267,7 @@ interface GanttOptions {
2266
2267
  dependencies: boolean;
2267
2268
  sort: 'default' | 'tag';
2268
2269
  defaultSwimlaneGroup: string | null;
2270
+ activeTag: string | null;
2269
2271
  /** Line numbers for option/block keywords — maps key to source line */
2270
2272
  optionLineNumbers: Record<string, number>;
2271
2273
  holidaysLineNumber: number | null;
package/dist/index.d.ts CHANGED
@@ -1751,6 +1751,7 @@ declare function renderBoxesAndLinesForExport(container: HTMLDivElement, parsed:
1751
1751
  width: number;
1752
1752
  height: number;
1753
1753
  };
1754
+ activeTagGroup?: string | null;
1754
1755
  }): void;
1755
1756
 
1756
1757
  interface BLCollapseResult {
@@ -2266,6 +2267,7 @@ interface GanttOptions {
2266
2267
  dependencies: boolean;
2267
2268
  sort: 'default' | 'tag';
2268
2269
  defaultSwimlaneGroup: string | null;
2270
+ activeTag: string | null;
2269
2271
  /** Line numbers for option/block keywords — maps key to source line */
2270
2272
  optionLineNumbers: Record<string, number>;
2271
2273
  holidaysLineNumber: number | null;
package/dist/index.js CHANGED
@@ -1929,6 +1929,16 @@ function validateTagValues(entities, tagGroups, pushWarning, suggestFn) {
1929
1929
  }
1930
1930
  }
1931
1931
  }
1932
+ function validateTagGroupNames(tagGroups, pushWarning) {
1933
+ for (const group of tagGroups) {
1934
+ if (group.name.toLowerCase() === "none") {
1935
+ pushWarning(
1936
+ group.lineNumber,
1937
+ `'none' is a reserved keyword and cannot be used as a tag group name`
1938
+ );
1939
+ }
1940
+ }
1941
+ }
1932
1942
  function injectDefaultTagMetadata(entities, tagGroups, skip) {
1933
1943
  const defaults = [];
1934
1944
  for (const group of tagGroups) {
@@ -1949,6 +1959,19 @@ function injectDefaultTagMetadata(entities, tagGroups, skip) {
1949
1959
  }
1950
1960
  }
1951
1961
  }
1962
+ function resolveActiveTagGroup(tagGroups, explicitActiveTag, programmaticOverride) {
1963
+ if (programmaticOverride !== void 0) {
1964
+ if (!programmaticOverride) return null;
1965
+ if (programmaticOverride.toLowerCase() === "none") return null;
1966
+ return programmaticOverride;
1967
+ }
1968
+ if (explicitActiveTag) {
1969
+ if (explicitActiveTag.toLowerCase() === "none") return null;
1970
+ return explicitActiveTag;
1971
+ }
1972
+ if (tagGroups.length > 0) return tagGroups[0].name;
1973
+ return null;
1974
+ }
1952
1975
  function matchTagBlockHeading(trimmed) {
1953
1976
  return parseTagDeclaration(trimmed);
1954
1977
  }
@@ -2252,13 +2275,15 @@ function computeLegendLayout(config, state, containerWidth) {
2252
2275
  });
2253
2276
  }
2254
2277
  }
2278
+ const alignLeft = config.position.titleRelation === "inline-with-title";
2255
2279
  const rows = layoutRows(
2256
2280
  activeCapsule,
2257
2281
  pills,
2258
2282
  controlLayouts,
2259
2283
  groupAvailW,
2260
2284
  containerWidth,
2261
- totalControlsW
2285
+ totalControlsW,
2286
+ alignLeft
2262
2287
  );
2263
2288
  const height = rows.length * LEGEND_HEIGHT;
2264
2289
  const width = containerWidth;
@@ -2332,7 +2357,7 @@ function buildCapsuleLayout(group, containerWidth, addonWidth = 0) {
2332
2357
  addonX: addonWidth > 0 ? LEGEND_CAPSULE_PAD + pw + 4 : void 0
2333
2358
  };
2334
2359
  }
2335
- function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth, totalControlsW) {
2360
+ function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth, totalControlsW, alignLeft = false) {
2336
2361
  const rows = [];
2337
2362
  const groupItems = [];
2338
2363
  if (activeCapsule) groupItems.push(activeCapsule);
@@ -2343,7 +2368,8 @@ function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth,
2343
2368
  for (const item of groupItems) {
2344
2369
  const itemW = item.width + LEGEND_GROUP_GAP;
2345
2370
  if (currentRowW + item.width > groupAvailW && currentRowItems.length > 0) {
2346
- centerRowItems(currentRowItems, containerWidth, totalControlsW);
2371
+ if (!alignLeft)
2372
+ centerRowItems(currentRowItems, containerWidth, totalControlsW);
2347
2373
  rows.push({ y: rowY, items: currentRowItems });
2348
2374
  rowY += LEGEND_HEIGHT;
2349
2375
  currentRowItems = [];
@@ -3747,6 +3773,7 @@ function parseSequenceDgmo(content) {
3747
3773
  entities.push({ metadata: g.metadata, lineNumber: g.lineNumber });
3748
3774
  }
3749
3775
  validateTagValues(entities, result.tagGroups, pushWarning, suggest);
3776
+ validateTagGroupNames(result.tagGroups, pushWarning);
3750
3777
  }
3751
3778
  return result;
3752
3779
  }
@@ -5023,6 +5050,10 @@ function parseERDiagram(content, palette) {
5023
5050
  (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning")),
5024
5051
  suggest
5025
5052
  );
5053
+ validateTagGroupNames(
5054
+ result.tagGroups,
5055
+ (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning"))
5056
+ );
5026
5057
  for (const group of result.tagGroups) {
5027
5058
  if (!group.defaultValue) continue;
5028
5059
  const key = group.name.toLowerCase();
@@ -5118,7 +5149,7 @@ var init_parser3 = __esm({
5118
5149
  unique: "unique",
5119
5150
  nullable: "nullable"
5120
5151
  };
5121
- KNOWN_OPTIONS = /* @__PURE__ */ new Set(["notation"]);
5152
+ KNOWN_OPTIONS = /* @__PURE__ */ new Set(["notation", "active-tag"]);
5122
5153
  REL_SYMBOLIC_RE = /^([a-zA-Z_]\w*)\s+([1*?])\s*-{1,2}\s*([1*?])\s+([a-zA-Z_]\w*)(?:\s+(.+))?$/;
5123
5154
  REL_KEYWORD_RE = /^([a-zA-Z_]\w*)\s+(one|many|zero)[- ]to[- ](one|many|zero)\s+([a-zA-Z_]\w*)(?:\s+(.+))?$/i;
5124
5155
  KEYWORD_TO_SYMBOL = {
@@ -6212,7 +6243,7 @@ function buildChordOption(parsed, textColor, colors, bg, titleConfig) {
6212
6243
  };
6213
6244
  });
6214
6245
  })(),
6215
- roam: true,
6246
+ roam: false,
6216
6247
  label: {
6217
6248
  position: "right",
6218
6249
  formatter: "{b}"
@@ -7967,6 +7998,7 @@ function parseOrg(content, palette) {
7967
7998
  };
7968
7999
  collectAll(result.roots);
7969
8000
  validateTagValues(allNodes, result.tagGroups, pushWarning, suggest);
8001
+ validateTagGroupNames(result.tagGroups, pushWarning);
7970
8002
  }
7971
8003
  if (result.roots.length === 0 && result.tagGroups.length === 0 && !result.error) {
7972
8004
  const diag = makeDgmoError(1, "No nodes found in org chart");
@@ -8033,7 +8065,8 @@ var init_parser4 = __esm({
8033
8065
  KNOWN_OPTIONS3 = /* @__PURE__ */ new Set([
8034
8066
  "sub-node-label",
8035
8067
  "hide",
8036
- "show-sub-node-count"
8068
+ "show-sub-node-count",
8069
+ "active-tag"
8037
8070
  ]);
8038
8071
  KNOWN_BOOLEANS2 = /* @__PURE__ */ new Set(["show-sub-node-count", "direction-tb"]);
8039
8072
  }
@@ -8294,6 +8327,7 @@ function parseKanban(content, palette) {
8294
8327
  if (result.columns.length === 0 && !result.error) {
8295
8328
  return fail(1, "No columns found. Use [Column Name] to define columns");
8296
8329
  }
8330
+ validateTagGroupNames(result.tagGroups, warn);
8297
8331
  return result;
8298
8332
  }
8299
8333
  function parseCardLine(trimmed, lineNumber, counter, aliasMap, palette) {
@@ -8339,7 +8373,7 @@ var init_parser5 = __esm({
8339
8373
  init_parsing();
8340
8374
  COLUMN_RE = /^\[(.+?)\](?:\s*\(([^)]+)\))?\s*(?:\|\s*(.+))?$/;
8341
8375
  LEGACY_COLUMN_RE = /^==\s+(.+?)\s*(?:\[wip:\s*(\d+)\])?\s*==$/;
8342
- KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide"]);
8376
+ KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide", "active-tag"]);
8343
8377
  KNOWN_BOOLEANS3 = /* @__PURE__ */ new Set(["no-auto-color"]);
8344
8378
  }
8345
8379
  });
@@ -8882,6 +8916,10 @@ function parseC4(content, palette) {
8882
8916
  }
8883
8917
  validateRelationshipTargets(result, knownNames, pushError);
8884
8918
  validateDeploymentRefs(result, knownNames, pushError);
8919
+ validateTagGroupNames(
8920
+ result.tagGroups,
8921
+ (line10, msg) => pushError(line10, msg, "warning")
8922
+ );
8885
8923
  return result;
8886
8924
  }
8887
8925
  function findParentElement(indent, stack) {
@@ -9008,7 +9046,7 @@ var init_parser6 = __esm({
9008
9046
  "cloud",
9009
9047
  "external"
9010
9048
  ]);
9011
- KNOWN_C4_OPTIONS = /* @__PURE__ */ new Set(["layout"]);
9049
+ KNOWN_C4_OPTIONS = /* @__PURE__ */ new Set(["layout", "active-tag"]);
9012
9050
  KNOWN_C4_BOOLEANS = /* @__PURE__ */ new Set(["direction-tb"]);
9013
9051
  ALL_CHART_TYPES2 = [
9014
9052
  "c4",
@@ -9346,6 +9384,7 @@ function parseSitemap(content, palette) {
9346
9384
  };
9347
9385
  collectAll(result.roots);
9348
9386
  validateTagValues(allNodes, result.tagGroups, pushWarning, suggest);
9387
+ validateTagGroupNames(result.tagGroups, pushWarning);
9349
9388
  }
9350
9389
  if (result.roots.length === 0 && result.tagGroups.length === 0 && !result.error) {
9351
9390
  const diag = makeDgmoError(1, "No pages found in sitemap");
@@ -9946,6 +9985,7 @@ function parseInfra(content) {
9946
9985
  }
9947
9986
  }
9948
9987
  }
9988
+ validateTagGroupNames(result.tagGroups, warn);
9949
9989
  return result;
9950
9990
  }
9951
9991
  function extractSymbols4(docText) {
@@ -10024,7 +10064,8 @@ var init_parser8 = __esm({
10024
10064
  "slo-warning-margin",
10025
10065
  "default-latency-ms",
10026
10066
  "default-uptime",
10027
- "default-rps"
10067
+ "default-rps",
10068
+ "active-tag"
10028
10069
  ]);
10029
10070
  UNPARSED_SPLIT_RE = /\bsplit\s+(\d+)%/;
10030
10071
  }
@@ -10222,6 +10263,7 @@ function parseGantt(content, palette) {
10222
10263
  dependencies: true,
10223
10264
  sort: "default",
10224
10265
  defaultSwimlaneGroup: null,
10266
+ activeTag: null,
10225
10267
  optionLineNumbers: {},
10226
10268
  holidaysLineNumber: null
10227
10269
  },
@@ -10636,6 +10678,9 @@ function parseGantt(content, palette) {
10636
10678
  );
10637
10679
  }
10638
10680
  break;
10681
+ case "active-tag":
10682
+ result.options.activeTag = value;
10683
+ break;
10639
10684
  }
10640
10685
  continue;
10641
10686
  }
@@ -10815,6 +10860,7 @@ function parseGantt(content, palette) {
10815
10860
  warn(0, "sort tag has no effect \u2014 no tag groups defined.");
10816
10861
  result.options.sort = "default";
10817
10862
  }
10863
+ validateTagGroupNames(result.tagGroups, warn);
10818
10864
  return result;
10819
10865
  function makeTask(labelRaw, duration, uncertain, ln, explicitStart) {
10820
10866
  const segments = labelRaw.split("|");
@@ -10977,7 +11023,8 @@ var init_parser9 = __esm({
10977
11023
  "critical-path",
10978
11024
  "dependencies",
10979
11025
  "chart",
10980
- "sort"
11026
+ "sort",
11027
+ "active-tag"
10981
11028
  ]);
10982
11029
  KNOWN_BOOLEANS4 = /* @__PURE__ */ new Set([
10983
11030
  "critical-path",
@@ -11397,6 +11444,7 @@ function parseBoxesAndLines(content) {
11397
11444
  if (result.tagGroups.length > 0) {
11398
11445
  injectDefaultTagMetadata(result.nodes, result.tagGroups);
11399
11446
  validateTagValues(result.nodes, result.tagGroups, pushWarning, suggest);
11447
+ validateTagGroupNames(result.tagGroups, pushWarning);
11400
11448
  }
11401
11449
  return result;
11402
11450
  }
@@ -14272,7 +14320,7 @@ function renderKanban(container, parsed, palette, isDark, _onNavigateToLine, exp
14272
14320
  const legendY = DIAGRAM_PADDING3 + (TITLE_FONT_SIZE - LEGEND_HEIGHT) / 2;
14273
14321
  const legendConfig = {
14274
14322
  groups: parsed.tagGroups,
14275
- position: { placement: "top-center", titleRelation: "below-title" },
14323
+ position: { placement: "top-center", titleRelation: "inline-with-title" },
14276
14324
  mode: exportDims ? "inline" : "fixed"
14277
14325
  };
14278
14326
  const legendState = { activeGroup: activeTagGroup ?? null };
@@ -15955,7 +16003,11 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
15955
16003
  const width = exportDims?.width ?? container.clientWidth;
15956
16004
  const height = exportDims?.height ?? container.clientHeight;
15957
16005
  if (width <= 0 || height <= 0) return;
15958
- const activeGroup = activeTagGroup ?? parsed.options["active-tag"] ?? null;
16006
+ const activeGroup = resolveActiveTagGroup(
16007
+ parsed.tagGroups,
16008
+ parsed.options["active-tag"],
16009
+ activeTagGroup
16010
+ );
15959
16011
  const hidden = hiddenTagValues ?? parsed.initialHiddenTagValues;
15960
16012
  const nodeMap = /* @__PURE__ */ new Map();
15961
16013
  for (const node of parsed.nodes) nodeMap.set(node.label, node);
@@ -16133,7 +16185,8 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
16133
16185
  }
16134
16186
  function renderBoxesAndLinesForExport(container, parsed, layout, palette, isDark, options) {
16135
16187
  renderBoxesAndLines(container, parsed, layout, palette, isDark, {
16136
- exportDims: options?.exportDims
16188
+ exportDims: options?.exportDims,
16189
+ activeTagGroup: options?.activeTagGroup
16137
16190
  });
16138
16191
  }
16139
16192
  var DIAGRAM_PADDING6, NODE_FONT_SIZE, MIN_NODE_FONT_SIZE, META_FONT_SIZE3, EDGE_LABEL_FONT_SIZE4, EDGE_STROKE_WIDTH5, NODE_STROKE_WIDTH5, NODE_RX, COLLAPSE_BAR_HEIGHT3, ARROWHEAD_W2, ARROWHEAD_H2, CHAR_WIDTH_RATIO2, NODE_TEXT_PADDING, GROUP_RX, GROUP_LABEL_FONT_SIZE, lineGeneratorLR, lineGeneratorTB, lineGeneratorLinear2;
@@ -22749,7 +22802,11 @@ function renderGantt(container, resolved, palette, isDark, options, exportDims)
22749
22802
  const collapsedLanes = options?.collapsedLanes;
22750
22803
  const onToggleLane = options?.onToggleLane;
22751
22804
  const seriesColors2 = getSeriesColors(palette);
22752
- let currentActiveGroup = options?.currentActiveGroup !== void 0 ? options.currentActiveGroup : resolved.tagGroups.length > 0 ? resolved.tagGroups[0].name : null;
22805
+ let currentActiveGroup = resolveActiveTagGroup(
22806
+ resolved.tagGroups,
22807
+ resolved.options.activeTag ?? void 0,
22808
+ options?.currentActiveGroup
22809
+ );
22753
22810
  let criticalPathActive = false;
22754
22811
  const tagRows = currentSwimlaneGroup ? buildTagLaneRowList(resolved, currentSwimlaneGroup, collapsedLanes) : null;
22755
22812
  const rows = tagRows ?? buildRowList(resolved, collapsedGroups);
@@ -25107,7 +25164,11 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
25107
25164
  );
25108
25165
  if (participants.length === 0) return;
25109
25166
  const activationsOff = parsedOptions.activations?.toLowerCase() === "off";
25110
- const activeTagGroup = options?.activeTagGroup !== void 0 ? options.activeTagGroup || void 0 : parsedOptions["active-tag"] || void 0;
25167
+ const activeTagGroup = resolveActiveTagGroup(
25168
+ parsed.tagGroups,
25169
+ parsedOptions["active-tag"],
25170
+ options?.activeTagGroup
25171
+ ) ?? void 0;
25111
25172
  let tagMap;
25112
25173
  const tagValueToColor = /* @__PURE__ */ new Map();
25113
25174
  if (activeTagGroup) {
@@ -26109,6 +26170,7 @@ var init_renderer10 = __esm({
26109
26170
  init_colors();
26110
26171
  init_parser();
26111
26172
  init_tag_resolution();
26173
+ init_tag_groups();
26112
26174
  init_legend_constants();
26113
26175
  init_legend_d3();
26114
26176
  init_title_constants();
@@ -27069,6 +27131,10 @@ function parseVisualization(content, palette) {
27069
27131
  (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning")),
27070
27132
  suggest
27071
27133
  );
27134
+ validateTagGroupNames(
27135
+ result.timelineTagGroups,
27136
+ (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning"))
27137
+ );
27072
27138
  for (const group of result.timelineTagGroups) {
27073
27139
  if (!group.defaultValue) continue;
27074
27140
  const key = group.name.toLowerCase();
@@ -27965,6 +28031,26 @@ function buildEventTooltipHtml(ev) {
27965
28031
  function buildEraTooltipHtml(era) {
27966
28032
  return `<strong>${era.label}</strong><br>${formatDateLabel(era.startDate)} \u2192 ${formatDateLabel(era.endDate)}`;
27967
28033
  }
28034
+ function renderTimelineGroupLegend(g, groups, groupColorMap, textColor, palette, isDark, legendY, onHover, onLeave) {
28035
+ const PILL_H = 22;
28036
+ const DOT_R = 4;
28037
+ const DOT_GAP = 4;
28038
+ const PAD_X = 10;
28039
+ const FONT_SIZE = 11;
28040
+ const GAP = 8;
28041
+ const pillBg = isDark ? mix(palette.surface, palette.bg, 50) : mix(palette.surface, palette.bg, 30);
28042
+ let legendX = 0;
28043
+ for (const grp of groups) {
28044
+ const color = groupColorMap.get(grp.name) ?? textColor;
28045
+ const textW = measureLegendText(grp.name, FONT_SIZE);
28046
+ const pillW = PAD_X + DOT_R * 2 + DOT_GAP + textW + PAD_X;
28047
+ const itemG = g.append("g").attr("class", "tl-legend-item").attr("data-group", grp.name).style("cursor", "pointer").on("mouseenter", () => onHover(grp.name)).on("mouseleave", () => onLeave());
28048
+ itemG.append("rect").attr("x", legendX).attr("y", legendY - PILL_H / 2).attr("width", pillW).attr("height", PILL_H).attr("rx", PILL_H / 2).attr("fill", pillBg);
28049
+ itemG.append("circle").attr("cx", legendX + PAD_X + DOT_R).attr("cy", legendY).attr("r", DOT_R).attr("fill", color);
28050
+ itemG.append("text").attr("x", legendX + PAD_X + DOT_R * 2 + DOT_GAP).attr("y", legendY).attr("dy", "0.35em").attr("fill", textColor).attr("font-size", `${FONT_SIZE}px`).attr("font-family", FONT_FAMILY).text(grp.name);
28051
+ legendX += pillW + GAP;
28052
+ }
28053
+ }
27968
28054
  function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode) {
27969
28055
  d3Selection13.select(container).selectAll(":not([data-d3-tooltip])").remove();
27970
28056
  const {
@@ -28356,15 +28442,17 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
28356
28442
  );
28357
28443
  }
28358
28444
  if (timelineGroups.length > 0) {
28359
- let legendX = 0;
28360
- const legendY = -55;
28361
- for (const grp of timelineGroups) {
28362
- const color = groupColorMap.get(grp.name) ?? textColor;
28363
- const itemG = g.append("g").attr("class", "tl-legend-item").attr("data-group", grp.name).style("cursor", "pointer").on("mouseenter", () => fadeToGroup(g, grp.name)).on("mouseleave", () => fadeReset(g));
28364
- itemG.append("circle").attr("cx", legendX).attr("cy", legendY).attr("r", 5).attr("fill", color);
28365
- itemG.append("text").attr("x", legendX + 10).attr("y", legendY).attr("dy", "0.35em").attr("fill", textColor).attr("font-size", "11px").text(grp.name);
28366
- legendX += grp.name.length * 7 + 30;
28367
- }
28445
+ renderTimelineGroupLegend(
28446
+ g,
28447
+ timelineGroups,
28448
+ groupColorMap,
28449
+ textColor,
28450
+ palette,
28451
+ isDark,
28452
+ -55,
28453
+ (name) => fadeToGroup(g, name),
28454
+ () => fadeReset(g)
28455
+ );
28368
28456
  }
28369
28457
  g.append("line").attr("x1", axisX).attr("y1", 0).attr("x2", axisX).attr("y2", innerHeight).attr("stroke", mutedColor).attr("stroke-width", 1).attr("stroke-dasharray", "4,4");
28370
28458
  for (const ev of sorted) {
@@ -28672,15 +28760,18 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
28672
28760
  );
28673
28761
  }
28674
28762
  if (timelineGroups.length > 0) {
28675
- let legendX = 0;
28676
28763
  const legendY = timelineScale ? -75 : -55;
28677
- for (const grp of timelineGroups) {
28678
- const color = groupColorMap.get(grp.name) ?? textColor;
28679
- const itemG = g.append("g").attr("class", "tl-legend-item").attr("data-group", grp.name).style("cursor", "pointer").on("mouseenter", () => fadeToGroup(g, grp.name)).on("mouseleave", () => fadeReset(g));
28680
- itemG.append("circle").attr("cx", legendX).attr("cy", legendY).attr("r", 5).attr("fill", color);
28681
- itemG.append("text").attr("x", legendX + 10).attr("y", legendY).attr("dy", "0.35em").attr("fill", textColor).attr("font-size", "11px").text(grp.name);
28682
- legendX += grp.name.length * 7 + 30;
28683
- }
28764
+ renderTimelineGroupLegend(
28765
+ g,
28766
+ timelineGroups,
28767
+ groupColorMap,
28768
+ textColor,
28769
+ palette,
28770
+ isDark,
28771
+ legendY,
28772
+ (name) => fadeToGroup(g, name),
28773
+ () => fadeReset(g)
28774
+ );
28684
28775
  }
28685
28776
  sorted.forEach((ev, i) => {
28686
28777
  const y = markerMargin + i * rowH + rowH / 2;
@@ -29792,7 +29883,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29792
29883
  const orgParsed = parseOrg2(content, effectivePalette2);
29793
29884
  if (orgParsed.error) return "";
29794
29885
  const collapsedNodes = orgExportState?.collapsedNodes;
29795
- const activeTagGroup = orgExportState?.activeTagGroup ?? options?.tagGroup ?? null;
29886
+ const activeTagGroup = resolveActiveTagGroup(
29887
+ orgParsed.tagGroups,
29888
+ orgParsed.options["active-tag"],
29889
+ orgExportState?.activeTagGroup ?? options?.tagGroup
29890
+ );
29796
29891
  const hiddenAttributes = orgExportState?.hiddenAttributes;
29797
29892
  const { parsed: effectiveParsed, hiddenCounts } = collapsedNodes && collapsedNodes.size > 0 ? collapseOrgTree2(orgParsed, collapsedNodes) : { parsed: orgParsed, hiddenCounts: /* @__PURE__ */ new Map() };
29798
29893
  const orgLayout = layoutOrg2(
@@ -29831,7 +29926,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29831
29926
  const sitemapParsed = parseSitemap2(content, effectivePalette2);
29832
29927
  if (sitemapParsed.error || sitemapParsed.roots.length === 0) return "";
29833
29928
  const collapsedNodes = orgExportState?.collapsedNodes;
29834
- const activeTagGroup = orgExportState?.activeTagGroup ?? options?.tagGroup ?? null;
29929
+ const activeTagGroup = resolveActiveTagGroup(
29930
+ sitemapParsed.tagGroups,
29931
+ sitemapParsed.options["active-tag"],
29932
+ orgExportState?.activeTagGroup ?? options?.tagGroup
29933
+ );
29835
29934
  const hiddenAttributes = orgExportState?.hiddenAttributes;
29836
29935
  const { parsed: effectiveParsed, hiddenCounts } = collapsedNodes && collapsedNodes.size > 0 ? collapseSitemapTree2(sitemapParsed, collapsedNodes) : { parsed: sitemapParsed, hiddenCounts: /* @__PURE__ */ new Map() };
29837
29936
  const sitemapLayout = layoutSitemap2(
@@ -29876,7 +29975,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29876
29975
  theme === "dark",
29877
29976
  void 0,
29878
29977
  void 0,
29879
- options?.tagGroup
29978
+ resolveActiveTagGroup(
29979
+ kanbanParsed.tagGroups,
29980
+ kanbanParsed.options["active-tag"],
29981
+ options?.tagGroup
29982
+ )
29880
29983
  );
29881
29984
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29882
29985
  }
@@ -29925,7 +30028,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29925
30028
  theme === "dark",
29926
30029
  void 0,
29927
30030
  { width: exportWidth, height: exportHeight },
29928
- options?.tagGroup
30031
+ resolveActiveTagGroup(
30032
+ erParsed.tagGroups,
30033
+ erParsed.options["active-tag"],
30034
+ options?.tagGroup
30035
+ )
29929
30036
  );
29930
30037
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29931
30038
  }
@@ -29948,7 +30055,10 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29948
30055
  blLayout,
29949
30056
  effectivePalette2,
29950
30057
  theme === "dark",
29951
- { exportDims: { width: exportWidth, height: exportHeight } }
30058
+ {
30059
+ exportDims: { width: exportWidth, height: exportHeight },
30060
+ activeTagGroup: options?.tagGroup
30061
+ }
29952
30062
  );
29953
30063
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29954
30064
  }
@@ -29983,7 +30093,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29983
30093
  theme === "dark",
29984
30094
  void 0,
29985
30095
  { width: exportWidth, height: exportHeight },
29986
- options?.tagGroup
30096
+ resolveActiveTagGroup(
30097
+ c4Parsed.tagGroups,
30098
+ c4Parsed.options["active-tag"],
30099
+ options?.tagGroup
30100
+ )
29987
30101
  );
29988
30102
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29989
30103
  }
@@ -30017,7 +30131,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
30017
30131
  if (infraParsed.error || infraParsed.nodes.length === 0) return "";
30018
30132
  const infraComputed = computeInfra2(infraParsed);
30019
30133
  const infraLayout = layoutInfra2(infraComputed);
30020
- const activeTagGroup = options?.tagGroup ?? null;
30134
+ const activeTagGroup = resolveActiveTagGroup(
30135
+ infraParsed.tagGroups,
30136
+ infraParsed.options["active-tag"],
30137
+ options?.tagGroup
30138
+ );
30021
30139
  const titleOffset = infraParsed.title ? 40 : 0;
30022
30140
  const legendGroups = computeInfraLegendGroups2(
30023
30141
  infraLayout.nodes,
@@ -30152,7 +30270,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
30152
30270
  isDark,
30153
30271
  void 0,
30154
30272
  dims,
30155
- orgExportState?.activeTagGroup ?? options?.tagGroup,
30273
+ resolveActiveTagGroup(
30274
+ parsed.timelineTagGroups,
30275
+ void 0,
30276
+ orgExportState?.activeTagGroup ?? options?.tagGroup
30277
+ ),
30156
30278
  orgExportState?.swimlaneTagGroup
30157
30279
  );
30158
30280
  } else if (parsed.type === "venn") {
@@ -31120,7 +31242,7 @@ import {
31120
31242
  compressToEncodedURIComponent,
31121
31243
  decompressFromEncodedURIComponent
31122
31244
  } from "lz-string";
31123
- var DEFAULT_BASE_URL = "https://diagrammo.app/view";
31245
+ var DEFAULT_BASE_URL = "https://online.diagrammo.app";
31124
31246
  var COMPRESSED_SIZE_LIMIT = 8192;
31125
31247
  function encodeDiagramUrl(dsl, options) {
31126
31248
  const baseUrl = options?.baseUrl ?? DEFAULT_BASE_URL;
@@ -31392,21 +31514,33 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31392
31514
  }
31393
31515
  })
31394
31516
  ],
31395
- ["er", withGlobals()],
31517
+ [
31518
+ "er",
31519
+ withGlobals({
31520
+ "active-tag": { description: "Active tag group name" }
31521
+ })
31522
+ ],
31396
31523
  [
31397
31524
  "org",
31398
31525
  withGlobals({
31399
31526
  "sub-node-label": { description: "Label for sub-nodes" },
31400
- "show-sub-node-count": { description: "Show sub-node counts" }
31527
+ "show-sub-node-count": { description: "Show sub-node counts" },
31528
+ "active-tag": { description: "Active tag group name" }
31401
31529
  })
31402
31530
  ],
31403
31531
  [
31404
31532
  "kanban",
31405
31533
  withGlobals({
31406
- "no-auto-color": { description: "Disable automatic card coloring" }
31534
+ "no-auto-color": { description: "Disable automatic card coloring" },
31535
+ "active-tag": { description: "Active tag group name" }
31536
+ })
31537
+ ],
31538
+ [
31539
+ "c4",
31540
+ withGlobals({
31541
+ "active-tag": { description: "Active tag group name" }
31407
31542
  })
31408
31543
  ],
31409
- ["c4", withGlobals()],
31410
31544
  [
31411
31545
  "state",
31412
31546
  withGlobals({
@@ -31417,7 +31551,8 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31417
31551
  [
31418
31552
  "sitemap",
31419
31553
  withGlobals({
31420
- "direction-tb": { description: "Switch to top-to-bottom layout" }
31554
+ "direction-tb": { description: "Switch to top-to-bottom layout" },
31555
+ "active-tag": { description: "Active tag group name" }
31421
31556
  })
31422
31557
  ],
31423
31558
  [
@@ -31431,7 +31566,8 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31431
31566
  "default-rps": { description: "Default RPS capacity for all nodes" },
31432
31567
  "slo-availability": { description: "SLO availability target (0-1)" },
31433
31568
  "slo-p90-latency-ms": { description: "SLO p90 latency target in ms" },
31434
- "slo-warning-margin": { description: "SLO warning margin percentage" }
31569
+ "slo-warning-margin": { description: "SLO warning margin percentage" },
31570
+ "active-tag": { description: "Active tag group name" }
31435
31571
  })
31436
31572
  ],
31437
31573
  [
@@ -31443,7 +31579,8 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31443
31579
  },
31444
31580
  sort: { description: "Sort order", values: ["time", "group", "tag"] },
31445
31581
  "critical-path": { description: "Show critical path" },
31446
- dependencies: { description: "Show dependencies" }
31582
+ dependencies: { description: "Show dependencies" },
31583
+ "active-tag": { description: "Active tag group name" }
31447
31584
  })
31448
31585
  ],
31449
31586
  [