@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.
Files changed (188) hide show
  1. package/ActionForm-D6gYuFRR.js +5970 -0
  2. package/AnnotationDetails-Zx4pjBiN.js +175 -0
  3. package/AnnotationPreview-Dmz7taAU.js +188 -0
  4. package/ClueEnrichContext-CJEJxrgs.js +541 -0
  5. package/FlexOne-BSYAhhtG.js +9 -0
  6. package/_MapCache-WmuDdwuH.js +222 -0
  7. package/_Uint8Array-B7JqpgFX.js +128 -0
  8. package/_baseAssignValue-CGTuELqU.js +25 -0
  9. package/_baseClone-CkNrTyhm.js +283 -0
  10. package/_baseExtremum-kob8QXyt.js +18 -0
  11. package/_baseFlatten-jIR_sN_-.js +92 -0
  12. package/_baseGet-Bx3A4Qfp.js +108 -0
  13. package/_baseIsEqual-C5OTWzTk.js +208 -0
  14. package/_baseIteratee-avi7MX2o.js +126 -0
  15. package/_baseSlice-GAv_YFTT.js +20 -0
  16. package/_baseSum-D0WC1dN0.js +13 -0
  17. package/_baseUniq-BI9GIHMF.js +115 -0
  18. package/_commonjsHelpers-DWwsNxpa.js +8 -0
  19. package/_createAggregator-QD8MzKwe.js +63 -0
  20. package/_getPrototype-CU0j_POw.js +5 -0
  21. package/_getTag-Ckxxfr88.js +126 -0
  22. package/_isIterateeCall-Ds3sw2SF.js +17 -0
  23. package/_setToArray-CaPKQhcz.js +33 -0
  24. package/cloneDeep-DJrLSw8W.js +8 -0
  25. package/components/AnnotationBody.js +49 -35
  26. package/components/AnnotationDetailPopover.js +36 -30
  27. package/components/AnnotationDetails.js +7 -7
  28. package/components/AnnotationEntry.js +35 -35
  29. package/components/AnnotationPreview.js +5 -5
  30. package/components/ClassificationChip.js +44 -23
  31. package/components/CountBadge.js +31 -26
  32. package/components/EnrichedCard.js +110 -97
  33. package/components/EnrichedChip.js +130 -105
  34. package/components/EnrichedTypography.js +133 -107
  35. package/components/ErrorBoundary.js +28 -24
  36. package/components/RetryFailedEnrichments.js +10 -9
  37. package/components/SourcePicker.js +57 -49
  38. package/components/actions/ActionForm.js +4 -4
  39. package/components/actions/ExecutePopover.js +75 -59
  40. package/components/actions/ResultModal.js +4 -4
  41. package/components/actions/form/schemaAdapter.js +39 -23
  42. package/components/actions/formats/FileResult.js +86 -59
  43. package/components/actions/formats/index.js +21 -10
  44. package/components/display/graph/ExpandMoreButton.js +10 -10
  45. package/components/display/graph/elements/NodeCard.js +111 -91
  46. package/components/display/graph/elements/NodeTag.js +15 -13
  47. package/components/display/graph/index.js +261 -202
  48. package/components/display/graph/visualizations/Leaf.js +88 -69
  49. package/components/display/graph/visualizations/cloud/index.js +98 -81
  50. package/components/display/graph/visualizations/icons/BaseIcon.js +26 -21
  51. package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
  52. package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
  53. package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
  54. package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
  55. package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
  56. package/components/display/graph/visualizations/icons/index.js +14 -13
  57. package/components/display/graph/visualizations/panels/NodePanel.js +10 -8
  58. package/components/display/graph/visualizations/tree/BundleLine.js +108 -81
  59. package/components/display/graph/visualizations/tree/Triangle.js +13 -13
  60. package/components/display/graph/visualizations/tree/index.js +408 -306
  61. package/components/display/icons/Iconified.js +27 -12
  62. package/components/display/json/index.js +4 -4
  63. package/components/display/markdown/index.js +8678 -5770
  64. package/components/enrichment/EnrichPopover.js +54 -46
  65. package/components/fetchers/Fetcher.js +158 -119
  66. package/components/fetchers/PreviewModal.js +20 -17
  67. package/components/fetchers/StatusChip.js +21 -17
  68. package/components/group/Entry.js +13 -11
  69. package/components/group/Group.js +13 -10
  70. package/components/group/GroupControl.js +76 -65
  71. package/components/stats/QueryStatus.js +43 -33
  72. package/countBy-c6S3dvSW.js +14 -0
  73. package/data/event.js +6 -4
  74. package/database/index.js +2 -2
  75. package/debounce-bV0h5FC5.js +92 -0
  76. package/get-DSsNkRQs.js +8 -0
  77. package/groupBy-xqz-n0Vd.js +14 -0
  78. package/hooks/ClueActionContext.d.ts +10 -2
  79. package/hooks/ClueActionContext.js +6 -6
  80. package/hooks/ClueComponentContext.js +29 -23
  81. package/hooks/ClueConfigProvider.js +14 -12
  82. package/hooks/ClueDatabaseContext.js +19 -13
  83. package/hooks/ClueEnrichContext.js +8 -8
  84. package/hooks/ClueFetcherContext.js +83 -56
  85. package/hooks/ClueGroupContext.js +17 -14
  86. package/hooks/CluePopupContext.js +5 -5
  87. package/hooks/ClueProvider.js +12 -10
  88. package/hooks/selectors.js +7 -7
  89. package/hooks/useActionResult.d.ts +1 -0
  90. package/hooks/useActionResult.js +3 -3
  91. package/hooks/useAnnotations.js +47 -31
  92. package/hooks/useClue.js +6 -4
  93. package/hooks/useClueActions.js +3 -3
  94. package/hooks/useClueConfig.js +6 -4
  95. package/hooks/useClueTypeConfig.js +3 -3
  96. package/hooks/useComparator.js +722 -435
  97. package/hooks/useErrors.js +22 -18
  98. package/hooks/useFetcherResult.d.ts +1 -0
  99. package/hooks/useFetcherResult.js +33 -24
  100. package/hooks/useMyHighlights.js +66 -36
  101. package/hooks/useMyLocalStorage.js +66 -37
  102. package/iconify-CXMreGTg.js +1782 -0
  103. package/icons/Action.js +66 -49
  104. package/icons/Assessment.js +85 -69
  105. package/icons/Context.js +77 -63
  106. package/icons/Opinion.js +76 -60
  107. package/icons/iconMap.js +2 -2
  108. package/identity-CPGTqrE4.js +6 -0
  109. package/index-AMfoEg_6.js +696 -0
  110. package/index-B6C2a_Lg.js +1172 -0
  111. package/index-C12gPw2W.js +17698 -0
  112. package/index-DCKkHTvx.js +15750 -0
  113. package/index-JcKyZeoY.js +465 -0
  114. package/isNil-CIubwp4T.js +6 -0
  115. package/isObject-FTY-5JQX.js +7 -0
  116. package/isObjectLike-OAgjjZye.js +48 -0
  117. package/isSymbol-Xd2FsJyp.js +8 -0
  118. package/last-CUCl67Im.js +7 -0
  119. package/main.js +60 -60
  120. package/maxBy-IKHzFrCS.js +8 -0
  121. package/package.json +1 -1
  122. package/sortBy-DfSj8IoJ.js +96 -0
  123. package/sumBy-D-hb_NY-.js +8 -0
  124. package/text/Frequency.js +42 -23
  125. package/toFinite-Bc55msYj.js +16 -0
  126. package/toNumber-DPxy1FBy.js +39 -0
  127. package/types/RunningActionData.d.ts +1 -0
  128. package/types/WithActionData.d.ts +1 -0
  129. package/useClueTypeConfig-Z1LFp01b.js +3289 -0
  130. package/utils/chain.js +92 -65
  131. package/utils/classificationParser.js +519 -256
  132. package/utils/constants.js +35 -10
  133. package/utils/graph.js +72 -45
  134. package/utils/hashUtil.js +7 -7
  135. package/utils/line.js +131 -81
  136. package/utils/loggerUtil.js +5 -3
  137. package/utils/sessionStorage.js +41 -27
  138. package/utils/time.js +423 -423
  139. package/utils/utils.js +9 -9
  140. package/utils/window.js +21 -10
  141. package/utils-HmNPuoDB.js +199 -0
  142. package/ActionForm-CwsfB99X.js +0 -4458
  143. package/AnnotationDetails-Bw2JdtTL.js +0 -160
  144. package/AnnotationPreview-BO7rVnOP.js +0 -140
  145. package/ClueEnrichContext-KqRuuWNS.js +0 -418
  146. package/FlexOne-BXWFOd1T.js +0 -6
  147. package/_MapCache-BiTi0iqu.js +0 -180
  148. package/_Uint8Array-BQNOM9Rr.js +0 -101
  149. package/_baseAssignValue-CNMLQZco.js +0 -20
  150. package/_baseClone-BnT-6pyM.js +0 -207
  151. package/_baseExtremum-Ca2EHgy2.js +0 -16
  152. package/_baseFlatten-Bfr_Molw.js +0 -72
  153. package/_baseGet-DSZygzyq.js +0 -79
  154. package/_baseIsEqual-VgvaAFZG.js +0 -147
  155. package/_baseIteratee-Dbfsw5z8.js +0 -95
  156. package/_baseSlice-M5RKzt1A.js +0 -10
  157. package/_baseSum-wEbgNeUs.js +0 -10
  158. package/_baseUniq-BJcj69PL.js +0 -79
  159. package/_commonjsHelpers-DaMA6jEr.js +0 -8
  160. package/_createAggregator-k3TuAnxT.js +0 -53
  161. package/_getPrototype-Cr1Mk7BC.js +0 -5
  162. package/_getTag-CK2Sffaq.js +0 -90
  163. package/_isIterateeCall-DkJP7Rbx.js +0 -13
  164. package/_setToArray-C7yMOeww.js +0 -29
  165. package/cloneDeep-CF8TtLHr.js +0 -8
  166. package/countBy-CdYegFSu.js +0 -8
  167. package/debounce-DryYcbJ4.js +0 -56
  168. package/get-CH7kz5Ix.js +0 -8
  169. package/groupBy-br8xmD2R.js +0 -8
  170. package/iconify-BBckr5AQ.js +0 -1263
  171. package/identity-ByMq8VxU.js +0 -6
  172. package/index-BHAe_V9n.js +0 -12768
  173. package/index-BK-zfYhR.js +0 -358
  174. package/index-CA5CUNZO.js +0 -975
  175. package/index-Dj5C04IX.js +0 -568
  176. package/index-p5_wX7q1.js +0 -11729
  177. package/isNil-CjWwlQS3.js +0 -6
  178. package/isObject-B53jY8Qg.js +0 -7
  179. package/isObjectLike-BatpeCIi.js +0 -29
  180. package/isSymbol-C3_SC0Qp.js +0 -8
  181. package/last-7CdUxN0r.js +0 -7
  182. package/maxBy-Bc0dYHcO.js +0 -8
  183. package/sortBy-DY2JBf9n.js +0 -75
  184. package/sumBy-DuMASLPd.js +0 -8
  185. package/toFinite-BMy6GObD.js +0 -14
  186. package/toNumber-YVhnnJv4.js +0 -31
  187. package/useClueTypeConfig-Ct9Ygter.js +0 -2292
  188. package/utils-DmwSUrum.js +0 -129
