@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/index.cjs CHANGED
@@ -20203,18 +20203,19 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
20203
20203
  );
20204
20204
  }, drawLegend2 = function() {
20205
20205
  mainSvg.selectAll(".tl-tag-legend-group").remove();
20206
+ const effectiveColorKey = (currentActiveGroup ?? currentSwimlaneGroup)?.toLowerCase() ?? null;
20206
20207
  const visibleGroups = viewMode ? legendGroups.filter(
20207
- (lg) => currentActiveGroup != null && lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase()
20208
+ (lg) => effectiveColorKey != null && lg.group.name.toLowerCase() === effectiveColorKey
20208
20209
  ) : legendGroups;
20209
20210
  if (visibleGroups.length === 0) return;
20210
20211
  const totalW = visibleGroups.reduce((s, lg) => {
20211
- const isActive = currentActiveGroup != null && lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase();
20212
+ const isActive = viewMode || currentActiveGroup != null && lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase();
20212
20213
  return s + (isActive ? lg.expandedWidth : lg.minifiedWidth);
20213
20214
  }, 0) + (visibleGroups.length - 1) * LG_GROUP_GAP;
20214
20215
  let cx = (width - totalW) / 2;
20215
20216
  for (const lg of visibleGroups) {
20216
20217
  const groupKey = lg.group.name.toLowerCase();
20217
- const isActive = currentActiveGroup != null && currentActiveGroup.toLowerCase() === groupKey;
20218
+ const isActive = viewMode || currentActiveGroup != null && currentActiveGroup.toLowerCase() === groupKey;
20218
20219
  const isSwimActive = currentSwimlaneGroup != null && currentSwimlaneGroup.toLowerCase() === groupKey;
20219
20220
  const pillLabel = lg.group.name;
20220
20221
  const pillWidth = pillLabel.length * LG_PILL_FONT_W + LG_PILL_PAD;