@opentrace/components 0.1.0 → 0.1.1-pr.110.9

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.
@@ -5260,12 +5260,13 @@ const NODE_SIZE_MULTIPLIERS = {
5260
5260
  };
5261
5261
  const EDGE_SIZE_DEFAULT = 1;
5262
5262
  const EDGE_SIZE_DEFAULT_LINE = 2;
5263
- const EDGE_SIZE_HIGHLIGHTED = 2.5;
5263
+ const EDGE_SIZE_HIGHLIGHTED = 1.25;
5264
5264
  const EDGE_SIZE_DIMMED = 0.5;
5265
5265
  const EDGE_OPACITY_DEFAULT = 0.6;
5266
5266
  const EDGE_OPACITY_HIGHLIGHTED = 1;
5267
5267
  const EDGE_OPACITY_DIMMED = 0.05;
5268
5268
  const NODE_OPACITY_DIMMED = 0.15;
5269
+ const NODE_SIZE_DIMMED_SCALE = 0.35;
5269
5270
  const ZOOM_SIZE_EXPONENT = 0.9;
5270
5271
  const FORCE_LINK_DISTANCE = 200;
5271
5272
  const FORCE_CHARGE_STRENGTH = -200;
@@ -5531,10 +5532,16 @@ function useGraphVisuals(graph, layoutReady, visualState, layoutConfig, _degreeM
5531
5532
  const isSelected = _id === selectedNodeId;
5532
5533
  const showLabel = !hasHighlight || labelNodes.has(_id);
5533
5534
  const baseColor = (colorMode === "community" ? attrs._communityColor : attrs._typeColor) ?? getNodeColor2(attrs.nodeType);
5535
+ const baseSize = attrs._baseSize ?? attrs.size;
5536
+ const originalLabel = attrs._originalLabel ?? attrs.label;
5534
5537
  attrs.color = isHighlighted ? baseColor : dimColor(baseColor, NODE_OPACITY_DIMMED);
5538
+ attrs.size = hasHighlight && !isHighlighted ? baseSize * NODE_SIZE_DIMMED_SCALE : baseSize;
5535
5539
  attrs.borderColor = isSelected ? baseColor : void 0;
5536
5540
  attrs.borderSize = isSelected ? 3 : 0;
5541
+ attrs.label = hasHighlight && !isHighlighted ? null : originalLabel;
5537
5542
  attrs.forceLabel = showLabel && hasHighlight;
5543
+ attrs.zIndex = isSelected ? 2 : isHighlighted && hasHighlight ? 1 : 0;
5544
+ attrs.highlighted = hasHighlight && isHighlighted;
5538
5545
  return attrs;
5539
5546
  });
5540
5547
  const defaultEdgeSize = isLargeGraph ? EDGE_SIZE_DEFAULT_LINE : EDGE_SIZE_DEFAULT;
@@ -5545,9 +5552,11 @@ function useGraphVisuals(graph, layoutReady, visualState, layoutConfig, _degreeM
5545
5552
  if (hasHighlight) {
5546
5553
  attrs.color = isHighlighted ? baseColor : dimColor(baseColor, EDGE_OPACITY_DIMMED);
5547
5554
  attrs.size = isHighlighted ? EDGE_SIZE_HIGHLIGHTED : EDGE_SIZE_DIMMED;
5555
+ attrs.zIndex = isHighlighted ? 1 : 0;
5548
5556
  } else {
5549
5557
  attrs.color = dimColor(baseColor, EDGE_OPACITY_DEFAULT);
5550
5558
  attrs.size = defaultEdgeSize;
5559
+ attrs.zIndex = 0;
5551
5560
  }
5552
5561
  return attrs;
5553
5562
  });
@@ -7099,13 +7108,14 @@ function resolveThemeColors() {
7099
7108
  return cached;
7100
7109
  }
7101
7110
  function drawNodeHover(context, data, settings) {
7111
+ data.key;
7102
7112
  const size = settings.labelSize;
7103
7113
  const font = settings.labelFont;
7104
7114
  const weight = settings.labelWeight;
7105
7115
  const colors = resolveThemeColors();
7106
7116
  const PADDING = 4;
7107
- const label = typeof data.label === "string" ? data.label : "";
7108
7117
  const extras = data;
7118
+ const label = typeof data.label === "string" ? data.label : typeof extras._originalLabel === "string" ? extras._originalLabel : "";
7109
7119
  const nodeType = extras.nodeType;
7110
7120
  const communityName = extras._communityName;
7111
7121
  const subtitle = [nodeType, communityName].filter(Boolean).join(" · ");