@@ -1,106 +1,125 @@
1
- import { jsxs as U, jsx as b } from "react/jsx-runtime";
2
- import { i as _, b as G } from "../../../../isObjectLike-BatpeCIi.js";
3
- import { useState as N, useMemo as Z, useCallback as M, useEffect as d } from "react";
4
- var g = "[object Number]";
5
- function q(s) {
6
- return typeof s == "number" || _(s) && G(s) == g;
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 v = 10, J = ({
9
- nodeId: s,
10
- label: x = s,
11
- x: r,
12
- y: a,
13
- height: h,
14
- nodeRadius: k = v,
15
- nodeColor: $,
16
- nodeOpacity: m = 1,
17
- letterSize: l,
18
- letterWidth: O,
19
- textColor: W,
20
- style: t = {},
21
- selected: p = !1,
22
- alwaysShowText: j = !1,
23
- onHoverChanged: i,
24
- onClick: o,
25
- children: A
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 [c, n] = N(p), [u, D] = N(!1), E = Z(() => {
28
- const e = ["node"];
29
- return u && e.push("hover"), c && e.push("selected"), e;
30
- }, [u, c]), S = M(
31
- (e) => {
32
- o == null || o(s, !c, e), n(!c);
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
- [s, o, c]
35
- ), L = M(
36
- (e) => {
37
- D(e), i == null || i(s, e);
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
- [s, i]
52
+ [nodeId, onHoverChanged]
40
53
  );
41
- d(() => n(p), [p]);
42
- let f = `${k}px`;
43
- return t.strokeWidth && (q(t.strokeWidth) ? f = `${k * t.strokeWidth}px` : f = t.strokeWidth), /* @__PURE__ */ U(
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-" + s.replace(/[^A-Za-z0-9]*/g, ""),
66
+ id: "node-" + nodeId.replace(/[^A-Za-z0-9]*/g, ""),
47
67
  style: { strokeLinecap: "round" },
48
- className: E.join(" "),
49
- onClick: S,
50
- onMouseOver: () => L(!0),
51
- onMouseLeave: () => L(!1),
68
+ className: classNames.join(" "),
69
+ onClick: handleOnClick,
70
+ onMouseOver: () => handleOnHoverChanged(true),
71
+ onMouseLeave: () => handleOnHoverChanged(false),
52
72
  children: [
53
- A,
54
- /* @__PURE__ */ b(
73
+ children,
74
+ /* @__PURE__ */ jsx(
55
75
  "path",
56
76
  {
57
77
  className: "border",
58
- d: `M ${r} ${a} L ${r} ${a + Math.max(h, 0)}`,
78
+ d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
59
79
  style: {
60
- strokeOpacity: m,
61
- ...t,
62
- strokeWidth: `calc(${f} * 2)`,
63
- stroke: t.stroke ?? $.border
80
+ strokeOpacity: nodeOpacity,
81
+ ...style,
82
+ strokeWidth: `calc(${strokeWidth} * 2)`,
83
+ stroke: style.stroke ?? nodeColor.border
64
84
  }
65
85
  },
66
- s + "-border"
86
+ nodeId + "-border"
67
87
  ),
68
- /* @__PURE__ */ b(
88
+ /* @__PURE__ */ jsx(
69
89
  "path",
70
90
  {
71
91
  className: "center",
72
- d: `M ${r} ${a} L ${r} ${a + Math.max(h, 0)}`,
92
+ d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
73
93
  style: {
74
- strokeOpacity: m,
75
- ...t,
76
- strokeWidth: f,
77
- stroke: t.fill ?? $.center
94
+ strokeOpacity: nodeOpacity,
95
+ ...style,
96
+ strokeWidth,
97
+ stroke: style.fill ?? nodeColor.center
78
98
  }
79
99
  },
80
- s + "-middle"
100
+ nodeId + "-middle"
81
101
  ),
82
- (u || j) && x.split(`
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: r + O,
87
- y: a - l / 2 + F.length - T * l,
88
- fill: W,
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: l + "px",
93
- fillOpacity: m
111
+ fontSize: letterSize + "px",
112
+ fillOpacity: nodeOpacity
94
113
  },
95
- children: e
114
+ children: _label
96
115
  },
97
- s + "-label-" + e
116
+ nodeId + "-label-" + _label
98
117
  ))
99
118
  ]
100
119
  },
101
- s
120
+ nodeId
102
121
  );
103
122
  };
104
123
  export {
105
- J as default
124
+ Leaf as default
106
125
  };
@@ -1,14 +1,14 @@
1
- import { jsx as a, jsxs as x } from "react/jsx-runtime";
2
- import { o as I, d as N, S as B, a as T, h as _ } from "../../../../../index-p5_wX7q1.js";
3
- import A from "../../../../../hooks/useMyHighlights.js";
4
- import { useMyLocalStorageItem as D } from "../../../../../hooks/useMyLocalStorage.js";
5
- import { StorageKey as F } from "../../../../../utils/constants.js";
6
- import { cyrb53 as K } from "../../../../../utils/graph.js";
7
- import { c as U } from "../../../../../countBy-CdYegFSu.js";
8
- import { s as X } from "../../../../../sumBy-DuMASLPd.js";
9
- import { memo as Y, useRef as p, useMemo as c, useCallback as q } from "react";
10
- import G from "../Leaf.js";
11
- const u = {
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
- u.circlePadding = 3 * u.nodeRadius;
27
- const J = ({ svgRef: S, graph: h, options: b = {} }) => {
26
+ DEFAULT_OPTIONS.circlePadding = 3 * DEFAULT_OPTIONS.nodeRadius;
27
+ const Cloud = ({ svgRef, graph, options = {} }) => {
28
28
  const {
29
- width: M,
30
- backgroundColor: O,
31
- textColor: $,
32
- letterSize: m,
33
- letterWidth: v,
34
- circlePadding: g,
35
- nodeRadius: d,
36
- nodeColor: L,
37
- lineWidth: f
29
+ width,
30
+ backgroundColor,
31
+ textColor,
32
+ letterSize,
33
+ letterWidth,
34
+ circlePadding,
35
+ nodeRadius,
36
+ nodeColor,
37
+ lineWidth
38
38
  } = {
39
- ...u,
40
- ...b
41
- }, { onNodeHoveredChanged: W, onNodeClicked: w, nodeOpacities: z, highlightedPath: s } = A(h), [y] = D(F.COLOR_SCHEME, "Spectral"), P = p(2 * d), R = p(m + d), j = p({}), i = c(
42
- () => h.data.flatMap(
43
- (t, e) => t.map((r) => ({
44
- ...r,
45
- cloud: e.toString()
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
- [h.data]
49
- ), n = c(() => U(i, (t) => t.cloud), [i]), H = c(
50
- () => I(
51
- Object.keys(n).map((t) => (N[`interpolate${y}`] ?? B)(K(t)))
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
- [n, y]
54
- ), E = c(
55
- () => i.flatMap(
56
- (t) => ((t == null ? void 0 : t.edges) ?? []).map((e) => ({
57
- source: t.id,
58
- target: e
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
- [i]
62
- ), k = c(() => T().size([600, 600]).padding(g), [g]), l = c(() => {
63
- const t = Object.entries(n).map(([e]) => ({
64
- id: e,
65
- children: i.filter((r) => r.cloud === e).map((r) => ({
66
- ...r,
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 k(
71
- _({ children: t }).sum((e) => e.children ? X(e.children, (r) => r.value) : e.value)
81
+ return pack(
82
+ hierarchy({ children: data }).sum((d) => d.children ? sumBy(d.children, (c) => c.value) : d.value)
72
83
  ).children;
73
- }, [n, i, k]), C = q(
74
- (t) => s.size === 0 || s.has(t.source) && s.has(t.target) ? 1 : 0.2,
75
- [s]
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
- return P.current = 2 * d, R.current = m + d, j.current = {}, /* @__PURE__ */ a("svg", { id: "viz", ref: S, width: M, height: 600, style: { backgroundColor: O }, children: /* @__PURE__ */ x("g", { id: "view", children: [
78
- l.map((t) => /* @__PURE__ */ a("g", { children: /* @__PURE__ */ a("circle", { cx: t.x, cy: t.y, r: t.r, strokeWidth: 4, stroke: H(t.data.id), fill: "none" }) }, t.data.id)),
79
- E.map((t) => {
80
- const e = l.flatMap((o) => o.children).find((o) => o.data.id === t.source), r = l.flatMap((o) => o.children).find((o) => o.data.id === t.target);
81
- return /* @__PURE__ */ x("g", { children: [
82
- /* @__PURE__ */ a(
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 ${e.x} ${e.y} L ${r.x} ${r.y}`,
101
+ d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
86
102
  stroke: "black",
87
- strokeWidth: f + 3,
88
- strokeOpacity: C(t)
103
+ strokeWidth: lineWidth + 3,
104
+ strokeOpacity: opacities(link)
89
105
  }
90
106
  ),
91
- /* @__PURE__ */ a(
107
+ /* @__PURE__ */ jsx(
92
108
  "path",
93
109
  {
94
- d: `M ${e.x} ${e.y} L ${r.x} ${r.y}`,
110
+ d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
95
111
  stroke: "white",
96
- strokeWidth: f,
97
- strokeOpacity: C(t)
112
+ strokeWidth: lineWidth,
113
+ strokeOpacity: opacities(link)
98
114
  }
99
115
  )
100
- ] }, e.data.id + r.data.id);
116
+ ] }, source.data.id + target.data.id);
101
117
  }),
102
- l.map((t) => /* @__PURE__ */ a("g", { children: t.children.map((e) => /* @__PURE__ */ a(
103
- G,
118
+ cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: cloud.children.map((node) => /* @__PURE__ */ jsx(
119
+ Leaf,
104
120
  {
105
- nodeId: e.data.id,
121
+ nodeId: node.data.id,
106
122
  height: 0,
107
- x: e.x,
108
- y: e.y,
109
- nodeRadius: d,
110
- nodeColor: L,
111
- nodeOpacity: z(e.data.id),
112
- letterSize: m,
113
- letterWidth: v,
114
- textColor: $,
115
- onHoverChanged: W,
116
- onClick: w
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
- e.data.id
119
- )) }, t.id))
134
+ node.data.id
135
+ )) }, cloud.id))
120
136
  ] }) });
