@aiready/visualizer 0.6.12 → 0.6.14
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/visualizer",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14",
|
|
4
4
|
"description": "Interactive graph visualization for AIReady analysis results",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react": "19.2.4",
|
|
50
50
|
"react-dom": "19.2.4",
|
|
51
51
|
"regenerator-runtime": "^0.14.1",
|
|
52
|
-
"@aiready/core": "0.23.
|
|
52
|
+
"@aiready/core": "0.23.15"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@tailwindcss/vite": "^4.1.18",
|
|
@@ -28576,6 +28576,17 @@ function useWindowDrag(enableDrag, svgRef, transformRef, dragActiveRef, dragNode
|
|
|
28576
28576
|
onDragEnd
|
|
28577
28577
|
]);
|
|
28578
28578
|
}
|
|
28579
|
+
function pinNode(node) {
|
|
28580
|
+
node.fx = node.x;
|
|
28581
|
+
node.fy = node.y;
|
|
28582
|
+
}
|
|
28583
|
+
function unpinNode(node) {
|
|
28584
|
+
node.fx = null;
|
|
28585
|
+
node.fy = null;
|
|
28586
|
+
}
|
|
28587
|
+
function unpinAllNodes(nodes) {
|
|
28588
|
+
nodes.forEach(unpinNode);
|
|
28589
|
+
}
|
|
28579
28590
|
var ForceDirectedGraph = (0, import_react.forwardRef)(({ nodes: initialNodes, links: initialLinks, width, height, enableZoom = true, enableDrag = true, onNodeClick, onNodeHover, onLinkClick, selectedNodeId, hoveredNodeId, defaultNodeColor = DEFAULT_NODE_COLOR, defaultNodeSize = DEFAULT_NODE_SIZE, defaultLinkColor = DEFAULT_LINK_COLOR, defaultLinkWidth = DEFAULT_LINK_WIDTH, showNodeLabels = true, showLinkLabels = false, className, manualLayout = false, onManualLayoutChange, packageBounds, layout: externalLayout, onLayoutChange }, ref) => {
|
|
28580
28591
|
const svgRef = (0, import_react.useRef)(null);
|
|
28581
28592
|
const gRef = (0, import_react.useRef)(null);
|
|
@@ -28640,26 +28651,19 @@ var ForceDirectedGraph = (0, import_react.forwardRef)(({ nodes: initialNodes, li
|
|
|
28640
28651
|
pinAll: () => {
|
|
28641
28652
|
const newPinned = /* @__PURE__ */ new Set();
|
|
28642
28653
|
nodes.forEach((node) => {
|
|
28643
|
-
node
|
|
28644
|
-
node.fy = node.y;
|
|
28654
|
+
pinNode(node);
|
|
28645
28655
|
newPinned.add(node.id);
|
|
28646
28656
|
});
|
|
28647
28657
|
setPinnedNodes(newPinned);
|
|
28648
28658
|
restart();
|
|
28649
28659
|
},
|
|
28650
28660
|
unpinAll: () => {
|
|
28651
|
-
nodes
|
|
28652
|
-
node.fx = null;
|
|
28653
|
-
node.fy = null;
|
|
28654
|
-
});
|
|
28661
|
+
unpinAllNodes(nodes);
|
|
28655
28662
|
setPinnedNodes(/* @__PURE__ */ new Set());
|
|
28656
28663
|
restart();
|
|
28657
28664
|
},
|
|
28658
28665
|
resetLayout: () => {
|
|
28659
|
-
nodes
|
|
28660
|
-
node.fx = null;
|
|
28661
|
-
node.fy = null;
|
|
28662
|
-
});
|
|
28666
|
+
unpinAllNodes(nodes);
|
|
28663
28667
|
setPinnedNodes(/* @__PURE__ */ new Set());
|
|
28664
28668
|
restart();
|
|
28665
28669
|
},
|
|
@@ -28733,8 +28737,7 @@ var ForceDirectedGraph = (0, import_react.forwardRef)(({ nodes: initialNodes, li
|
|
|
28733
28737
|
event.stopPropagation();
|
|
28734
28738
|
dragActiveRef.current = true;
|
|
28735
28739
|
dragNodeRef.current = node;
|
|
28736
|
-
node
|
|
28737
|
-
node.fy = node.y;
|
|
28740
|
+
pinNode(node);
|
|
28738
28741
|
setPinnedNodes((prev) => /* @__PURE__ */ new Set([...prev, node.id]));
|
|
28739
28742
|
stop();
|
|
28740
28743
|
}, [enableDrag, stop]);
|
|
@@ -28749,8 +28752,7 @@ var ForceDirectedGraph = (0, import_react.forwardRef)(({ nodes: initialNodes, li
|
|
|
28749
28752
|
if (!event.active) restart();
|
|
28750
28753
|
dragActiveRef.current = true;
|
|
28751
28754
|
dragNodeRef.current = node;
|
|
28752
|
-
node
|
|
28753
|
-
node.fy = node.y;
|
|
28755
|
+
pinNode(node);
|
|
28754
28756
|
setPinnedNodes((prev) => /* @__PURE__ */ new Set([...prev, node.id]));
|
|
28755
28757
|
}).on("drag", (event) => {
|
|
28756
28758
|
if (!dragActiveRef.current || !dragNodeRef.current) return;
|
|
@@ -28780,12 +28782,10 @@ var ForceDirectedGraph = (0, import_react.forwardRef)(({ nodes: initialNodes, li
|
|
|
28780
28782
|
event.stopPropagation();
|
|
28781
28783
|
if (!enableDrag) return;
|
|
28782
28784
|
if (node.fx === null || node.fx === void 0) {
|
|
28783
|
-
node
|
|
28784
|
-
node.fy = node.y;
|
|
28785
|
+
pinNode(node);
|
|
28785
28786
|
setPinnedNodes((prev) => /* @__PURE__ */ new Set([...prev, node.id]));
|
|
28786
28787
|
} else {
|
|
28787
|
-
node
|
|
28788
|
-
node.fy = null;
|
|
28788
|
+
unpinNode(node);
|
|
28789
28789
|
setPinnedNodes((prev) => {
|
|
28790
28790
|
const next = new Set(prev);
|
|
28791
28791
|
next.delete(node.id);
|
|
@@ -28800,10 +28800,7 @@ var ForceDirectedGraph = (0, import_react.forwardRef)(({ nodes: initialNodes, li
|
|
|
28800
28800
|
height,
|
|
28801
28801
|
className: cn("bg-white dark:bg-gray-900", className),
|
|
28802
28802
|
onDoubleClick: () => {
|
|
28803
|
-
nodes
|
|
28804
|
-
n.fx = null;
|
|
28805
|
-
n.fy = null;
|
|
28806
|
-
});
|
|
28803
|
+
unpinAllNodes(nodes);
|
|
28807
28804
|
setPinnedNodes(/* @__PURE__ */ new Set());
|
|
28808
28805
|
restart();
|
|
28809
28806
|
},
|
|
@@ -29289,4 +29286,4 @@ function App() {
|
|
|
29289
29286
|
(0, import_client.createRoot)(document.getElementById("root")).render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(App, {}) }));
|
|
29290
29287
|
//#endregion
|
|
29291
29288
|
|
|
29292
|
-
//# sourceMappingURL=index-
|
|
29289
|
+
//# sourceMappingURL=index-Zc8kVQDw.js.map
|