@localstack/appinspector-ui 1.0.38 → 1.0.40

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
@@ -4299,21 +4299,6 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
4299
4299
  });
4300
4300
  return { edges: inputEdges, nodes: layoutedNodes };
4301
4301
  };
4302
- var getNodesMinMaxX = (nodes) => {
4303
- if (nodes.length === 0) return { maxX: 0, minX: 0 };
4304
- let minX = Number.POSITIVE_INFINITY;
4305
- let maxX = Number.NEGATIVE_INFINITY;
4306
- for (const node of nodes) {
4307
- minX = Math.min(minX, node.position.x);
4308
- maxX = Math.max(maxX, node.position.x);
4309
- }
4310
- return { maxX, minX };
4311
- };
4312
- var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
4313
- const nodeWidth = 200;
4314
- const desiredCenter = focusNodeX + viewPortPixelWidth / 2;
4315
- return Math.min(Math.max(desiredCenter, minX + viewPortPixelWidth / 2), maxX - viewPortPixelWidth / 2 + nodeWidth);
4316
- };
4317
4302
 
4318
4303
  // src/components/trace-graph/xyflow/controls.tsx
4319
4304
  var import_icons_material10 = require("@mui/icons-material");
@@ -4483,12 +4468,7 @@ var TraceGraph = ({
4483
4468
  if (initialFocusEventId) {
4484
4469
  const focusNode = nodes.find((node) => node.id === initialFocusEventId);
4485
4470
  if (focusNode) {
4486
- const { maxX, minX } = getNodesMinMaxX(nodes);
4487
- const centerX = calculateCenterX(focusNode.position.x, viewPortPixelWidth, minX, maxX);
4488
- void setCenter(centerX, focusNode.position.y, {
4489
- duration: 500,
4490
- zoom: 0.8
4491
- });
4471
+ void fitView({ maxZoom: 0.8, nodes: [focusNode], padding: 0.2 });
4492
4472
  onEventSelect(focusNode.data.event);
4493
4473
  }
4494
4474
  } else {
@@ -4523,6 +4503,7 @@ var TraceGraph = ({
4523
4503
  maxZoom: 1.5,
4524
4504
  minZoom: 0.1,
4525
4505
  nodes,
4506
+ nodesDraggable: false,
4526
4507
  nodeTypes,
4527
4508
  onNodeClick: (_event, node) => {
4528
4509
  onEventSelect(node.data.event);