121
- }, dt = Y(J);
137
+ };
138
+ const Cloud$1 = memo(Cloud);
122
139
  export {
123
- dt as default
140
+ Cloud$1 as default
124
141
  };
@@ -1,32 +1,37 @@
1
- import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
- import { useMemo as x } from "react";
3
- const d = {
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ const DEFAULTS = {
4
4
  size: 20
5
- }, y = (e) => {
6
- const { width: c, height: i, size: t } = {
7
- ...d,
8
- ...e
9
- }, l = (e.x ?? 0) - (c ?? t) / 2, r = (e.y ?? 0) - (i ?? t) / 2, h = x(() => {
10
- const n = { ...e };
11
- return delete n.circleStyle, n;
12
- }, [e]);
13
- return /* @__PURE__ */ o("g", { children: [
14
- /* @__PURE__ */ s("circle", { cx: e.x, cy: e.y, r: t / 2, style: e.circleStyle ?? {} }),
15
- /* @__PURE__ */ s(
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: c ?? t,
21
- height: i ?? t,
22
- ...h,
23
- x: l,
24
- y: r,
25
- children: e.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
- y as default
36
+ BaseIcon as default
32
37
  };
@@ -1,18 +1,18 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useTheme as h } from "@mui/material";
3
- import l from "./BaseIcon.js";
4
- const v = (t) => {
5
- const e = h();
6
- return /* @__PURE__ */ r(
7
- l,
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
- ...t,
10
- style: { fill: e.palette.getContrastText(e.palette.error.dark), ...t.style },
11
- circleStyle: { fill: e.palette.error.dark, ...t.style },
12
- children: /* @__PURE__ */ r("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" })
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
- v as default
17
+ BugIcon as default
18
18
  };
@@ -1,15 +1,15 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { useTheme as a } from "@mui/material";
3
- import r from "./BaseIcon.js";
4
- const n = (t) => {
5
- const e = a();
6
- return /* @__PURE__ */ l(
7
- r,
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
- ...t,
10
- style: { fill: e.palette.getContrastText(e.palette.info.dark), ...t.style },
11
- circleStyle: { fill: e.palette.info.dark, ...t.style },
12
- children: /* @__PURE__ */ l(
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
- n as default
23
+ HostIcon as default
24
24
  };
@@ -1,15 +1,15 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { useTheme as v } from "@mui/material";
3
- import r from "./BaseIcon.js";
4
- const s = (t) => {
5
- const e = v();
6
- return /* @__PURE__ */ l(
7
- r,
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
- ...t,
10
- style: { fill: e.palette.getContrastText(e.palette.info.dark), ...t.style },
11
- circleStyle: { fill: e.palette.info.dark, ...t.style },
12
- children: /* @__PURE__ */ l(
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
- s as default
23
+ NetworkIcon as default
24
24
  };
@@ -1,18 +1,18 @@
1
- import { jsx as v } from "react/jsx-runtime";
2
- import { useTheme as r, colors as e } from "@mui/material";
3
- import l from "./BaseIcon.js";
4
- const c = (h) => {
5
- const t = r();
6
- return /* @__PURE__ */ v(
7
- l,
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
- ...h,
10
- style: { fill: t.palette.getContrastText(e.grey[500]), ...h.style },
11
- circleStyle: { fill: e.grey[500], ...h.style },
12
- children: /* @__PURE__ */ v("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" })
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
- c as default
17
+ ProcessIcon as default
18
18
  };
@@ -1,19 +1,19 @@
1
- import { jsx as q } from "react/jsx-runtime";
2
- import { useTheme as T } from "@mui/material";
3
- import l from "./BaseIcon.js";
4
- const o = (t) => {
5
- const e = T();
6
- return /* @__PURE__ */ q(
7
- l,
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
- ...t,
10
- ...t,
11
- style: { fill: e.palette.getContrastText(e.palette.info.dark), ...t.style },
12
- circleStyle: { fill: e.palette.info.dark, ...t.style },
13
- children: /* @__PURE__ */ q("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" })
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
- o as default
18
+ TargetIcon as default
19
19
  };