@localstack/appinspector-ui 1.0.39 → 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 +1 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4262,21 +4262,6 @@ var getLayoutedNodesAndEdges = (inputNodes, inputEdges) => {
|
|
|
4262
4262
|
});
|
|
4263
4263
|
return { edges: inputEdges, nodes: layoutedNodes };
|
|
4264
4264
|
};
|
|
4265
|
-
var getNodesMinMaxX = (nodes) => {
|
|
4266
|
-
if (nodes.length === 0) return { maxX: 0, minX: 0 };
|
|
4267
|
-
let minX = Number.POSITIVE_INFINITY;
|
|
4268
|
-
let maxX = Number.NEGATIVE_INFINITY;
|
|
4269
|
-
for (const node of nodes) {
|
|
4270
|
-
minX = Math.min(minX, node.position.x);
|
|
4271
|
-
maxX = Math.max(maxX, node.position.x);
|
|
4272
|
-
}
|
|
4273
|
-
return { maxX, minX };
|
|
4274
|
-
};
|
|
4275
|
-
var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
|
|
4276
|
-
const nodeWidth = 200;
|
|
4277
|
-
const desiredCenter = focusNodeX + viewPortPixelWidth / 2;
|
|
4278
|
-
return Math.min(Math.max(desiredCenter, minX + viewPortPixelWidth / 2), maxX - viewPortPixelWidth / 2 + nodeWidth);
|
|
4279
|
-
};
|
|
4280
4265
|
|
|
4281
4266
|
// src/components/trace-graph/xyflow/controls.tsx
|
|
4282
4267
|
import { Add, FitScreen, Remove } from "@mui/icons-material";
|
|
@@ -4446,12 +4431,7 @@ var TraceGraph = ({
|
|
|
4446
4431
|
if (initialFocusEventId) {
|
|
4447
4432
|
const focusNode = nodes.find((node) => node.id === initialFocusEventId);
|
|
4448
4433
|
if (focusNode) {
|
|
4449
|
-
|
|
4450
|
-
const centerX = calculateCenterX(focusNode.position.x, viewPortPixelWidth, minX, maxX);
|
|
4451
|
-
void setCenter(centerX, focusNode.position.y, {
|
|
4452
|
-
duration: 500,
|
|
4453
|
-
zoom: 0.8
|
|
4454
|
-
});
|
|
4434
|
+
void fitView({ maxZoom: 0.8, nodes: [focusNode], padding: 0.2 });
|
|
4455
4435
|
onEventSelect(focusNode.data.event);
|
|
4456
4436
|
}
|
|
4457
4437
|
} else {
|