@cccsaurora/clue-ui 0.15.0-dev.31 → 0.15.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/package.json +143 -39
- package/ActionForm-DgfJwTzt.js +0 -436
- package/AnnotationPreview-BvNpZOP0.js +0 -188
- package/ClueEnrichContext-DXwLVp0M.js +0 -518
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/api/lookup/enrich.d.ts +0 -10
- package/api/lookup/index.d.ts +0 -5
- package/api/lookup/types.d.ts +0 -5
- package/api/lookup/types_detection.d.ts +0 -5
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/components/AnnotationBody.d.ts +0 -6
- package/components/AnnotationBody.js +0 -56
- package/components/AnnotationDetailPopover.d.ts +0 -14
- package/components/AnnotationDetailPopover.js +0 -61
- package/components/AnnotationDetails.d.ts +0 -8
- package/components/AnnotationDetails.js +0 -172
- package/components/AnnotationEntry.d.ts +0 -6
- package/components/AnnotationEntry.js +0 -59
- package/components/AnnotationPreview.d.ts +0 -14
- package/components/AnnotationPreview.js +0 -11
- package/components/ClassificationChip.d.ts +0 -11
- package/components/ClassificationChip.js +0 -52
- package/components/CountBadge.d.ts +0 -8
- package/components/CountBadge.js +0 -34
- package/components/EnrichedCard.d.ts +0 -14
- package/components/EnrichedCard.js +0 -162
- package/components/EnrichedChip.d.ts +0 -9
- package/components/EnrichedChip.js +0 -176
- package/components/EnrichedTypography.d.ts +0 -16
- package/components/EnrichedTypography.js +0 -178
- package/components/ErrorBoundary.d.ts +0 -15
- package/components/ErrorBoundary.js +0 -36
- package/components/RetryFailedEnrichments.d.ts +0 -2
- package/components/RetryFailedEnrichments.js +0 -13
- package/components/SourcePicker.d.ts +0 -2
- package/components/SourcePicker.js +0 -98
- package/components/actions/ActionForm.d.ts +0 -6
- package/components/actions/ActionForm.js +0 -16
- package/components/actions/ExecutePopover.d.ts +0 -10
- package/components/actions/ExecutePopover.js +0 -93
- package/components/actions/ResultModal.d.ts +0 -9
- package/components/actions/ResultModal.js +0 -46
- package/components/actions/form/schemaAdapter.d.ts +0 -3
- package/components/actions/form/schemaAdapter.js +0 -47
- package/components/display/graph/ExpandMoreButton.d.ts +0 -7
- package/components/display/graph/ExpandMoreButton.js +0 -18
- package/components/display/graph/elements/NodeCard.d.ts +0 -10
- package/components/display/graph/elements/NodeCard.js +0 -146
- package/components/display/graph/elements/NodeTag.d.ts +0 -9
- package/components/display/graph/elements/NodeTag.js +0 -17
- package/components/display/graph/index.d.ts +0 -9
- package/components/display/graph/index.js +0 -438
- package/components/display/graph/visualizations/Leaf.d.ts +0 -25
- package/components/display/graph/visualizations/Leaf.js +0 -125
- package/components/display/graph/visualizations/cloud/index.d.ts +0 -24
- package/components/display/graph/visualizations/cloud/index.js +0 -141
- package/components/display/graph/visualizations/icons/BaseIcon.d.ts +0 -12
- package/components/display/graph/visualizations/icons/BaseIcon.js +0 -37
- package/components/display/graph/visualizations/icons/BugIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/BugIcon.js +0 -18
- package/components/display/graph/visualizations/icons/HostIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/HostIcon.js +0 -24
- package/components/display/graph/visualizations/icons/NetworkIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/NetworkIcon.js +0 -24
- package/components/display/graph/visualizations/icons/ProcessIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/ProcessIcon.js +0 -18
- package/components/display/graph/visualizations/icons/TargetIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/TargetIcon.js +0 -19
- package/components/display/graph/visualizations/icons/index.d.ts +0 -2
- package/components/display/graph/visualizations/icons/index.js +0 -16
- package/components/display/graph/visualizations/panels/NodePanel.d.ts +0 -8
- package/components/display/graph/visualizations/panels/NodePanel.js +0 -12
- package/components/display/graph/visualizations/tree/BundleLine.d.ts +0 -29
- package/components/display/graph/visualizations/tree/BundleLine.js +0 -121
- package/components/display/graph/visualizations/tree/Triangle.d.ts +0 -9
- package/components/display/graph/visualizations/tree/Triangle.js +0 -26
- package/components/display/graph/visualizations/tree/index.d.ts +0 -36
- package/components/display/graph/visualizations/tree/index.js +0 -485
- package/components/display/graph/visualizations/tree/types.d.ts +0 -11
- package/components/display/graph/visualizations/tree/types.js +0 -1
- package/components/display/icons/Iconified.d.ts +0 -9
- package/components/display/icons/Iconified.js +0 -29
- package/components/display/json/index.d.ts +0 -14
- package/components/display/json/index.js +0 -12
- package/components/display/markdown/DynamicTabs.d.ts +0 -8
- package/components/display/markdown/DynamicTabs.js +0 -26
- package/components/display/markdown/index.d.ts +0 -9
- package/components/display/markdown/index.js +0 -13389
- package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
- package/components/display/markdown/markdownPlugins/tabs.js +0 -4
- package/components/enrichment/EnrichPopover.d.ts +0 -10
- package/components/enrichment/EnrichPopover.js +0 -88
- package/components/fetchers/Fetcher.d.ts +0 -17
- package/components/fetchers/Fetcher.js +0 -188
- package/components/fetchers/PreviewModal.d.ts +0 -8
- package/components/fetchers/PreviewModal.js +0 -22
- package/components/fetchers/StatusChip.d.ts +0 -8
- package/components/fetchers/StatusChip.js +0 -30
- package/components/group/Entry.d.ts +0 -8
- package/components/group/Entry.js +0 -15
- package/components/group/Group.d.ts +0 -12
- package/components/group/Group.js +0 -15
- package/components/group/GroupControl.d.ts +0 -4
- package/components/group/GroupControl.js +0 -103
- package/components/stats/QueryStatus.d.ts +0 -4
- package/components/stats/QueryStatus.js +0 -61
- package/countBy-C69WslUA.js +0 -14
- package/data/event.d.ts +0 -12
- package/data/event.js +0 -8
- package/database/index.d.ts +0 -4
- package/database/index.js +0 -4
- package/database/selector.schema.json.d.ts +0 -119
- package/database/status.schema.json.d.ts +0 -38
- package/database/types.d.ts +0 -64
- package/debounce-bV0h5FC5.js +0 -92
- package/en/translation.json +0 -135
- package/fr/translation.json +0 -135
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/hooks/ClueActionContext.d.ts +0 -86
- package/hooks/ClueActionContext.js +0 -18
- package/hooks/ClueComponentContext.d.ts +0 -10
- package/hooks/ClueComponentContext.js +0 -40
- package/hooks/ClueConfigProvider.d.ts +0 -12
- package/hooks/ClueConfigProvider.js +0 -23
- package/hooks/ClueDatabaseContext.d.ts +0 -10
- package/hooks/ClueDatabaseContext.js +0 -23
- package/hooks/ClueEnrichContext.d.ts +0 -6
- package/hooks/ClueEnrichContext.js +0 -15
- package/hooks/ClueEnrichContextType.d.ts +0 -113
- package/hooks/ClueEnrichProps.d.ts +0 -81
- package/hooks/ClueFetcherContext.d.ts +0 -35
- package/hooks/ClueFetcherContext.js +0 -88
- package/hooks/ClueGroupContext.d.ts +0 -14
- package/hooks/ClueGroupContext.js +0 -23
- package/hooks/CluePopupContext.d.ts +0 -24
- package/hooks/CluePopupContext.js +0 -12
- package/hooks/ClueProvider.d.ts +0 -9
- package/hooks/ClueProvider.js +0 -14
- package/hooks/selectors.d.ts +0 -10
- package/hooks/selectors.js +0 -24
- package/hooks/useAnnotations.d.ts +0 -24
- package/hooks/useAnnotations.js +0 -69
- package/hooks/useClue.d.ts +0 -4
- package/hooks/useClue.js +0 -8
- package/hooks/useClueActions.d.ts +0 -4
- package/hooks/useClueActions.js +0 -5
- package/hooks/useClueConfig.d.ts +0 -1
- package/hooks/useClueConfig.js +0 -8
- package/hooks/useClueTypeConfig.d.ts +0 -17
- package/hooks/useClueTypeConfig.js +0 -7
- package/hooks/useComparator.d.ts +0 -16
- package/hooks/useComparator.js +0 -1060
- package/hooks/useErrors.d.ts +0 -17
- package/hooks/useErrors.js +0 -35
- package/hooks/useMyHighlights.d.ts +0 -11
- package/hooks/useMyHighlights.js +0 -74
- package/hooks/useMyLocalStorage.d.ts +0 -16
- package/hooks/useMyLocalStorage.js +0 -80
- package/iconify-CXMreGTg.js +0 -1782
- package/icons/Action.d.ts +0 -9
- package/icons/Action.js +0 -90
- package/icons/Assessment.d.ts +0 -11
- package/icons/Assessment.js +0 -123
- package/icons/Context.d.ts +0 -12
- package/icons/Context.js +0 -83
- package/icons/Opinion.d.ts +0 -11
- package/icons/Opinion.js +0 -125
- package/icons/iconMap.d.ts +0 -7
- package/icons/iconMap.js +0 -10
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BDrtH5ec.js +0 -465
- package/index-C9lySIVX.js +0 -1172
- package/index-DJYqRcxJ.js +0 -15750
- package/index-Dn2NHyXg.js +0 -17654
- package/index.css +0 -21
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/isUndefined-CE8h73dH.js +0 -10
- package/last-CUCl67Im.js +0 -7
- package/main.d.ts +0 -42
- package/main.js +0 -70
- package/public/manifest.json +0 -16
- package/public/robots.txt +0 -3
- package/public/svg/dark/clue-h.svg +0 -52
- package/public/svg/dark/clue-icon1-simple.svg +0 -33
- package/public/svg/dark/clue-icon1.svg +0 -44
- package/public/svg/dark/clue-icon2-simple.svg +0 -26
- package/public/svg/dark/clue-icon2.svg +0 -37
- package/public/svg/dark/clue-name.svg +0 -14
- package/public/svg/dark/clue-v.svg +0 -52
- package/public/svg/light/clue-h.svg +0 -60
- package/public/svg/light/clue-icon1-simple.svg +0 -37
- package/public/svg/light/clue-icon1.svg +0 -48
- package/public/svg/light/clue-icon2-simple.svg +0 -30
- package/public/svg/light/clue-icon2.svg +0 -41
- package/public/svg/light/clue-name.svg +0 -14
- package/public/svg/light/clue-v.svg +0 -60
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/text/Frequency.d.ts +0 -9
- package/text/Frequency.js +0 -49
- package/toFinite-CArjry_l.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/types/EnrichmentProps.d.ts +0 -73
- package/types/RunningActionData.d.ts +0 -15
- package/types/WithActionData.d.ts +0 -9
- package/types/action.d.ts +0 -25
- package/types/config.d.ts +0 -16
- package/types/fetcher.d.ts +0 -60
- package/types/graph.d.ts +0 -101
- package/types/lookup.d.ts +0 -62
- package/types/network.d.ts +0 -9
- package/useClueTypeConfig-D9ZSxa4F.js +0 -3096
- package/utils/chain.d.ts +0 -14
- package/utils/chain.js +0 -106
- package/utils/classificationParser.d.ts +0 -195
- package/utils/classificationParser.js +0 -553
- package/utils/constants.d.ts +0 -26
- package/utils/constants.js +0 -36
- package/utils/graph.d.ts +0 -13
- package/utils/graph.js +0 -79
- package/utils/hashUtil.d.ts +0 -6
- package/utils/hashUtil.js +0 -11
- package/utils/line.d.ts +0 -28
- package/utils/line.js +0 -136
- package/utils/loggerUtil.d.ts +0 -6
- package/utils/loggerUtil.js +0 -8
- package/utils/sessionStorage.d.ts +0 -9
- package/utils/sessionStorage.js +0 -51
- package/utils/utils.d.ts +0 -13
- package/utils/utils.js +0 -11
- package/utils/window.d.ts +0 -3
- package/utils/window.js +0 -24
- package/utils-CxIhC2xH.js +0 -4182
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "@mui/material";
|
|
3
|
-
import { d as d3, S as Spectral } from "../../../../../index-DJYqRcxJ.js";
|
|
4
|
-
import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
|
|
5
|
-
import { StorageKey } from "../../../../../utils/constants.js";
|
|
6
|
-
import { buildHorizontalLine, buildVerticalLine } from "../../../../../utils/line.js";
|
|
7
|
-
import { i as isNil } from "../../../../../isNil-CIubwp4T.js";
|
|
8
|
-
import { useMemo } from "react";
|
|
9
|
-
import { cyrb53 } from "../../../../../utils/graph.js";
|
|
10
|
-
const BundleLine = ({
|
|
11
|
-
bundle,
|
|
12
|
-
linesByLevel,
|
|
13
|
-
paddingByLevel,
|
|
14
|
-
maxArcRadius,
|
|
15
|
-
lineWidth,
|
|
16
|
-
linePaddingX,
|
|
17
|
-
linePaddingY,
|
|
18
|
-
highlightedPath,
|
|
19
|
-
nodeLocations,
|
|
20
|
-
inputsByNode,
|
|
21
|
-
outputsByNode,
|
|
22
|
-
lineDirection,
|
|
23
|
-
colorTheme
|
|
24
|
-
}) => {
|
|
25
|
-
const theme = useTheme();
|
|
26
|
-
const [colorSetting] = useMyLocalStorageItem(StorageKey.COLOR_SCHEME, "Spectral");
|
|
27
|
-
const [forceColorSetting] = useMyLocalStorageItem(StorageKey.FORCE_COLOR_SETTING, "Spectral");
|
|
28
|
-
const colorScheme = useMemo(
|
|
29
|
-
() => forceColorSetting ? colorSetting : colorTheme || colorSetting,
|
|
30
|
-
[colorSetting, colorTheme, forceColorSetting]
|
|
31
|
-
);
|
|
32
|
-
const color = useMemo(
|
|
33
|
-
() => (d3[`interpolate${colorScheme}`] ?? Spectral)(cyrb53(JSON.stringify(bundle))),
|
|
34
|
-
[bundle, colorScheme]
|
|
35
|
-
);
|
|
36
|
-
const opacities = useMemo(
|
|
37
|
-
() => (_bundle) => highlightedPath.size === 0 || _bundle.sources.some((source) => highlightedPath.has(source.id)) && _bundle.destinations.some((destination) => highlightedPath.has(destination.id)) ? 1 : 0.2,
|
|
38
|
-
[highlightedPath]
|
|
39
|
-
);
|
|
40
|
-
const arrows = [];
|
|
41
|
-
const d = bundle.sources.flatMap((source) => {
|
|
42
|
-
const result = bundle.destinations.flatMap((dest) => {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
linesByLevel[dest.level].delete(bundle.id);
|
|
45
|
-
const [parentX, rawParentY] = nodeLocations[source.id];
|
|
46
|
-
const parentY = rawParentY + (((_a = outputsByNode[source.id]) == null ? void 0 : _a.size) ?? 0) * linePaddingY;
|
|
47
|
-
const [childX, rawChildY, childHeight] = nodeLocations[dest.id];
|
|
48
|
-
const childY = rawChildY + (((_b = inputsByNode[dest.id]) == null ? void 0 : _b.size) ?? 0 + +(source.id === dest.id)) * linePaddingY;
|
|
49
|
-
const distanceX = childX - parentX;
|
|
50
|
-
const distanceY = childY - parentY;
|
|
51
|
-
const arcRadius = Math.min(Math.abs(distanceY / 3), maxArcRadius);
|
|
52
|
-
if (lineDirection === "horizontal") {
|
|
53
|
-
return buildHorizontalLine({
|
|
54
|
-
paddingAtLevel: paddingByLevel[dest.level],
|
|
55
|
-
numLines: linesByLevel[dest.level].size,
|
|
56
|
-
nodeLocations,
|
|
57
|
-
dest,
|
|
58
|
-
distanceX,
|
|
59
|
-
distanceY,
|
|
60
|
-
childX,
|
|
61
|
-
childY,
|
|
62
|
-
childHeight,
|
|
63
|
-
parentX,
|
|
64
|
-
parentY,
|
|
65
|
-
linePaddingX,
|
|
66
|
-
arcRadius
|
|
67
|
-
});
|
|
68
|
-
} else {
|
|
69
|
-
return buildVerticalLine({
|
|
70
|
-
paddingAtLevel: paddingByLevel[dest.level],
|
|
71
|
-
numLines: linesByLevel[dest.level].size,
|
|
72
|
-
distanceX,
|
|
73
|
-
distanceY,
|
|
74
|
-
childX,
|
|
75
|
-
childY,
|
|
76
|
-
childHeight,
|
|
77
|
-
parentX,
|
|
78
|
-
parentY,
|
|
79
|
-
linePaddingX,
|
|
80
|
-
arcRadius
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
return result;
|
|
85
|
-
}).join("\n");
|
|
86
|
-
bundle.destinations.forEach((dest) => {
|
|
87
|
-
if (isNil(inputsByNode[dest.id])) {
|
|
88
|
-
inputsByNode[dest.id] = /* @__PURE__ */ new Set();
|
|
89
|
-
}
|
|
90
|
-
inputsByNode[dest.id].add(bundle.id);
|
|
91
|
-
});
|
|
92
|
-
bundle.sources.forEach((source) => {
|
|
93
|
-
if (isNil(outputsByNode[source.id])) {
|
|
94
|
-
outputsByNode[source.id] = /* @__PURE__ */ new Set();
|
|
95
|
-
}
|
|
96
|
-
outputsByNode[source.id].add(bundle.id);
|
|
97
|
-
});
|
|
98
|
-
return /* @__PURE__ */ jsxs("g", { className: "path", style: { opacity: opacities(bundle) }, children: [
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
100
|
-
"path",
|
|
101
|
-
{
|
|
102
|
-
d,
|
|
103
|
-
style: { fill: "none", stroke: theme.palette.background.paper, strokeWidth: lineWidth + 3 }
|
|
104
|
-
},
|
|
105
|
-
bundle.id + "-bg"
|
|
106
|
-
),
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
108
|
-
"path",
|
|
109
|
-
{
|
|
110
|
-
d,
|
|
111
|
-
strokeWidth: lineWidth,
|
|
112
|
-
style: { fill: "none", stroke: color, strokeWidth: lineWidth }
|
|
113
|
-
},
|
|
114
|
-
bundle.id + "-fg"
|
|
115
|
-
),
|
|
116
|
-
arrows
|
|
117
|
-
] }, bundle.id);
|
|
118
|
-
};
|
|
119
|
-
export {
|
|
120
|
-
BundleLine as default
|
|
121
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "@mui/material";
|
|
3
|
-
const Triangle = ({ x, y, fill, lineWidth }) => {
|
|
4
|
-
const theme = useTheme();
|
|
5
|
-
return /* @__PURE__ */ jsxs("g", { className: "arrow", children: [
|
|
6
|
-
/* @__PURE__ */ jsx(
|
|
7
|
-
"polygon",
|
|
8
|
-
{
|
|
9
|
-
points: `${x},${y - 1.5 * lineWidth} ${x - 2 * lineWidth},${y + 1.5 * lineWidth} ${x + 2 * lineWidth},${y + 1.5 * lineWidth}`,
|
|
10
|
-
style: { fill },
|
|
11
|
-
stroke: theme.palette.background.paper,
|
|
12
|
-
strokeWidth: 2
|
|
13
|
-
}
|
|
14
|
-
),
|
|
15
|
-
/* @__PURE__ */ jsx(
|
|
16
|
-
"polygon",
|
|
17
|
-
{
|
|
18
|
-
points: `${x - lineWidth / 2},${y - 2 * lineWidth} ${x + lineWidth / 2},${y - 2 * lineWidth} ${x + lineWidth / 2},${y + 2 * lineWidth} ${x - lineWidth / 2},${y + 2 * lineWidth}`,
|
|
19
|
-
style: { fill }
|
|
20
|
-
}
|
|
21
|
-
)
|
|
22
|
-
] });
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
Triangle as default
|
|
26
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { NestedDataset, ZoomField } from "../../../../../types/graph";
|
|
2
|
-
import { MutableRefObject } from 'react';
|
|
3
|
-
|
|
4
|
-
interface TreeOptions {
|
|
5
|
-
textColor: string;
|
|
6
|
-
nodeColor: {
|
|
7
|
-
border: string;
|
|
8
|
-
center: string;
|
|
9
|
-
};
|
|
10
|
-
letterSize: number;
|
|
11
|
-
letterWidth: number;
|
|
12
|
-
xSpacing: number;
|
|
13
|
-
ySpacing: number;
|
|
14
|
-
nodeRadius: number;
|
|
15
|
-
maxArcRadius: number;
|
|
16
|
-
linePaddingX: number;
|
|
17
|
-
linePaddingY: number;
|
|
18
|
-
lineWidth: number;
|
|
19
|
-
enableEntryPadding: boolean;
|
|
20
|
-
truncateLabels: boolean;
|
|
21
|
-
enableTimestamps: boolean;
|
|
22
|
-
rowStep: number;
|
|
23
|
-
belowPrevious: boolean;
|
|
24
|
-
iconOrientation: 'horizontal' | 'vertical';
|
|
25
|
-
lineDirection: 'horizontal' | 'vertical';
|
|
26
|
-
colorTheme?: string;
|
|
27
|
-
}
|
|
28
|
-
declare const _default: import('react').NamedExoticComponent<{
|
|
29
|
-
svgRef?: MutableRefObject<SVGSVGElement>;
|
|
30
|
-
graph: NestedDataset;
|
|
31
|
-
labelKeys: ZoomField[];
|
|
32
|
-
onNodeSelectionChanged: (nodeIds: string[]) => void;
|
|
33
|
-
options?: Partial<TreeOptions>;
|
|
34
|
-
zoom: d3.ZoomTransform;
|
|
35
|
-
}>;
|
|
36
|
-
export default _default;
|
|
@@ -1,485 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme, colors, Box } from "@mui/material";
|
|
3
|
-
import useComparator from "../../../../../hooks/useComparator.js";
|
|
4
|
-
import useMyHighlights from "../../../../../hooks/useMyHighlights.js";
|
|
5
|
-
import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
|
|
6
|
-
import { StorageKey, BUNDLE_SEPARATOR } from "../../../../../utils/constants.js";
|
|
7
|
-
import { c as cloneDeep } from "../../../../../cloneDeep-CjP5k9zW.js";
|
|
8
|
-
import { g as get } from "../../../../../get-D3C3lEU3.js";
|
|
9
|
-
import { i as isNil } from "../../../../../isNil-CIubwp4T.js";
|
|
10
|
-
import { b as baseExtremum, a as baseGt, i as isIterateeCall } from "../../../../../_baseExtremum-B1o1zHjR.js";
|
|
11
|
-
import { i as identity } from "../../../../../identity-CPGTqrE4.js";
|
|
12
|
-
import { t as toFinite } from "../../../../../toFinite-CArjry_l.js";
|
|
13
|
-
import { b as baseSum } from "../../../../../_baseSum-D0WC1dN0.js";
|
|
14
|
-
import { memo, useMemo } from "react";
|
|
15
|
-
import NodeCard from "../../elements/NodeCard.js";
|
|
16
|
-
import getIcon from "../icons/index.js";
|
|
17
|
-
import Leaf from "../Leaf.js";
|
|
18
|
-
import BundleLine from "./BundleLine.js";
|
|
19
|
-
function max(array) {
|
|
20
|
-
return array && array.length ? baseExtremum(array, identity, baseGt) : void 0;
|
|
21
|
-
}
|
|
22
|
-
var nativeCeil = Math.ceil, nativeMax = Math.max;
|
|
23
|
-
function baseRange(start, end, step, fromRight) {
|
|
24
|
-
var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
|
|
25
|
-
while (length--) {
|
|
26
|
-
result[++index] = start;
|
|
27
|
-
start += step;
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
function createRange(fromRight) {
|
|
32
|
-
return function(start, end, step) {
|
|
33
|
-
if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
|
|
34
|
-
end = step = void 0;
|
|
35
|
-
}
|
|
36
|
-
start = toFinite(start);
|
|
37
|
-
if (end === void 0) {
|
|
38
|
-
end = start;
|
|
39
|
-
start = 0;
|
|
40
|
-
} else {
|
|
41
|
-
end = toFinite(end);
|
|
42
|
-
}
|
|
43
|
-
step = step === void 0 ? start < end ? 1 : -1 : toFinite(step);
|
|
44
|
-
return baseRange(start, end, step);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
var range = createRange();
|
|
48
|
-
function sum(array) {
|
|
49
|
-
return array && array.length ? baseSum(array, identity) : 0;
|
|
50
|
-
}
|
|
51
|
-
const DEFAULT_OPTIONS = {
|
|
52
|
-
textColor: "white",
|
|
53
|
-
nodeColor: {
|
|
54
|
-
border: "grey",
|
|
55
|
-
center: "white"
|
|
56
|
-
},
|
|
57
|
-
letterSize: 10,
|
|
58
|
-
letterWidth: 6.5,
|
|
59
|
-
xSpacing: 8,
|
|
60
|
-
ySpacing: 20,
|
|
61
|
-
nodeRadius: 6,
|
|
62
|
-
maxArcRadius: 8,
|
|
63
|
-
linePaddingX: 10,
|
|
64
|
-
linePaddingY: 10,
|
|
65
|
-
lineWidth: 3,
|
|
66
|
-
enableEntryPadding: true,
|
|
67
|
-
truncateLabels: true,
|
|
68
|
-
enableTimestamps: true,
|
|
69
|
-
iconOrientation: "vertical",
|
|
70
|
-
lineDirection: "horizontal",
|
|
71
|
-
rowStep: null,
|
|
72
|
-
// We'll make this dynamic
|
|
73
|
-
belowPrevious: false
|
|
74
|
-
};
|
|
75
|
-
DEFAULT_OPTIONS.rowStep = DEFAULT_OPTIONS.ySpacing * 2;
|
|
76
|
-
const Tree = ({ svgRef, graph, labelKeys, onNodeSelectionChanged, zoom, options = {} }) => {
|
|
77
|
-
var _a, _b, _c;
|
|
78
|
-
const combinedOptions = useMemo(
|
|
79
|
-
() => {
|
|
80
|
-
var _a2, _b2;
|
|
81
|
-
return {
|
|
82
|
-
...DEFAULT_OPTIONS,
|
|
83
|
-
...options,
|
|
84
|
-
...((_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.visualization) == null ? void 0 : _b2.config) ?? {}
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
[(_b = (_a = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a.visualization) == null ? void 0 : _b.config, options]
|
|
88
|
-
);
|
|
89
|
-
const {
|
|
90
|
-
xSpacing: baseXSpacing,
|
|
91
|
-
ySpacing: baseYSpacing,
|
|
92
|
-
linePaddingX: baseLinePaddingX,
|
|
93
|
-
linePaddingY: baseLinePaddingY
|
|
94
|
-
} = combinedOptions;
|
|
95
|
-
const { runComparators, runComparator } = useComparator();
|
|
96
|
-
const { onNodeHoveredChanged, onNodeClicked, nodeOpacities, highlightedPath, highlightedNodes, hoveredNode } = useMyHighlights(graph, (nodeIds) => onNodeSelectionChanged(nodeIds));
|
|
97
|
-
const theme = useTheme();
|
|
98
|
-
const isDark = useMemo(() => theme.palette.mode === "dark", [theme]);
|
|
99
|
-
const [showCardsSettings] = useMyLocalStorageItem(StorageKey.SHOW_CARDS, false);
|
|
100
|
-
const [cardCutoff] = useMyLocalStorageItem(StorageKey.CARD_CUTOFF, 2.5);
|
|
101
|
-
const showCards = useMemo(() => zoom.k > cardCutoff && showCardsSettings, [cardCutoff, showCardsSettings, zoom.k]);
|
|
102
|
-
const levels = useMemo(
|
|
103
|
-
() => graph.data.map(
|
|
104
|
-
(level, levelIndex) => level.map((node) => ({
|
|
105
|
-
...node,
|
|
106
|
-
parents: node == null ? void 0 : node.edges,
|
|
107
|
-
level: levelIndex
|
|
108
|
-
}))
|
|
109
|
-
),
|
|
110
|
-
[graph.data]
|
|
111
|
-
);
|
|
112
|
-
const flatNodes = useMemo(() => levels.flat(), [levels]);
|
|
113
|
-
const [xSpacing, linePaddingX, ySpacing, linePaddingY] = useMemo(() => {
|
|
114
|
-
const baseValues = [
|
|
115
|
-
[baseXSpacing, baseLinePaddingX],
|
|
116
|
-
[baseYSpacing, baseLinePaddingY]
|
|
117
|
-
];
|
|
118
|
-
if (zoom.k > 1 && showCardsSettings) {
|
|
119
|
-
return baseValues.flatMap(
|
|
120
|
-
(arr, index) => arr.map((_v) => _v * Math.pow(2.5 - index * 1.25, Math.min(zoom.k, 2.5) - 1))
|
|
121
|
-
);
|
|
122
|
-
} else {
|
|
123
|
-
return baseValues.flat();
|
|
124
|
-
}
|
|
125
|
-
}, [baseLinePaddingX, baseLinePaddingY, baseXSpacing, baseYSpacing, showCardsSettings, zoom.k]);
|
|
126
|
-
let portBounds;
|
|
127
|
-
if (!graph || !svgRef.current) {
|
|
128
|
-
portBounds = [
|
|
129
|
-
[0, 0],
|
|
130
|
-
[0, 0]
|
|
131
|
-
];
|
|
132
|
-
} else {
|
|
133
|
-
const data = svgRef.current.getBoundingClientRect();
|
|
134
|
-
portBounds = [zoom.invert([0, 0]), zoom.invert([data.width, data.height])];
|
|
135
|
-
}
|
|
136
|
-
const bundles = useMemo(() => {
|
|
137
|
-
const bundlesDict = {};
|
|
138
|
-
flatNodes.forEach((node) => {
|
|
139
|
-
if (!node.parents) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const bundleId = node.parents.join(BUNDLE_SEPARATOR);
|
|
143
|
-
if (bundlesDict[bundleId]) {
|
|
144
|
-
bundlesDict[bundleId].destinations.push(node);
|
|
145
|
-
} else {
|
|
146
|
-
bundlesDict[bundleId] = {
|
|
147
|
-
id: bundleId,
|
|
148
|
-
sources: node.parents.map((parent) => flatNodes.find((_node) => _node.id === parent)),
|
|
149
|
-
destinations: [node]
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
return Object.values(bundlesDict);
|
|
154
|
-
}, [flatNodes]);
|
|
155
|
-
const layoutData = useMemo(() => {
|
|
156
|
-
const {
|
|
157
|
-
letterSize,
|
|
158
|
-
letterWidth,
|
|
159
|
-
enableEntryPadding,
|
|
160
|
-
truncateLabels,
|
|
161
|
-
rowStep,
|
|
162
|
-
belowPrevious
|
|
163
|
-
} = combinedOptions;
|
|
164
|
-
let currentX = 0;
|
|
165
|
-
let currentY = 0;
|
|
166
|
-
const nodeLocations = {};
|
|
167
|
-
const linesByLevel = {};
|
|
168
|
-
const paddingByLevel = {};
|
|
169
|
-
const inputs = {};
|
|
170
|
-
const outputs = {};
|
|
171
|
-
levels.forEach((level, levelIndex) => {
|
|
172
|
-
let longestLabel = 0;
|
|
173
|
-
level.forEach((node) => {
|
|
174
|
-
var _a2;
|
|
175
|
-
const validKeys = labelKeys == null ? void 0 : labelKeys.filter((_comparator) => runComparator(_comparator, node));
|
|
176
|
-
const labelKey = (_a2 = validKeys == null ? void 0 : validKeys.pop()) == null ? void 0 : _a2.label;
|
|
177
|
-
const labelRows = (labelKey == null ? void 0 : labelKey.split(",").map((key) => get(node, key)).filter((val) => !!val)) ?? [];
|
|
178
|
-
if (labelRows.length < 1) {
|
|
179
|
-
node.id.split("\n").forEach((line) => labelRows.push(line));
|
|
180
|
-
}
|
|
181
|
-
const labelHeight = labelRows.length * letterSize;
|
|
182
|
-
currentY += labelHeight;
|
|
183
|
-
nodeLocations[node.id] = [+currentX, +currentY, -linePaddingY];
|
|
184
|
-
currentY += ySpacing;
|
|
185
|
-
if (enableEntryPadding) {
|
|
186
|
-
longestLabel = Math.max(longestLabel, max((labelRows == null ? void 0 : labelRows.map((row) => row.toString().length)) ?? [node.id.length]));
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
currentX += xSpacing + (!truncateLabels ? longestLabel : Math.min(longestLabel, 44)) * letterWidth;
|
|
190
|
-
if (!belowPrevious) {
|
|
191
|
-
currentY = (levelIndex + 1) * rowStep;
|
|
192
|
-
} else {
|
|
193
|
-
currentY += rowStep;
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
bundles.forEach((bundle) => {
|
|
197
|
-
bundle.sources.forEach((source) => {
|
|
198
|
-
if (!outputs[source.id]) {
|
|
199
|
-
outputs[source.id] = /* @__PURE__ */ new Set();
|
|
200
|
-
}
|
|
201
|
-
outputs[source.id].add(bundle.id);
|
|
202
|
-
});
|
|
203
|
-
bundle.destinations.forEach((dest) => {
|
|
204
|
-
if (isNil(linesByLevel[dest.level])) {
|
|
205
|
-
linesByLevel[dest.level] = /* @__PURE__ */ new Set();
|
|
206
|
-
}
|
|
207
|
-
if (!inputs[dest.id]) {
|
|
208
|
-
inputs[dest.id] = /* @__PURE__ */ new Set();
|
|
209
|
-
}
|
|
210
|
-
linesByLevel[dest.level].add(bundle.id);
|
|
211
|
-
inputs[dest.id].add(bundle.id);
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
Object.entries(linesByLevel).forEach(([level, lines]) => paddingByLevel[level] = lines.size);
|
|
215
|
-
levels.forEach((level, levelIndex) => {
|
|
216
|
-
const indexesSoFar = range(levelIndex + 1);
|
|
217
|
-
const paddingArray = indexesSoFar.map((_levelIndex) => paddingByLevel[_levelIndex] ?? 0);
|
|
218
|
-
const totalPadding = sum(paddingArray) * linePaddingX;
|
|
219
|
-
level.forEach((node) => {
|
|
220
|
-
nodeLocations[node.id][0] += totalPadding;
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
flatNodes.forEach((node) => {
|
|
224
|
-
var _a2, _b2, _c2;
|
|
225
|
-
let maxHeight = max([((_a2 = inputs[node.id]) == null ? void 0 : _a2.size) - 1, ((_b2 = outputs[node.id]) == null ? void 0 : _b2.size) - 1, 0]) * linePaddingY;
|
|
226
|
-
if ((_c2 = inputs[node.id]) == null ? void 0 : _c2.has(node.id)) {
|
|
227
|
-
maxHeight += linePaddingY;
|
|
228
|
-
}
|
|
229
|
-
nodeLocations[node.id][2] = maxHeight;
|
|
230
|
-
const levelIndex = levels[node.level].findIndex((_node) => _node.id === node.id);
|
|
231
|
-
levels[node.level].filter((__, index) => levelIndex < index).forEach((_node) => {
|
|
232
|
-
nodeLocations[_node.id][1] += maxHeight;
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
return {
|
|
236
|
-
nodeLocations,
|
|
237
|
-
linesByLevel,
|
|
238
|
-
paddingByLevel
|
|
239
|
-
};
|
|
240
|
-
}, [
|
|
241
|
-
bundles,
|
|
242
|
-
combinedOptions,
|
|
243
|
-
flatNodes,
|
|
244
|
-
labelKeys,
|
|
245
|
-
levels,
|
|
246
|
-
linePaddingX,
|
|
247
|
-
linePaddingY,
|
|
248
|
-
runComparator,
|
|
249
|
-
xSpacing,
|
|
250
|
-
ySpacing
|
|
251
|
-
]);
|
|
252
|
-
const [timestamps, bundleElements, nodes] = useMemo(() => {
|
|
253
|
-
const {
|
|
254
|
-
textColor,
|
|
255
|
-
letterSize,
|
|
256
|
-
letterWidth,
|
|
257
|
-
nodeRadius,
|
|
258
|
-
nodeColor,
|
|
259
|
-
maxArcRadius,
|
|
260
|
-
lineWidth,
|
|
261
|
-
truncateLabels,
|
|
262
|
-
enableTimestamps,
|
|
263
|
-
belowPrevious,
|
|
264
|
-
iconOrientation,
|
|
265
|
-
lineDirection,
|
|
266
|
-
colorTheme
|
|
267
|
-
} = combinedOptions;
|
|
268
|
-
const { nodeLocations, linesByLevel, paddingByLevel } = layoutData;
|
|
269
|
-
const _nodes = [];
|
|
270
|
-
const _timestamps = [];
|
|
271
|
-
flatNodes.forEach((node) => {
|
|
272
|
-
var _a2, _b2, _c2, _d;
|
|
273
|
-
const [x, y, _height] = nodeLocations[node.id];
|
|
274
|
-
const labelKey = ((_a2 = labelKeys == null ? void 0 : labelKeys.filter((_comparator) => runComparator(_comparator, node)).pop()) == null ? void 0 : _a2.label) ?? "id";
|
|
275
|
-
let label = labelKey == null ? void 0 : labelKey.split(",").map((key) => {
|
|
276
|
-
let labelSection = get(node, key);
|
|
277
|
-
if (labelSection && truncateLabels && labelSection.length > 44) {
|
|
278
|
-
labelSection = labelSection.replace(/^(.{32}).+$/, "$1 (TRUNCATED)");
|
|
279
|
-
}
|
|
280
|
-
return labelSection;
|
|
281
|
-
}).filter((section) => !!section).join("\n");
|
|
282
|
-
if (!label) {
|
|
283
|
-
if (node.id.length > 44) {
|
|
284
|
-
label = node.id.replace(/^(.{32}).+$/, "$1 (TRUNCATED)");
|
|
285
|
-
} else {
|
|
286
|
-
label = node.id;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
if (belowPrevious && enableTimestamps && (node.timestamp || node.annotation)) {
|
|
290
|
-
_timestamps.push(
|
|
291
|
-
/* @__PURE__ */ jsxs(
|
|
292
|
-
"g",
|
|
293
|
-
{
|
|
294
|
-
style: {
|
|
295
|
-
cursor: "default",
|
|
296
|
-
fontFamily: '"Lucida Console", monospace',
|
|
297
|
-
fontSize: letterSize * 0.75 + "px"
|
|
298
|
-
},
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ jsx(
|
|
301
|
-
"text",
|
|
302
|
-
{
|
|
303
|
-
x: portBounds[0][0] + xSpacing,
|
|
304
|
-
y: y + (_height + nodeRadius) / 2,
|
|
305
|
-
fill: theme.palette.getContrastText(theme.palette.background.paper),
|
|
306
|
-
style: {
|
|
307
|
-
fillOpacity: nodeOpacities(node.id) / 2,
|
|
308
|
-
transition: theme.transitions.create(["fill-opacity"], {
|
|
309
|
-
duration: theme.transitions.duration.short
|
|
310
|
-
})
|
|
311
|
-
},
|
|
312
|
-
children: node.timestamp
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
node.annotation && node.annotation.split("\n").map((line, index) => {
|
|
316
|
-
var _a3;
|
|
317
|
-
return /* @__PURE__ */ jsx(
|
|
318
|
-
"text",
|
|
319
|
-
{
|
|
320
|
-
x: portBounds[0][0] + (((_a3 = node.timestamp) == null ? void 0 : _a3.length) ?? 0) * letterWidth,
|
|
321
|
-
y: y + (_height + nodeRadius) / 2 + index * letterSize,
|
|
322
|
-
fill: isDark ? colors.orange[300] : colors.blue[900],
|
|
323
|
-
style: {
|
|
324
|
-
fillOpacity: nodeOpacities(node.id),
|
|
325
|
-
transition: theme.transitions.create(["fill-opacity"], {
|
|
326
|
-
duration: theme.transitions.duration.short
|
|
327
|
-
})
|
|
328
|
-
},
|
|
329
|
-
children: line
|
|
330
|
-
},
|
|
331
|
-
line
|
|
332
|
-
);
|
|
333
|
-
})
|
|
334
|
-
]
|
|
335
|
-
},
|
|
336
|
-
node.id + "-timestamp"
|
|
337
|
-
)
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
if (!showCards) {
|
|
341
|
-
const style = runComparators(
|
|
342
|
-
(_c2 = (_b2 = graph.metadata.display) == null ? void 0 : _b2.styles) == null ? void 0 : _c2.filter((comparator) => comparator.type === "node"),
|
|
343
|
-
node
|
|
344
|
-
);
|
|
345
|
-
const nodeOpacity = nodeOpacities(node.id);
|
|
346
|
-
const icons = (_d = node.icons) == null ? void 0 : _d.map((icon) => [icon, getIcon(icon)]).filter(([__, icon]) => !!icon).map(([icon, Icon], index) => /* @__PURE__ */ jsx(
|
|
347
|
-
Icon,
|
|
348
|
-
{
|
|
349
|
-
x: x - nodeRadius * 3 * (iconOrientation === "horizontal" ? index + 1 : 0),
|
|
350
|
-
y: y - nodeRadius * 3 * (iconOrientation === "vertical" ? index + 1 : 0),
|
|
351
|
-
size: letterSize * 1.5,
|
|
352
|
-
style: {
|
|
353
|
-
fillOpacity: nodeOpacity
|
|
354
|
-
},
|
|
355
|
-
circleStyle: {
|
|
356
|
-
fillOpacity: nodeOpacity
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
icon
|
|
360
|
-
));
|
|
361
|
-
_nodes.push(
|
|
362
|
-
/* @__PURE__ */ jsx(
|
|
363
|
-
Leaf,
|
|
364
|
-
{
|
|
365
|
-
alwaysShowText: true,
|
|
366
|
-
nodeId: node.id,
|
|
367
|
-
label,
|
|
368
|
-
height: _height,
|
|
369
|
-
x,
|
|
370
|
-
y,
|
|
371
|
-
style,
|
|
372
|
-
nodeRadius,
|
|
373
|
-
nodeColor,
|
|
374
|
-
nodeOpacity,
|
|
375
|
-
letterSize,
|
|
376
|
-
letterWidth,
|
|
377
|
-
textColor,
|
|
378
|
-
selected: highlightedNodes.has(node.id),
|
|
379
|
-
onHoverChanged: onNodeHoveredChanged,
|
|
380
|
-
onClick: onNodeClicked,
|
|
381
|
-
children: icons
|
|
382
|
-
},
|
|
383
|
-
node.id
|
|
384
|
-
)
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
const readonlyNodeLocations = cloneDeep(nodeLocations);
|
|
389
|
-
const outputsByNode = {};
|
|
390
|
-
const inputsByNode = {};
|
|
391
|
-
const _bundleElements = bundles.map((bundle) => {
|
|
392
|
-
return /* @__PURE__ */ jsx(
|
|
393
|
-
BundleLine,
|
|
394
|
-
{
|
|
395
|
-
lineDirection,
|
|
396
|
-
linesByLevel,
|
|
397
|
-
paddingByLevel,
|
|
398
|
-
nodeLocations: readonlyNodeLocations,
|
|
399
|
-
outputsByNode,
|
|
400
|
-
inputsByNode,
|
|
401
|
-
bundle,
|
|
402
|
-
maxArcRadius,
|
|
403
|
-
lineWidth,
|
|
404
|
-
linePaddingX,
|
|
405
|
-
linePaddingY,
|
|
406
|
-
highlightedPath,
|
|
407
|
-
colorTheme
|
|
408
|
-
},
|
|
409
|
-
bundle.id
|
|
410
|
-
);
|
|
411
|
-
});
|
|
412
|
-
return [_timestamps, _bundleElements, _nodes];
|
|
413
|
-
}, [
|
|
414
|
-
bundles,
|
|
415
|
-
combinedOptions,
|
|
416
|
-
(_c = graph.metadata.display) == null ? void 0 : _c.styles,
|
|
417
|
-
flatNodes,
|
|
418
|
-
highlightedNodes,
|
|
419
|
-
highlightedPath,
|
|
420
|
-
isDark,
|
|
421
|
-
labelKeys,
|
|
422
|
-
layoutData,
|
|
423
|
-
linePaddingX,
|
|
424
|
-
linePaddingY,
|
|
425
|
-
nodeOpacities,
|
|
426
|
-
onNodeClicked,
|
|
427
|
-
onNodeHoveredChanged,
|
|
428
|
-
portBounds,
|
|
429
|
-
runComparator,
|
|
430
|
-
runComparators,
|
|
431
|
-
showCards,
|
|
432
|
-
theme.palette,
|
|
433
|
-
theme.transitions,
|
|
434
|
-
xSpacing
|
|
435
|
-
]);
|
|
436
|
-
const cards = useMemo(() => {
|
|
437
|
-
const { nodeRadius, lineWidth } = combinedOptions;
|
|
438
|
-
const { nodeLocations } = layoutData;
|
|
439
|
-
return flatNodes.filter((node) => showCards || hoveredNode === node.id).map((node) => {
|
|
440
|
-
const [x, y] = nodeLocations[node.id];
|
|
441
|
-
return /* @__PURE__ */ jsx(
|
|
442
|
-
Box,
|
|
443
|
-
{
|
|
444
|
-
onMouseOver: () => onNodeHoveredChanged(node.id, true),
|
|
445
|
-
onMouseLeave: () => setTimeout(() => onNodeHoveredChanged(node.id, false), 100),
|
|
446
|
-
sx: {
|
|
447
|
-
position: "absolute",
|
|
448
|
-
left: zoom.k * x + zoom.x,
|
|
449
|
-
top: zoom.k * y + zoom.y,
|
|
450
|
-
transform: `translateX(-${nodeRadius * 2}px) translateY(${lineWidth}px)`,
|
|
451
|
-
backgroundColor: theme.palette.background.paper,
|
|
452
|
-
maxWidth: "450px",
|
|
453
|
-
maxHeight: "500px",
|
|
454
|
-
overflow: "auto"
|
|
455
|
-
},
|
|
456
|
-
children: /* @__PURE__ */ jsx(NodeCard, { node })
|
|
457
|
-
},
|
|
458
|
-
node.id
|
|
459
|
-
);
|
|
460
|
-
});
|
|
461
|
-
}, [
|
|
462
|
-
combinedOptions,
|
|
463
|
-
flatNodes,
|
|
464
|
-
hoveredNode,
|
|
465
|
-
layoutData,
|
|
466
|
-
onNodeHoveredChanged,
|
|
467
|
-
showCards,
|
|
468
|
-
theme.palette.background.paper,
|
|
469
|
-
zoom.k,
|
|
470
|
-
zoom.x,
|
|
471
|
-
zoom.y
|
|
472
|
-
]);
|
|
473
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
474
|
-
/* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, children: /* @__PURE__ */ jsxs("g", { id: "view", children: [
|
|
475
|
-
timestamps,
|
|
476
|
-
bundleElements,
|
|
477
|
-
nodes
|
|
478
|
-
] }) }),
|
|
479
|
-
cards
|
|
480
|
-
] });
|
|
481
|
-
};
|
|
482
|
-
const Tree$1 = memo(Tree);
|
|
483
|
-
export {
|
|
484
|
-
Tree$1 as default
|
|
485
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|