@tangle-network/charts 0.21.1 → 0.21.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.
@@ -2629,13 +2629,16 @@ function slowestRow(rows, clockMs) {
2629
2629
  }
2630
2630
  /** The agents a reader should look at first: the longest one by the clock, and the costliest when two or more are priced. */
2631
2631
  function agentCallouts(agents, clockMs) {
2632
- let slowest, slowestMs = -1, costliest, top = -1, priced = 0;
2632
+ let slowest, slowestMs = -1, costliest, top = -1, priced = 0, timed = 0;
2633
2633
  for (const row of agents) {
2634
2634
  if (row.durationLabel === "—" || row.span.startMs > clockMs) continue;
2635
- const ms = (spanRunning(row.span) ? Math.max(row.span.endMs, clockMs) : Math.min(row.span.endMs, clockMs)) - row.span.startMs;
2636
- if (ms > slowestMs) {
2637
- slowest = row;
2638
- slowestMs = ms;
2635
+ if (row.kind === "pipeline" && row.parentId !== void 0) {
2636
+ const ms = (spanRunning(row.span) ? Math.max(row.span.endMs, clockMs) : Math.min(row.span.endMs, clockMs)) - row.span.startMs;
2637
+ timed += 1;
2638
+ if (ms > slowestMs) {
2639
+ slowest = row;
2640
+ slowestMs = ms;
2641
+ }
2639
2642
  }
2640
2643
  const cost = row.span.costUsd ?? row.rollupCostUsd;
2641
2644
  if (cost === void 0) continue;
@@ -2646,7 +2649,7 @@ function agentCallouts(agents, clockMs) {
2646
2649
  }
2647
2650
  }
2648
2651
  return {
2649
- slowestId: agents.length > 1 ? slowest?.id : void 0,
2652
+ slowestId: timed > 1 ? slowest?.id : void 0,
2650
2653
  costliestId: priced > 1 && top > 0 ? costliest?.id : void 0
2651
2654
  };
2652
2655
  }
@@ -3704,7 +3707,9 @@ function FlowBody(props) {
3704
3707
  const [viewport, setViewport] = useState(maxHeight);
3705
3708
  const latest = useRef(props);
3706
3709
  latest.current = props;
3707
- const height = props.fixedHeight ? maxHeight : Math.min(maxHeight, Math.max(rows.length, 1) * rowHeight);
3710
+ const tallest = useRef(0);
3711
+ if (!props.holdHeight) tallest.current = 0;
3712
+ const height = tallest.current = Math.max(tallest.current, Math.min(maxHeight, Math.max(rows.length, 1) * rowHeight));
3708
3713
  const links = useMemo(() => linksFor(rows, props.byId, view), [
3709
3714
  rows,
3710
3715
  props.byId,
@@ -4864,7 +4869,7 @@ function FlowWaterfall({ trace, live, startedAt, label = "Trace waterfall", defa
4864
4869
  cursorLine: moving,
4865
4870
  sharedDetail,
4866
4871
  expandedIds: view === "agents" ? /* @__PURE__ */ new Set([...openFamilies, ...openSteps]) : void 0,
4867
- fixedHeight: isLive,
4872
+ holdHeight: isLive,
4868
4873
  slowestId: slowest?.id ?? callouts.slowestId,
4869
4874
  costliestId: callouts.costliestId,
4870
4875
  activeId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/charts",
3
- "version": "0.21.1",
3
+ "version": "0.21.3",
4
4
  "description": "Static SVG and HTML figures for benchmarks and operational timing. Draws from producer data and refuses what it cannot draw honestly.",
5
5
  "type": "module",
6
6
  "license": "MIT",