@diagrammo/dgmo 0.5.2 → 0.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagrammo/dgmo",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "DGMO diagram markup language — parser, renderer, and color system",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/d3.ts CHANGED
@@ -4214,12 +4214,16 @@ export function renderTimeline(
4214
4214
  // Remove previous legend
4215
4215
  mainSvg.selectAll('.tl-tag-legend-group').remove();
4216
4216
 
4217
- // In view mode, only show the active color tag group (expanded, non-interactive)
4217
+ // Effective color source: explicit color group > swimlane group
4218
+ const effectiveColorKey = (currentActiveGroup ?? currentSwimlaneGroup)?.toLowerCase() ?? null;
4219
+
4220
+ // In view mode, only show the color-driving tag group (expanded, non-interactive).
4221
+ // Skip the swimlane group if it's separate from the color group (lane headers already label it).
4218
4222
  const visibleGroups = viewMode
4219
4223
  ? legendGroups.filter(
4220
4224
  (lg) =>
4221
- currentActiveGroup != null &&
4222
- lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase()
4225
+ effectiveColorKey != null &&
4226
+ lg.group.name.toLowerCase() === effectiveColorKey
4223
4227
  )
4224
4228
  : legendGroups;
4225
4229
 
@@ -4227,8 +4231,9 @@ export function renderTimeline(
4227
4231
 
4228
4232
  // Compute total width and center horizontally in SVG
4229
4233
  const totalW = visibleGroups.reduce((s, lg) => {
4230
- const isActive = currentActiveGroup != null &&
4231
- lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase();
4234
+ const isActive = viewMode ||
4235
+ (currentActiveGroup != null &&
4236
+ lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase());
4232
4237
  return s + (isActive ? lg.expandedWidth : lg.minifiedWidth);
4233
4238
  }, 0) + (visibleGroups.length - 1) * LG_GROUP_GAP;
4234
4239
 
@@ -4236,8 +4241,9 @@ export function renderTimeline(
4236
4241
 
4237
4242
  for (const lg of visibleGroups) {
4238
4243
  const groupKey = lg.group.name.toLowerCase();
4239
- const isActive = currentActiveGroup != null &&
4240
- currentActiveGroup.toLowerCase() === groupKey;
4244
+ const isActive = viewMode ||
4245
+ (currentActiveGroup != null &&
4246
+ currentActiveGroup.toLowerCase() === groupKey);
4241
4247
  const isSwimActive = currentSwimlaneGroup != null &&
4242
4248
  currentSwimlaneGroup.toLowerCase() === groupKey;
4243
4249