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