@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.js CHANGED
@@ -20186,18 +20186,19 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
20186
20186
  );
20187
20187
  }, drawLegend2 = function() {
20188
20188
  mainSvg.selectAll(".tl-tag-legend-group").remove();
20189
+ const effectiveColorKey = (currentActiveGroup ?? currentSwimlaneGroup)?.toLowerCase() ?? null;
20189
20190
  const visibleGroups = viewMode ? legendGroups.filter(
20190
- (lg) => currentActiveGroup != null && lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase()
20191
+ (lg) => effectiveColorKey != null && lg.group.name.toLowerCase() === effectiveColorKey
20191
20192
  ) : legendGroups;
20192
20193
  if (visibleGroups.length === 0) return;
20193
20194
  const totalW = visibleGroups.reduce((s, lg) => {
20194
- const isActive = currentActiveGroup != null && lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase();
20195
+ const isActive = viewMode || currentActiveGroup != null && lg.group.name.toLowerCase() === currentActiveGroup.toLowerCase();
20195
20196
  return s + (isActive ? lg.expandedWidth : lg.minifiedWidth);
20196
20197
  }, 0) + (visibleGroups.length - 1) * LG_GROUP_GAP;
20197
20198
  let cx = (width - totalW) / 2;
20198
20199
  for (const lg of visibleGroups) {
20199
20200
  const groupKey = lg.group.name.toLowerCase();
20200
- const isActive = currentActiveGroup != null && currentActiveGroup.toLowerCase() === groupKey;
20201
+ const isActive = viewMode || currentActiveGroup != null && currentActiveGroup.toLowerCase() === groupKey;
20201
20202
  const isSwimActive = currentSwimlaneGroup != null && currentSwimlaneGroup.toLowerCase() === groupKey;
20202
20203
  const pillLabel = lg.group.name;
20203
20204
  const pillWidth = pillLabel.length * LG_PILL_FONT_W + LG_PILL_PAD;