@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/dist/cli.cjs +100 -100
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/d3.ts +13 -7
package/package.json
CHANGED
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
|
-
//
|
|
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
|
-
|
|
4222
|
-
lg.group.name.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 =
|
|
4231
|
-
|
|
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 =
|
|
4240
|
-
currentActiveGroup
|
|
4244
|
+
const isActive = viewMode ||
|
|
4245
|
+
(currentActiveGroup != null &&
|
|
4246
|
+
currentActiveGroup.toLowerCase() === groupKey);
|
|
4241
4247
|
const isSwimActive = currentSwimlaneGroup != null &&
|
|
4242
4248
|
currentSwimlaneGroup.toLowerCase() === groupKey;
|
|
4243
4249
|
|