footprint-explainable-ui 0.27.0 → 0.28.0
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/flowchart.cjs +35 -2
- package/dist/flowchart.cjs.map +1 -1
- package/dist/flowchart.d.cts +12 -1
- package/dist/flowchart.d.ts +12 -1
- package/dist/flowchart.js +35 -2
- package/dist/flowchart.js.map +1 -1
- package/dist/index.cjs +71 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +71 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/flowchart.cjs
CHANGED
|
@@ -2697,6 +2697,7 @@ function TracedFlow({
|
|
|
2697
2697
|
nodeTypes: userNodeTypes,
|
|
2698
2698
|
edgeTypes: userEdgeTypes,
|
|
2699
2699
|
coActiveStageIds,
|
|
2700
|
+
sliceCone,
|
|
2700
2701
|
children,
|
|
2701
2702
|
className,
|
|
2702
2703
|
style
|
|
@@ -2798,6 +2799,38 @@ function TracedFlow({
|
|
|
2798
2799
|
),
|
|
2799
2800
|
[positioned.edges, slice, colors]
|
|
2800
2801
|
);
|
|
2802
|
+
const [coneRevealed, setConeRevealed] = (0, import_react18.useState)(false);
|
|
2803
|
+
(0, import_react18.useEffect)(() => {
|
|
2804
|
+
if (!sliceCone) return;
|
|
2805
|
+
setConeRevealed(false);
|
|
2806
|
+
const raf = requestAnimationFrame(() => setConeRevealed(true));
|
|
2807
|
+
return () => cancelAnimationFrame(raf);
|
|
2808
|
+
}, [sliceCone]);
|
|
2809
|
+
const conedNodes = (0, import_react18.useMemo)(() => {
|
|
2810
|
+
if (!sliceCone || sliceCone.size === 0) return reactFlowNodes;
|
|
2811
|
+
return reactFlowNodes.map((n) => {
|
|
2812
|
+
const depth = sliceCone.get(n.id);
|
|
2813
|
+
if (depth === void 0) {
|
|
2814
|
+
return { ...n, style: { ...n.style, opacity: 0.22, transition: "opacity 260ms ease" } };
|
|
2815
|
+
}
|
|
2816
|
+
return {
|
|
2817
|
+
...n,
|
|
2818
|
+
style: {
|
|
2819
|
+
...n.style,
|
|
2820
|
+
opacity: coneRevealed ? 1 : 0.22,
|
|
2821
|
+
transition: "opacity 320ms ease",
|
|
2822
|
+
transitionDelay: `${depth * 90}ms`
|
|
2823
|
+
}
|
|
2824
|
+
};
|
|
2825
|
+
});
|
|
2826
|
+
}, [reactFlowNodes, sliceCone, coneRevealed]);
|
|
2827
|
+
const conedEdges = (0, import_react18.useMemo)(() => {
|
|
2828
|
+
if (!sliceCone || sliceCone.size === 0) return reactFlowEdges;
|
|
2829
|
+
return reactFlowEdges.map((e) => {
|
|
2830
|
+
const inCone = sliceCone.has(e.source) && sliceCone.has(e.target);
|
|
2831
|
+
return inCone ? e : { ...e, style: { ...e.style, opacity: 0.12, transition: "opacity 260ms ease" } };
|
|
2832
|
+
});
|
|
2833
|
+
}, [reactFlowEdges, sliceCone]);
|
|
2801
2834
|
const handleNodeClick = (0, import_react18.useCallback)(
|
|
2802
2835
|
(_, node) => {
|
|
2803
2836
|
const data = node.data ?? {};
|
|
@@ -2839,8 +2872,8 @@ function TracedFlow({
|
|
|
2839
2872
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2840
2873
|
import_react19.ReactFlow,
|
|
2841
2874
|
{
|
|
2842
|
-
nodes:
|
|
2843
|
-
edges:
|
|
2875
|
+
nodes: conedNodes,
|
|
2876
|
+
edges: conedEdges,
|
|
2844
2877
|
nodeTypes: mergedNodeTypes,
|
|
2845
2878
|
edgeTypes: mergedEdgeTypes,
|
|
2846
2879
|
onNodeClick: handleNodeClick,
|