@cccsaurora/clue-ui 1.2.4-patch.275 → 1.2.5-dev.298
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/ActionForm-D6gYuFRR.js +5970 -0
- package/AnnotationDetails-Zx4pjBiN.js +175 -0
- package/AnnotationPreview-Dmz7taAU.js +188 -0
- package/ClueEnrichContext-CJEJxrgs.js +541 -0
- package/FlexOne-BSYAhhtG.js +9 -0
- package/_MapCache-WmuDdwuH.js +222 -0
- package/_Uint8Array-B7JqpgFX.js +128 -0
- package/_baseAssignValue-CGTuELqU.js +25 -0
- package/_baseClone-CkNrTyhm.js +283 -0
- package/_baseExtremum-kob8QXyt.js +18 -0
- package/_baseFlatten-jIR_sN_-.js +92 -0
- package/_baseGet-Bx3A4Qfp.js +108 -0
- package/_baseIsEqual-C5OTWzTk.js +208 -0
- package/_baseIteratee-avi7MX2o.js +126 -0
- package/_baseSlice-GAv_YFTT.js +20 -0
- package/_baseSum-D0WC1dN0.js +13 -0
- package/_baseUniq-BI9GIHMF.js +115 -0
- package/_commonjsHelpers-DWwsNxpa.js +8 -0
- package/_createAggregator-QD8MzKwe.js +63 -0
- package/_getPrototype-CU0j_POw.js +5 -0
- package/_getTag-Ckxxfr88.js +126 -0
- package/_isIterateeCall-Ds3sw2SF.js +17 -0
- package/_setToArray-CaPKQhcz.js +33 -0
- package/cloneDeep-DJrLSw8W.js +8 -0
- package/components/AnnotationBody.js +49 -35
- package/components/AnnotationDetailPopover.js +36 -30
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +44 -23
- package/components/CountBadge.js +31 -26
- package/components/EnrichedCard.js +110 -97
- package/components/EnrichedChip.js +130 -105
- package/components/EnrichedTypography.js +133 -107
- package/components/ErrorBoundary.js +28 -24
- package/components/RetryFailedEnrichments.js +10 -9
- package/components/SourcePicker.js +57 -49
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +75 -59
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +39 -23
- package/components/actions/formats/FileResult.js +86 -59
- package/components/actions/formats/index.js +21 -10
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +111 -91
- package/components/display/graph/elements/NodeTag.js +15 -13
- package/components/display/graph/index.js +261 -202
- package/components/display/graph/visualizations/Leaf.js +88 -69
- package/components/display/graph/visualizations/cloud/index.js +98 -81
- package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +14 -13
- package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
- package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +408 -306
- package/components/display/icons/Iconified.js +27 -12
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +8678 -5770
- package/components/enrichment/EnrichPopover.js +54 -46
- package/components/fetchers/Fetcher.js +158 -119
- package/components/fetchers/PreviewModal.js +20 -17
- package/components/fetchers/StatusChip.js +21 -17
- package/components/group/Entry.js +13 -11
- package/components/group/Group.js +13 -10
- package/components/group/GroupControl.js +76 -65
- package/components/stats/QueryStatus.js +43 -33
- package/countBy-c6S3dvSW.js +14 -0
- package/data/event.js +6 -4
- package/database/index.js +2 -2
- package/debounce-bV0h5FC5.js +92 -0
- package/get-DSsNkRQs.js +8 -0
- package/groupBy-xqz-n0Vd.js +14 -0
- package/hooks/ClueActionContext.d.ts +10 -2
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +29 -23
- package/hooks/ClueConfigProvider.js +14 -12
- package/hooks/ClueDatabaseContext.js +19 -13
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +83 -56
- package/hooks/ClueGroupContext.js +17 -14
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +12 -10
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.d.ts +1 -0
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +47 -31
- package/hooks/useClue.js +6 -4
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +6 -4
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +722 -435
- package/hooks/useErrors.js +22 -18
- package/hooks/useFetcherResult.d.ts +1 -0
- package/hooks/useFetcherResult.js +33 -24
- package/hooks/useMyHighlights.js +66 -36
- package/hooks/useMyLocalStorage.js +66 -37
- package/iconify-CXMreGTg.js +1782 -0
- package/icons/Action.js +66 -49
- package/icons/Assessment.js +85 -69
- package/icons/Context.js +77 -63
- package/icons/Opinion.js +76 -60
- package/icons/iconMap.js +2 -2
- package/identity-CPGTqrE4.js +6 -0
- package/index-AMfoEg_6.js +696 -0
- package/index-B6C2a_Lg.js +1172 -0
- package/index-C12gPw2W.js +17698 -0
- package/index-DCKkHTvx.js +15750 -0
- package/index-JcKyZeoY.js +465 -0
- package/isNil-CIubwp4T.js +6 -0
- package/isObject-FTY-5JQX.js +7 -0
- package/isObjectLike-OAgjjZye.js +48 -0
- package/isSymbol-Xd2FsJyp.js +8 -0
- package/last-CUCl67Im.js +7 -0
- package/main.js +60 -60
- package/maxBy-IKHzFrCS.js +8 -0
- package/package.json +1 -1
- package/sortBy-DfSj8IoJ.js +96 -0
- package/sumBy-D-hb_NY-.js +8 -0
- package/text/Frequency.js +42 -23
- package/toFinite-Bc55msYj.js +16 -0
- package/toNumber-DPxy1FBy.js +39 -0
- package/types/RunningActionData.d.ts +1 -0
- package/types/WithActionData.d.ts +1 -0
- package/useClueTypeConfig-Z1LFp01b.js +3289 -0
- package/utils/chain.js +92 -65
- package/utils/classificationParser.js +519 -256
- package/utils/constants.js +35 -10
- package/utils/graph.js +72 -45
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +131 -81
- package/utils/loggerUtil.js +5 -3
- package/utils/sessionStorage.js +41 -27
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +21 -10
- package/utils-HmNPuoDB.js +199 -0
- package/ActionForm-CwsfB99X.js +0 -4458
- package/AnnotationDetails-Bw2JdtTL.js +0 -160
- package/AnnotationPreview-BO7rVnOP.js +0 -140
- package/ClueEnrichContext-KqRuuWNS.js +0 -418
- package/FlexOne-BXWFOd1T.js +0 -6
- package/_MapCache-BiTi0iqu.js +0 -180
- package/_Uint8Array-BQNOM9Rr.js +0 -101
- package/_baseAssignValue-CNMLQZco.js +0 -20
- package/_baseClone-BnT-6pyM.js +0 -207
- package/_baseExtremum-Ca2EHgy2.js +0 -16
- package/_baseFlatten-Bfr_Molw.js +0 -72
- package/_baseGet-DSZygzyq.js +0 -79
- package/_baseIsEqual-VgvaAFZG.js +0 -147
- package/_baseIteratee-Dbfsw5z8.js +0 -95
- package/_baseSlice-M5RKzt1A.js +0 -10
- package/_baseSum-wEbgNeUs.js +0 -10
- package/_baseUniq-BJcj69PL.js +0 -79
- package/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/_createAggregator-k3TuAnxT.js +0 -53
- package/_getPrototype-Cr1Mk7BC.js +0 -5
- package/_getTag-CK2Sffaq.js +0 -90
- package/_isIterateeCall-DkJP7Rbx.js +0 -13
- package/_setToArray-C7yMOeww.js +0 -29
- package/cloneDeep-CF8TtLHr.js +0 -8
- package/countBy-CdYegFSu.js +0 -8
- package/debounce-DryYcbJ4.js +0 -56
- package/get-CH7kz5Ix.js +0 -8
- package/groupBy-br8xmD2R.js +0 -8
- package/iconify-BBckr5AQ.js +0 -1263
- package/identity-ByMq8VxU.js +0 -6
- package/index-BHAe_V9n.js +0 -12768
- package/index-BK-zfYhR.js +0 -358
- package/index-CA5CUNZO.js +0 -975
- package/index-Dj5C04IX.js +0 -568
- package/index-p5_wX7q1.js +0 -11729
- package/isNil-CjWwlQS3.js +0 -6
- package/isObject-B53jY8Qg.js +0 -7
- package/isObjectLike-BatpeCIi.js +0 -29
- package/isSymbol-C3_SC0Qp.js +0 -8
- package/last-7CdUxN0r.js +0 -7
- package/maxBy-Bc0dYHcO.js +0 -8
- package/sortBy-DY2JBf9n.js +0 -75
- package/sumBy-DuMASLPd.js +0 -8
- package/toFinite-BMy6GObD.js +0 -14
- package/toNumber-YVhnnJv4.js +0 -31
- package/useClueTypeConfig-Ct9Ygter.js +0 -2292
- package/utils-DmwSUrum.js +0 -129
|
@@ -1,106 +1,125 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { i as
|
|
3
|
-
import { useState
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
return typeof
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { i as isObjectLike, b as baseGetTag } from "../../../../isObjectLike-OAgjjZye.js";
|
|
3
|
+
import { useState, useMemo, useCallback, useEffect } from "react";
|
|
4
|
+
var numberTag = "[object Number]";
|
|
5
|
+
function isNumber(value) {
|
|
6
|
+
return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
const DEFAULT_NODE_RADIUS = 10;
|
|
9
|
+
const Leaf = ({
|
|
10
|
+
nodeId,
|
|
11
|
+
label = nodeId,
|
|
12
|
+
x,
|
|
13
|
+
y,
|
|
14
|
+
height,
|
|
15
|
+
nodeRadius = DEFAULT_NODE_RADIUS,
|
|
16
|
+
nodeColor,
|
|
17
|
+
nodeOpacity = 1,
|
|
18
|
+
letterSize,
|
|
19
|
+
letterWidth,
|
|
20
|
+
textColor,
|
|
21
|
+
style = {},
|
|
22
|
+
selected = false,
|
|
23
|
+
alwaysShowText = false,
|
|
24
|
+
onHoverChanged,
|
|
25
|
+
onClick,
|
|
26
|
+
children
|
|
26
27
|
}) => {
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(
|
|
32
|
-
|
|
28
|
+
const [isSelected, setIsSelected] = useState(selected);
|
|
29
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
30
|
+
const classNames = useMemo(() => {
|
|
31
|
+
const _classNames = ["node"];
|
|
32
|
+
if (isHovered) {
|
|
33
|
+
_classNames.push("hover");
|
|
34
|
+
}
|
|
35
|
+
if (isSelected) {
|
|
36
|
+
_classNames.push("selected");
|
|
37
|
+
}
|
|
38
|
+
return _classNames;
|
|
39
|
+
}, [isHovered, isSelected]);
|
|
40
|
+
const handleOnClick = useCallback(
|
|
41
|
+
(event) => {
|
|
42
|
+
onClick == null ? void 0 : onClick(nodeId, !isSelected, event);
|
|
43
|
+
setIsSelected(!isSelected);
|
|
33
44
|
},
|
|
34
|
-
[
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
[nodeId, onClick, isSelected]
|
|
46
|
+
);
|
|
47
|
+
const handleOnHoverChanged = useCallback(
|
|
48
|
+
(value) => {
|
|
49
|
+
setIsHovered(value);
|
|
50
|
+
onHoverChanged == null ? void 0 : onHoverChanged(nodeId, value);
|
|
38
51
|
},
|
|
39
|
-
[
|
|
52
|
+
[nodeId, onHoverChanged]
|
|
40
53
|
);
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
54
|
+
useEffect(() => setIsSelected(selected), [selected]);
|
|
55
|
+
let strokeWidth = `${nodeRadius}px`;
|
|
56
|
+
if (style.strokeWidth) {
|
|
57
|
+
if (isNumber(style.strokeWidth)) {
|
|
58
|
+
strokeWidth = `${nodeRadius * style.strokeWidth}px`;
|
|
59
|
+
} else {
|
|
60
|
+
strokeWidth = style.strokeWidth;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
44
64
|
"g",
|
|
45
65
|
{
|
|
46
|
-
id: "node-" +
|
|
66
|
+
id: "node-" + nodeId.replace(/[^A-Za-z0-9]*/g, ""),
|
|
47
67
|
style: { strokeLinecap: "round" },
|
|
48
|
-
className:
|
|
49
|
-
onClick:
|
|
50
|
-
onMouseOver: () =>
|
|
51
|
-
onMouseLeave: () =>
|
|
68
|
+
className: classNames.join(" "),
|
|
69
|
+
onClick: handleOnClick,
|
|
70
|
+
onMouseOver: () => handleOnHoverChanged(true),
|
|
71
|
+
onMouseLeave: () => handleOnHoverChanged(false),
|
|
52
72
|
children: [
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */
|
|
73
|
+
children,
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
55
75
|
"path",
|
|
56
76
|
{
|
|
57
77
|
className: "border",
|
|
58
|
-
d: `M ${
|
|
78
|
+
d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
|
|
59
79
|
style: {
|
|
60
|
-
strokeOpacity:
|
|
61
|
-
...
|
|
62
|
-
strokeWidth: `calc(${
|
|
63
|
-
stroke:
|
|
80
|
+
strokeOpacity: nodeOpacity,
|
|
81
|
+
...style,
|
|
82
|
+
strokeWidth: `calc(${strokeWidth} * 2)`,
|
|
83
|
+
stroke: style.stroke ?? nodeColor.border
|
|
64
84
|
}
|
|
65
85
|
},
|
|
66
|
-
|
|
86
|
+
nodeId + "-border"
|
|
67
87
|
),
|
|
68
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
69
89
|
"path",
|
|
70
90
|
{
|
|
71
91
|
className: "center",
|
|
72
|
-
d: `M ${
|
|
92
|
+
d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
|
|
73
93
|
style: {
|
|
74
|
-
strokeOpacity:
|
|
75
|
-
...
|
|
76
|
-
strokeWidth
|
|
77
|
-
stroke:
|
|
94
|
+
strokeOpacity: nodeOpacity,
|
|
95
|
+
...style,
|
|
96
|
+
strokeWidth,
|
|
97
|
+
stroke: style.fill ?? nodeColor.center
|
|
78
98
|
}
|
|
79
99
|
},
|
|
80
|
-
|
|
100
|
+
nodeId + "-middle"
|
|
81
101
|
),
|
|
82
|
-
(
|
|
83
|
-
`).reverse().map((e, T, F) => /* @__PURE__ */ b(
|
|
102
|
+
(isHovered || alwaysShowText) && label.split("\n").reverse().map((_label, index, arr) => /* @__PURE__ */ jsx(
|
|
84
103
|
"text",
|
|
85
104
|
{
|
|
86
|
-
x:
|
|
87
|
-
y:
|
|
88
|
-
fill:
|
|
105
|
+
x: x + letterWidth,
|
|
106
|
+
y: y - letterSize / 2 + arr.length - index * letterSize,
|
|
107
|
+
fill: textColor,
|
|
89
108
|
style: {
|
|
90
109
|
cursor: "default",
|
|
91
110
|
fontFamily: '"Lucida Console", monospace',
|
|
92
|
-
fontSize:
|
|
93
|
-
fillOpacity:
|
|
111
|
+
fontSize: letterSize + "px",
|
|
112
|
+
fillOpacity: nodeOpacity
|
|
94
113
|
},
|
|
95
|
-
children:
|
|
114
|
+
children: _label
|
|
96
115
|
},
|
|
97
|
-
|
|
116
|
+
nodeId + "-label-" + _label
|
|
98
117
|
))
|
|
99
118
|
]
|
|
100
119
|
},
|
|
101
|
-
|
|
120
|
+
nodeId
|
|
102
121
|
);
|
|
103
122
|
};
|
|
104
123
|
export {
|
|
105
|
-
|
|
124
|
+
Leaf as default
|
|
106
125
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { o as
|
|
3
|
-
import
|
|
4
|
-
import { useMyLocalStorageItem
|
|
5
|
-
import { StorageKey
|
|
6
|
-
import { cyrb53
|
|
7
|
-
import { c as
|
|
8
|
-
import { s as
|
|
9
|
-
import { memo
|
|
10
|
-
import
|
|
11
|
-
const
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { o as ordinal, d as d3, S as Spectral, a as index, h as hierarchy } from "../../../../../index-DCKkHTvx.js";
|
|
3
|
+
import useMyHighlights from "../../../../../hooks/useMyHighlights.js";
|
|
4
|
+
import { useMyLocalStorageItem } from "../../../../../hooks/useMyLocalStorage.js";
|
|
5
|
+
import { StorageKey } from "../../../../../utils/constants.js";
|
|
6
|
+
import { cyrb53 } from "../../../../../utils/graph.js";
|
|
7
|
+
import { c as countBy } from "../../../../../countBy-c6S3dvSW.js";
|
|
8
|
+
import { s as sumBy } from "../../../../../sumBy-D-hb_NY-.js";
|
|
9
|
+
import { memo, useRef, useMemo, useCallback } from "react";
|
|
10
|
+
import Leaf from "../Leaf.js";
|
|
11
|
+
const DEFAULT_OPTIONS = {
|
|
12
12
|
width: "100%",
|
|
13
13
|
backgroundColor: "grey",
|
|
14
14
|
textColor: "black",
|
|
@@ -23,102 +23,119 @@ const u = {
|
|
|
23
23
|
circlePadding: null
|
|
24
24
|
// We'll make this dynamic
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
const
|
|
26
|
+
DEFAULT_OPTIONS.circlePadding = 3 * DEFAULT_OPTIONS.nodeRadius;
|
|
27
|
+
const Cloud = ({ svgRef, graph, options = {} }) => {
|
|
28
28
|
const {
|
|
29
|
-
width
|
|
30
|
-
backgroundColor
|
|
31
|
-
textColor
|
|
32
|
-
letterSize
|
|
33
|
-
letterWidth
|
|
34
|
-
circlePadding
|
|
35
|
-
nodeRadius
|
|
36
|
-
nodeColor
|
|
37
|
-
lineWidth
|
|
29
|
+
width,
|
|
30
|
+
backgroundColor,
|
|
31
|
+
textColor,
|
|
32
|
+
letterSize,
|
|
33
|
+
letterWidth,
|
|
34
|
+
circlePadding,
|
|
35
|
+
nodeRadius,
|
|
36
|
+
nodeColor,
|
|
37
|
+
lineWidth
|
|
38
38
|
} = {
|
|
39
|
-
...
|
|
40
|
-
...
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
...DEFAULT_OPTIONS,
|
|
40
|
+
...options
|
|
41
|
+
};
|
|
42
|
+
const { onNodeHoveredChanged, onNodeClicked, nodeOpacities, highlightedPath } = useMyHighlights(graph);
|
|
43
|
+
const [colorScheme] = useMyLocalStorageItem(StorageKey.COLOR_SCHEME, "Spectral");
|
|
44
|
+
const currentX = useRef(2 * nodeRadius);
|
|
45
|
+
const currentY = useRef(letterSize + nodeRadius);
|
|
46
|
+
const nodeLocations = useRef({});
|
|
47
|
+
const nodes = useMemo(
|
|
48
|
+
() => graph.data.flatMap(
|
|
49
|
+
(cloud, cloudIndex) => cloud.map((node) => ({
|
|
50
|
+
...node,
|
|
51
|
+
cloud: cloudIndex.toString()
|
|
46
52
|
}))
|
|
47
53
|
),
|
|
48
|
-
[
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
[graph.data]
|
|
55
|
+
);
|
|
56
|
+
const clouds = useMemo(() => countBy(nodes, (node) => node.cloud), [nodes]);
|
|
57
|
+
const colors = useMemo(
|
|
58
|
+
() => ordinal(
|
|
59
|
+
Object.keys(clouds).map((cloud) => (d3[`interpolate${colorScheme}`] ?? Spectral)(cyrb53(cloud)))
|
|
52
60
|
),
|
|
53
|
-
[
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
[clouds, colorScheme]
|
|
62
|
+
);
|
|
63
|
+
const links = useMemo(
|
|
64
|
+
() => nodes.flatMap(
|
|
65
|
+
(node) => ((node == null ? void 0 : node.edges) ?? []).map((parent) => ({
|
|
66
|
+
source: node.id,
|
|
67
|
+
target: parent
|
|
59
68
|
}))
|
|
60
69
|
),
|
|
61
|
-
[
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
[nodes]
|
|
71
|
+
);
|
|
72
|
+
const pack = useMemo(() => index().size([600, 600]).padding(circlePadding), [circlePadding]);
|
|
73
|
+
const cloudLocations = useMemo(() => {
|
|
74
|
+
const data = Object.entries(clouds).map(([id]) => ({
|
|
75
|
+
id,
|
|
76
|
+
children: nodes.filter((node) => node.cloud === id).map((node) => ({
|
|
77
|
+
...node,
|
|
67
78
|
value: 1
|
|
68
79
|
}))
|
|
69
80
|
}));
|
|
70
|
-
return
|
|
71
|
-
|
|
81
|
+
return pack(
|
|
82
|
+
hierarchy({ children: data }).sum((d) => d.children ? sumBy(d.children, (c) => c.value) : d.value)
|
|
72
83
|
).children;
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
}, [clouds, nodes, pack]);
|
|
85
|
+
const opacities = useCallback(
|
|
86
|
+
(link) => highlightedPath.size === 0 || highlightedPath.has(link.source) && highlightedPath.has(link.target) ? 1 : 0.2,
|
|
87
|
+
[highlightedPath]
|
|
76
88
|
);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
currentX.current = 2 * nodeRadius;
|
|
90
|
+
currentY.current = letterSize + nodeRadius;
|
|
91
|
+
nodeLocations.current = {};
|
|
92
|
+
return /* @__PURE__ */ jsx("svg", { id: "viz", ref: svgRef, width, height: 600, style: { backgroundColor }, children: /* @__PURE__ */ jsxs("g", { id: "view", children: [
|
|
93
|
+
cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsx("circle", { cx: cloud.x, cy: cloud.y, r: cloud.r, strokeWidth: 4, stroke: colors(cloud.data.id), fill: "none" }) }, cloud.data.id)),
|
|
94
|
+
links.map((link) => {
|
|
95
|
+
const source = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.source);
|
|
96
|
+
const target = cloudLocations.flatMap((c) => c.children).find((node) => node.data.id === link.target);
|
|
97
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
83
99
|
"path",
|
|
84
100
|
{
|
|
85
|
-
d: `M ${
|
|
101
|
+
d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
|
|
86
102
|
stroke: "black",
|
|
87
|
-
strokeWidth:
|
|
88
|
-
strokeOpacity:
|
|
103
|
+
strokeWidth: lineWidth + 3,
|
|
104
|
+
strokeOpacity: opacities(link)
|
|
89
105
|
}
|
|
90
106
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
92
108
|
"path",
|
|
93
109
|
{
|
|
94
|
-
d: `M ${
|
|
110
|
+
d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
|
|
95
111
|
stroke: "white",
|
|
96
|
-
strokeWidth:
|
|
97
|
-
strokeOpacity:
|
|
112
|
+
strokeWidth: lineWidth,
|
|
113
|
+
strokeOpacity: opacities(link)
|
|
98
114
|
}
|
|
99
115
|
)
|
|
100
|
-
] },
|
|
116
|
+
] }, source.data.id + target.data.id);
|
|
101
117
|
}),
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: cloud.children.map((node) => /* @__PURE__ */ jsx(
|
|
119
|
+
Leaf,
|
|
104
120
|
{
|
|
105
|
-
nodeId:
|
|
121
|
+
nodeId: node.data.id,
|
|
106
122
|
height: 0,
|
|
107
|
-
x:
|
|
108
|
-
y:
|
|
109
|
-
nodeRadius
|
|
110
|
-
nodeColor
|
|
111
|
-
nodeOpacity:
|
|
112
|
-
letterSize
|
|
113
|
-
letterWidth
|
|
114
|
-
textColor
|
|
115
|
-
onHoverChanged:
|
|
116
|
-
onClick:
|
|
123
|
+
x: node.x,
|
|
124
|
+
y: node.y,
|
|
125
|
+
nodeRadius,
|
|
126
|
+
nodeColor,
|
|
127
|
+
nodeOpacity: nodeOpacities(node.data.id),
|
|
128
|
+
letterSize,
|
|
129
|
+
letterWidth,
|
|
130
|
+
textColor,
|
|
131
|
+
onHoverChanged: onNodeHoveredChanged,
|
|
132
|
+
onClick: onNodeClicked
|
|
117
133
|
},
|
|
118
|
-
|
|
119
|
-
)) },
|
|
134
|
+
node.data.id
|
|
135
|
+
)) }, cloud.id))
|
|
120
136
|
] }) });
|
|
121
|
-
}
|
|
137
|
+
};
|
|
138
|
+
const Cloud$1 = memo(Cloud);
|
|
122
139
|
export {
|
|
123
|
-
|
|
140
|
+
Cloud$1 as default
|
|
124
141
|
};
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { useMemo
|
|
3
|
-
const
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
const DEFAULTS = {
|
|
4
4
|
size: 20
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
};
|
|
6
|
+
const BaseIcon = (props) => {
|
|
7
|
+
const { width, height, size } = {
|
|
8
|
+
...DEFAULTS,
|
|
9
|
+
...props
|
|
10
|
+
};
|
|
11
|
+
const x = (props.x ?? 0) - (width ?? size) / 2;
|
|
12
|
+
const y = (props.y ?? 0) - (height ?? size) / 2;
|
|
13
|
+
const trimmedProps = useMemo(() => {
|
|
14
|
+
const _props = { ...props };
|
|
15
|
+
delete _props.circleStyle;
|
|
16
|
+
return _props;
|
|
17
|
+
}, [props]);
|
|
18
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
19
|
+
/* @__PURE__ */ jsx("circle", { cx: props.x, cy: props.y, r: size / 2, style: props.circleStyle ?? {} }),
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
16
21
|
"svg",
|
|
17
22
|
{
|
|
18
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
24
|
viewBox: "0 -960 960 960",
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
22
|
-
...
|
|
23
|
-
x
|
|
24
|
-
y
|
|
25
|
-
children:
|
|
25
|
+
width: width ?? size,
|
|
26
|
+
height: height ?? size,
|
|
27
|
+
...trimmedProps,
|
|
28
|
+
x,
|
|
29
|
+
y,
|
|
30
|
+
children: props.children
|
|
26
31
|
}
|
|
27
32
|
)
|
|
28
33
|
] });
|
|
29
34
|
};
|
|
30
35
|
export {
|
|
31
|
-
|
|
36
|
+
BaseIcon as default
|
|
32
37
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useTheme
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@mui/material";
|
|
3
|
+
import BaseIcon from "./BaseIcon.js";
|
|
4
|
+
const BugIcon = (props) => {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
BaseIcon,
|
|
8
8
|
{
|
|
9
|
-
...
|
|
10
|
-
style: { fill:
|
|
11
|
-
circleStyle: { fill:
|
|
12
|
-
children: /* @__PURE__ */
|
|
9
|
+
...props,
|
|
10
|
+
style: { fill: theme.palette.getContrastText(theme.palette.error.dark), ...props.style },
|
|
11
|
+
circleStyle: { fill: theme.palette.error.dark, ...props.style },
|
|
12
|
+
children: /* @__PURE__ */ jsx("path", { d: "M480-200q66 0 113-47t47-113v-160q0-66-47-113t-113-47q-66 0-113 47t-47 113v160q0 66 47 113t113 47Zm-80-120h160v-80H400v80Zm0-160h160v-80H400v80Zm80 40Zm0 320q-65 0-120.5-32T272-240H160v-80h84q-3-20-3.5-40t-.5-40h-80v-80h80q0-20 .5-40t3.5-40h-84v-80h112q14-23 31.5-43t40.5-35l-64-66 56-56 86 86q28-9 57-9t57 9l88-86 56 56-66 66q23 15 41.5 34.5T688-640h112v80h-84q3 20 3.5 40t.5 40h80v80h-80q0 20-.5 40t-3.5 40h84v80H688q-32 56-87.5 88T480-120Z" })
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
BugIcon as default
|
|
18
18
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useTheme
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@mui/material";
|
|
3
|
+
import BaseIcon from "./BaseIcon.js";
|
|
4
|
+
const HostIcon = (props) => {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
BaseIcon,
|
|
8
8
|
{
|
|
9
|
-
...
|
|
10
|
-
style: { fill:
|
|
11
|
-
circleStyle: { fill:
|
|
12
|
-
children: /* @__PURE__ */
|
|
9
|
+
...props,
|
|
10
|
+
style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
|
|
11
|
+
circleStyle: { fill: theme.palette.info.dark, ...props.style },
|
|
12
|
+
children: /* @__PURE__ */ jsx(
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
15
15
|
style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
|
|
@@ -20,5 +20,5 @@ const n = (t) => {
|
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
HostIcon as default
|
|
24
24
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useTheme
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@mui/material";
|
|
3
|
+
import BaseIcon from "./BaseIcon.js";
|
|
4
|
+
const NetworkIcon = (props) => {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
BaseIcon,
|
|
8
8
|
{
|
|
9
|
-
...
|
|
10
|
-
style: { fill:
|
|
11
|
-
circleStyle: { fill:
|
|
12
|
-
children: /* @__PURE__ */
|
|
9
|
+
...props,
|
|
10
|
+
style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
|
|
11
|
+
circleStyle: { fill: theme.palette.info.dark, ...props.style },
|
|
12
|
+
children: /* @__PURE__ */ jsx(
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
15
15
|
style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
|
|
@@ -20,5 +20,5 @@ const s = (t) => {
|
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
NetworkIcon as default
|
|
24
24
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useTheme
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme, colors } from "@mui/material";
|
|
3
|
+
import BaseIcon from "./BaseIcon.js";
|
|
4
|
+
const ProcessIcon = (props) => {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
BaseIcon,
|
|
8
8
|
{
|
|
9
|
-
...
|
|
10
|
-
style: { fill:
|
|
11
|
-
circleStyle: { fill:
|
|
12
|
-
children: /* @__PURE__ */
|
|
9
|
+
...props,
|
|
10
|
+
style: { fill: theme.palette.getContrastText(colors.grey[500]), ...props.style },
|
|
11
|
+
circleStyle: { fill: colors.grey[500], ...props.style },
|
|
12
|
+
children: /* @__PURE__ */ jsx("path", { d: "M360-360v-240h240v240H360Zm80-80h80v-80h-80v80Zm-80 320v-80h-80q-33 0-56.5-23.5T200-280v-80h-80v-80h80v-80h-80v-80h80v-80q0-33 23.5-56.5T280-760h80v-80h80v80h80v-80h80v80h80q33 0 56.5 23.5T760-680v80h80v80h-80v80h80v80h-80v80q0 33-23.5 56.5T680-200h-80v80h-80v-80h-80v80h-80Zm320-160v-400H280v400h400ZM480-480Z" })
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
ProcessIcon as default
|
|
18
18
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useTheme
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@mui/material";
|
|
3
|
+
import BaseIcon from "./BaseIcon.js";
|
|
4
|
+
const TargetIcon = (props) => {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
BaseIcon,
|
|
8
8
|
{
|
|
9
|
-
...
|
|
10
|
-
...
|
|
11
|
-
style: { fill:
|
|
12
|
-
circleStyle: { fill:
|
|
13
|
-
children: /* @__PURE__ */
|
|
9
|
+
...props,
|
|
10
|
+
...props,
|
|
11
|
+
style: { fill: theme.palette.getContrastText(theme.palette.info.dark), ...props.style },
|
|
12
|
+
circleStyle: { fill: theme.palette.info.dark, ...props.style },
|
|
13
|
+
children: /* @__PURE__ */ jsx("path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-80q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm0-80q66 0 113-47t47-113q0-66-47-113t-113-47q-66 0-113 47t-47 113q0 66 47 113t113 47Zm0-80q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Z" })
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
|
-
|
|
18
|
+
TargetIcon as default
|
|
19
19
|
};
|