@cccsaurora/clue-ui 1.3.0-dev.403 → 1.3.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/ActionForm-CHOSKfvu.js +4403 -0
- package/AnnotationDetails-Bqq6Ymmg.js +160 -0
- package/AnnotationPreview-CqXmC-j8.js +140 -0
- package/ClueEnrichContext-DL6aGe1k.js +432 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-DRK-s2eK.js +179 -0
- package/_Set-DrS_bbSV.js +6 -0
- package/_Uint8Array-D9R2N9Lp.js +98 -0
- package/_arrayIncludes-Dcl_29E6.js +25 -0
- package/_arrayPush-DBJIuK2V.js +8 -0
- package/_baseAssignValue-Bx1cxHj5.js +12 -0
- package/_baseClone-DRhywkxm.js +211 -0
- package/_baseExtremum-DodEaEyF.js +16 -0
- package/_baseFlatten-CD9NgrYE.js +72 -0
- package/_baseGet-bVwDaGrA.js +80 -0
- package/_baseGetTag-CxDaTem-.js +25 -0
- package/_baseIsEqual-C-FKsm1J.js +150 -0
- package/_baseIteratee-D0FhC5bC.js +95 -0
- package/_baseRest-D_eW2E0d.js +8 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-D3N8igOm.js +41 -0
- package/_cacheHas-Wgl-hw34.js +22 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-BVj8IAuF.js +53 -0
- package/_defineProperty-BZU4WKA3.js +11 -0
- package/_getPrototype-BGBCg-aX.js +5 -0
- package/_getTag-B7R9qBo7.js +73 -0
- package/_isIterateeCall-Dm0VTAYy.js +13 -0
- package/_setToArray-Ck4YZu0Z.js +9 -0
- package/cloneDeep-fV59zwUf.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +25 -29
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +204 -262
- package/components/display/graph/visualizations/Leaf.js +70 -89
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- 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 +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +306 -408
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +123 -166
- package/components/fetchers/FetcherResultView.js +27 -31
- package/components/fetchers/PreviewModal.js +16 -17
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +32 -45
- package/countBy-B3rNuG4T.js +8 -0
- package/data/event.js +4 -6
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/en/translation.json +7 -0
- package/fr/translation.json +7 -0
- package/get-Bil3mzRD.js +8 -0
- package/groupBy-CrJC7sGa.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +23 -35
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +11 -13
- package/hooks/ClueUIPluginContext.d.ts +5 -0
- package/hooks/ClueUIPluginContext.js +35 -47
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +24 -49
- package/hooks/useClueUIPlugins.d.ts +4 -0
- package/hooks/useClueUIPlugins.js +11 -0
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-Ptb5dTKy.js +1270 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +69 -85
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +60 -76
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BH-gBhtO.js +2282 -0
- package/index-BM9Sve5T.js +571 -0
- package/index-Cj4d5cGz.js +357 -0
- package/index-Dh2PP9h8.js +11747 -0
- package/index-DoFpWPHo.js +975 -0
- package/index-DzVIklWY.js +6464 -0
- package/isArguments-BWcXOE6a.js +24 -0
- package/isArray-WzO_os3q.js +4 -0
- package/isEmpty-DKxrY-_M.js +22 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-CYbdrIBr.js +6 -0
- package/isSymbol-DE1Kcy2M.js +9 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +62 -62
- package/maxBy-BOWDkL_D.js +8 -0
- package/package.json +3 -2
- package/plugins/ClueUIPlugin.d.ts +5 -1
- package/plugins/ClueUIPlugin.js +124 -162
- package/plugins/file/index.js +15 -15
- package/plugins/graph/example/tree.json.d.ts +91 -0
- package/plugins/graph/index.d.ts +3 -0
- package/plugins/graph/index.js +34 -17
- package/plugins/image/index.d.ts +3 -0
- package/plugins/image/index.js +34 -18
- package/plugins/json/index.d.ts +3 -0
- package/plugins/json/index.js +29 -17
- package/plugins/markdown/index.d.ts +3 -0
- package/plugins/markdown/index.js +28 -17
- package/plugins/registry.js +6 -6
- package/plugins/store.d.ts +1 -0
- package/plugins/store.js +4 -4
- package/plugins/test/index.js +17 -17
- package/plugins/utils.d.ts +1 -0
- package/plugins/utils.js +19 -0
- package/replication-WkKbPdwG.js +8453 -0
- package/sessionStorage-DFMae61b.js +90 -0
- package/sortBy-BHe812lF.js +74 -0
- package/store-DClHBq7r.js +1169 -0
- package/sumBy-B7f_bP_k.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-CBrE65MP.js +14 -0
- package/toNumber-CxmWey0f.js +31 -0
- package/uniq-B4UZ671_.js +7 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +11 -37
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +7 -7
- package/utils/time.js +427 -447
- package/utils/utils.js +10 -10
- package/utils/window.js +10 -21
- package/utils-SpTOhPYl.js +147 -0
- package/ActionForm-CqKcnDWC.js +0 -6099
- package/AnnotationDetails-BlPd3T8k.js +0 -176
- package/AnnotationPreview-Bl447SKT.js +0 -188
- package/ClueEnrichContext-B3YrTCaJ.js +0 -567
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-kuEY_iOH.js +0 -220
- package/_Set-BrSMTlHn.js +0 -6
- package/_Uint8Array-OPpgYQj7.js +0 -123
- package/_arrayIncludes-BNqL-9ZP.js +0 -31
- package/_arrayPush-CBkQqaE_.js +0 -10
- package/_baseAssignValue-CNUVPOBW.js +0 -16
- package/_baseClone-9FaRd1R2.js +0 -287
- package/_baseExtremum-wOGT4Dgw.js +0 -18
- package/_baseFlatten-Co6QHDlG.js +0 -92
- package/_baseGet-Cmp6FztG.js +0 -109
- package/_baseGetTag-Hj-0NTYF.js +0 -44
- package/_baseIsEqual-1CpU47TZ.js +0 -211
- package/_baseIteratee-BN7Vbe5g.js +0 -126
- package/_baseRest-BZ_hQ9PC.js +0 -8
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BnvS3JHL.js +0 -63
- package/_cacheHas-_aF2y2Xv.js +0 -25
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BUZrP_is.js +0 -63
- package/_defineProperty-DolZLKmv.js +0 -12
- package/_getPrototype-Bb4gm-5m.js +0 -5
- package/_getTag-CML_cXiN.js +0 -105
- package/_isIterateeCall-B1IFEqVv.js +0 -17
- package/_setToArray-CqyqC8ib.js +0 -10
- package/cloneDeep-l3UkXG5M.js +0 -8
- package/countBy-Bqcp3VCs.js +0 -14
- package/get-CdMThM8x.js +0 -8
- package/groupBy-BVV07EGQ.js +0 -14
- package/iconify-DJxl6dC-.js +0 -1789
- package/identity-CPGTqrE4.js +0 -6
- package/index-CAvu7vwt.js +0 -1172
- package/index-CVUD9o3t.js +0 -15768
- package/index-DUEubgWN.js +0 -464
- package/index-Dj1N4IQP.js +0 -9314
- package/index-DpJxD74E.js +0 -3272
- package/index-_gpzM2Px.js +0 -702
- package/isArguments-CuYlEuhP.js +0 -27
- package/isArray-RJPfgWqI.js +0 -4
- package/isEmpty-BE656RUK.js +0 -30
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-CeENW9FN.js +0 -6
- package/isSymbol-D_H4HPZQ.js +0 -9
- package/last-CUCl67Im.js +0 -7
- package/maxBy-BjjQmX5t.js +0 -8
- package/replication--gLEZw8a.js +0 -11777
- package/sessionStorage-B68y-wnE.js +0 -140
- package/sortBy-B8JVsLQY.js +0 -95
- package/store-DMdRx9g0.js +0 -2156
- package/sumBy-D-HCzM2i.js +0 -8
- package/toFinite-meZTg4Su.js +0 -16
- package/toNumber-B5JaA1vX.js +0 -39
- package/uniq-CahZPAwp.js +0 -7
- package/utils-CEySTPtg.js +0 -224
|
@@ -1,255 +1,197 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef, useState, useEffect, useCallback, createElement } from "react";
|
|
3
|
-
import { useTheme, lighten, darken, Stack, Card, Typography, Autocomplete, TextField, FormControl, InputLabel, Select, MenuItem, alpha, IconButton, Collapse } from "@mui/material";
|
|
4
|
-
import { p as
|
|
5
|
-
import { z as
|
|
6
|
-
import { ClueComponentContext } from "../../../hooks/ClueComponentContext.js";
|
|
7
|
-
import
|
|
8
|
-
import { useMyLocalStorageItem } from "../../../hooks/useMyLocalStorage.js";
|
|
9
|
-
import { StorageKey } from "../../../utils/constants.js";
|
|
10
|
-
import { g as
|
|
11
|
-
import { a as
|
|
12
|
-
import { cssImportant } from "../../../utils/graph.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
const
|
|
19
|
-
var
|
|
20
|
-
const { t } =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const [showCoordinates] = useMyLocalStorageItem(StorageKey.SHOW_COORDINATES, false);
|
|
28
|
-
const [panelLocation] = useMyLocalStorageItem(StorageKey.PANEL_LOCATION, "vertical");
|
|
29
|
-
const [relativeMousePos, setRelativeMousePos] = useState(["0", "0"]);
|
|
30
|
-
const [absoluteMousePos, setAbsoluteMousePos] = useState(["0", "0"]);
|
|
31
|
-
const [showPanel, setShowPanel] = useState(false);
|
|
32
|
-
const nodeIds = useMemo(() => ((graph == null ? void 0 : graph.data) ?? []).flat(2).map((node) => node.id), [graph == null ? void 0 : graph.data]);
|
|
33
|
-
const zoom$1 = useMemo(() => zoom().scaleExtent([0.1, 6]), []);
|
|
34
|
-
const [currentZoom, setCurrentZoom] = useState(identity);
|
|
35
|
-
const [nodeId, setNodeId] = useState("");
|
|
36
|
-
const [selectedNodeIds, setSelectedNodeIds] = useState([]);
|
|
37
|
-
const [viz, setViz] = useState(
|
|
38
|
-
((_b = (_a = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a.visualization) == null ? void 0 : _b.type) ?? "tree"
|
|
39
|
-
);
|
|
40
|
-
const [hasError, setHasError] = useState(false);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
setShowPanel(selectedNodeIds.length > 0);
|
|
43
|
-
}, [selectedNodeIds]);
|
|
44
|
-
const labelKeys = useMemo(
|
|
1
|
+
import { jsx as i, jsxs as l, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as m, useRef as te, useState as u, useEffect as z, useCallback as f, createElement as Ce } from "react";
|
|
3
|
+
import { useTheme as we, lighten as oe, darken as ne, Stack as x, Card as T, Typography as he, Autocomplete as ze, TextField as Se, FormControl as Ee, InputLabel as Ie, Select as Oe, MenuItem as Ne, alpha as ie, IconButton as Me, Collapse as Pe } from "@mui/material";
|
|
4
|
+
import { p as Fe } from "../../../index-Cj4d5cGz.js";
|
|
5
|
+
import { z as Re, i as P, s as p, t as Te, p as re } from "../../../index-Dh2PP9h8.js";
|
|
6
|
+
import { ClueComponentContext as ge } from "../../../hooks/ClueComponentContext.js";
|
|
7
|
+
import Le from "../../../hooks/useComparator.js";
|
|
8
|
+
import { useMyLocalStorageItem as g } from "../../../hooks/useMyLocalStorage.js";
|
|
9
|
+
import { StorageKey as L } from "../../../utils/constants.js";
|
|
10
|
+
import { g as Ae } from "../../../get-Bil3mzRD.js";
|
|
11
|
+
import { a as Be } from "../../../index-BM9Sve5T.js";
|
|
12
|
+
import { cssImportant as k } from "../../../utils/graph.js";
|
|
13
|
+
import ae from "../icons/Iconified.js";
|
|
14
|
+
import $e from "./ExpandMoreButton.js";
|
|
15
|
+
import je from "./visualizations/cloud/index.js";
|
|
16
|
+
import He from "./visualizations/panels/NodePanel.js";
|
|
17
|
+
import _e from "./visualizations/tree/index.js";
|
|
18
|
+
const rt = ({ graph: t, sx: se = {} }) => {
|
|
19
|
+
var Y, Z, U, q, J;
|
|
20
|
+
const { t: C } = Be(ge, (e) => e.i18next), o = we(), S = m(() => o.palette.mode === "dark", [o]), { runComparator: A } = Le(), a = te(), le = te(), [F] = g(L.SHOW_MOUSE_POS, !1), [w] = g(L.SHOW_COORDINATES, !1), [E] = g(L.PANEL_LOCATION, "vertical"), [ce, de] = u(["0", "0"]), [me, ue] = u(["0", "0"]), [I, B] = u(!1), $ = m(() => ((t == null ? void 0 : t.data) ?? []).flat(2).map((e) => e.id), [t == null ? void 0 : t.data]), v = m(() => Re().scaleExtent([0.1, 6]), []), [s, O] = u(P), [N, pe] = u(""), [h, j] = u([]), [M, H] = u(
|
|
21
|
+
((Z = (Y = t == null ? void 0 : t.metadata.display) == null ? void 0 : Y.visualization) == null ? void 0 : Z.type) ?? "tree"
|
|
22
|
+
), [fe, R] = u(!1);
|
|
23
|
+
z(() => {
|
|
24
|
+
B(h.length > 0);
|
|
25
|
+
}, [h]);
|
|
26
|
+
const b = m(
|
|
45
27
|
() => {
|
|
46
|
-
var
|
|
47
|
-
return (
|
|
28
|
+
var e, n;
|
|
29
|
+
return (n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.displayField) == null ? void 0 : n.filter((r) => (r.zoom ?? Number.MAX_SAFE_INTEGER) > s.k);
|
|
48
30
|
},
|
|
49
|
-
[(
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const selectNode = useCallback(() => {
|
|
59
|
-
if (!nodeId) {
|
|
60
|
-
setHasError(true);
|
|
31
|
+
[(U = t == null ? void 0 : t.metadata.display) == null ? void 0 : U.displayField, s.k]
|
|
32
|
+
), xe = f((e) => {
|
|
33
|
+
pe(e);
|
|
34
|
+
}, []), _ = f((e) => {
|
|
35
|
+
const n = e === "view" ? e : `node-${e ?? "will\\%never\\$ever\\*exist"}`;
|
|
36
|
+
return p(`#${n}`);
|
|
37
|
+
}, []), G = f(() => {
|
|
38
|
+
if (!N) {
|
|
39
|
+
R(!0);
|
|
61
40
|
return;
|
|
62
41
|
}
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
42
|
+
const e = _(N.replace(/[^A-Za-z0-9]*/g, ""));
|
|
43
|
+
if (e.empty()) {
|
|
44
|
+
R(!0);
|
|
66
45
|
return;
|
|
67
46
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
svg.transition().duration(500).call(
|
|
74
|
-
zoom$1.transform,
|
|
75
|
-
identity.translate(clientRect.width / 2, clientRect.height / 2).scale(4).translate(-box.x, -box.y)
|
|
47
|
+
R(!1), j([N]);
|
|
48
|
+
const n = a.current.getBoundingClientRect(), r = p(a.current), d = e.node().getBBox();
|
|
49
|
+
r.transition().duration(500).call(
|
|
50
|
+
v.transform,
|
|
51
|
+
P.translate(n.width / 2, n.height / 2).scale(4).translate(-d.x, -d.y)
|
|
76
52
|
);
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (parsedEvent.isCtrl && parsedEvent.isEnter) {
|
|
82
|
-
selectNode();
|
|
83
|
-
}
|
|
53
|
+
}, [_, N, v.transform]), ve = f(
|
|
54
|
+
(e) => {
|
|
55
|
+
const n = Fe(e);
|
|
56
|
+
n.isCtrl && n.isEnter && G();
|
|
84
57
|
},
|
|
85
|
-
[
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
(instant = false) => {
|
|
90
|
-
if (!graph) {
|
|
58
|
+
[G]
|
|
59
|
+
), be = f((e) => ((t == null ? void 0 : t.data) ?? []).flat().find((n) => n.id === e), [t == null ? void 0 : t.data]), W = f(
|
|
60
|
+
(e = !1) => {
|
|
61
|
+
if (!t)
|
|
91
62
|
return;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (!instant) {
|
|
98
|
-
selection = selection.transition().duration(500);
|
|
99
|
-
}
|
|
100
|
-
selection.call(
|
|
101
|
-
zoom$1.transform,
|
|
102
|
-
identity.translate(clientRect.width / 2, (clientRect.height + 96) / 2).scale(zoomLevel).translate(-box.width / 2, -box.height / 2 - 10)
|
|
63
|
+
const n = p(a.current).select("#view").node().getBBox(), r = a.current.getBoundingClientRect(), d = Math.min(r.width / (n.width + 25), (r.height - 96) / n.height);
|
|
64
|
+
let y = p(a.current);
|
|
65
|
+
e || (y = y.transition().duration(500)), y.call(
|
|
66
|
+
v.transform,
|
|
67
|
+
P.translate(r.width / 2, (r.height + 96) / 2).scale(d).translate(-n.width / 2, -n.height / 2 - 10)
|
|
103
68
|
);
|
|
104
69
|
},
|
|
105
|
-
[
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
pointRef.current = svgRef.current.createSVGPoint();
|
|
113
|
-
select(svgRef.current).call(
|
|
114
|
-
zoom$1.on("zoom", (event) => {
|
|
115
|
-
setCurrentZoom == null ? void 0 : setCurrentZoom(event.transform);
|
|
116
|
-
select(svgRef.current).select("#view").attr("transform", event.transform);
|
|
70
|
+
[v.transform, t]
|
|
71
|
+
), D = f((e) => j(e), []);
|
|
72
|
+
z(() => {
|
|
73
|
+
t && (le.current = a.current.createSVGPoint(), p(a.current).call(
|
|
74
|
+
v.on("zoom", (e) => {
|
|
75
|
+
O == null || O(e.transform), p(a.current).select("#view").attr("transform", e.transform);
|
|
117
76
|
})
|
|
118
|
-
);
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}, [viz, graph == null ? void 0 : graph.data]);
|
|
132
|
-
useEffect(() => {
|
|
133
|
-
var _a2, _b2, _c2, _d2;
|
|
134
|
-
if ((_b2 = (_a2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _a2.visualization) == null ? void 0 : _b2.type) {
|
|
135
|
-
setViz((_d2 = (_c2 = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _c2.visualization) == null ? void 0 : _d2.type);
|
|
136
|
-
}
|
|
137
|
-
}, [(_e = (_d = graph == null ? void 0 : graph.metadata.display) == null ? void 0 : _d.visualization) == null ? void 0 : _e.type]);
|
|
138
|
-
const treeOptions = useMemo(
|
|
77
|
+
));
|
|
78
|
+
}, [O, v, M, t]), z(() => {
|
|
79
|
+
F && p(a.current).on("mousemove", (e) => {
|
|
80
|
+
const n = Te(p(a.current).select("#view").node());
|
|
81
|
+
ue(n.invert(re(e)).map((r) => r.toFixed(0))), de(re(e).map((r) => r.toFixed(0)));
|
|
82
|
+
});
|
|
83
|
+
}, [F, t]), z(() => {
|
|
84
|
+
W();
|
|
85
|
+
}, [M, t == null ? void 0 : t.data]), z(() => {
|
|
86
|
+
var e, n, r, d;
|
|
87
|
+
(n = (e = t == null ? void 0 : t.metadata.display) == null ? void 0 : e.visualization) != null && n.type && H((d = (r = t == null ? void 0 : t.metadata.display) == null ? void 0 : r.visualization) == null ? void 0 : d.type);
|
|
88
|
+
}, [(J = (q = t == null ? void 0 : t.metadata.display) == null ? void 0 : q.visualization) == null ? void 0 : J.type]);
|
|
89
|
+
const V = m(
|
|
139
90
|
() => ({
|
|
140
|
-
textColor:
|
|
141
|
-
backgroundColor:
|
|
91
|
+
textColor: o.palette.text.primary,
|
|
92
|
+
backgroundColor: o.palette.background.paper,
|
|
142
93
|
nodeColor: {
|
|
143
|
-
border: (
|
|
94
|
+
border: (S ? oe : ne)(o.palette.background.paper, 0.3),
|
|
144
95
|
center: "white"
|
|
145
96
|
}
|
|
146
97
|
}),
|
|
147
|
-
[
|
|
148
|
-
)
|
|
149
|
-
const cloudOptions = useMemo(
|
|
98
|
+
[S, o.palette.background.paper, o.palette.text.primary]
|
|
99
|
+
), K = m(
|
|
150
100
|
() => ({
|
|
151
|
-
textColor:
|
|
152
|
-
backgroundColor:
|
|
101
|
+
textColor: o.palette.text.primary,
|
|
102
|
+
backgroundColor: o.palette.background.paper,
|
|
153
103
|
nodeColor: {
|
|
154
|
-
border: (
|
|
104
|
+
border: (S ? oe : ne)(o.palette.background.paper, 0.3),
|
|
155
105
|
center: "white"
|
|
156
106
|
}
|
|
157
107
|
}),
|
|
158
|
-
[
|
|
159
|
-
)
|
|
160
|
-
const visualizations = useMemo(
|
|
108
|
+
[S, o.palette.background.paper, o.palette.text.primary]
|
|
109
|
+
), X = m(
|
|
161
110
|
() => ({
|
|
162
|
-
tree: () => /* @__PURE__ */
|
|
163
|
-
|
|
111
|
+
tree: () => /* @__PURE__ */ i(
|
|
112
|
+
_e,
|
|
164
113
|
{
|
|
165
|
-
svgRef,
|
|
166
|
-
graph,
|
|
167
|
-
labelKeys,
|
|
168
|
-
onNodeSelectionChanged,
|
|
169
|
-
zoom:
|
|
170
|
-
options:
|
|
114
|
+
svgRef: a,
|
|
115
|
+
graph: t,
|
|
116
|
+
labelKeys: b,
|
|
117
|
+
onNodeSelectionChanged: D,
|
|
118
|
+
zoom: s,
|
|
119
|
+
options: V
|
|
171
120
|
}
|
|
172
121
|
),
|
|
173
|
-
cloud: () => /* @__PURE__ */
|
|
122
|
+
cloud: () => /* @__PURE__ */ i(je, { svgRef: a, graph: t, options: K })
|
|
174
123
|
}),
|
|
175
|
-
[
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
var _a3;
|
|
187
|
-
return (_a3 = get(node, _key)) == null ? void 0 : _a3.toString();
|
|
188
|
-
}).filter((val) => !!val).map((_value) => ({ id, value: _value.trim() }));
|
|
189
|
-
return value;
|
|
190
|
-
});
|
|
191
|
-
}, [graph == null ? void 0 : graph.data, labelKeys, nodeIds, runComparator]);
|
|
192
|
-
return /* @__PURE__ */ jsxs(
|
|
193
|
-
Stack,
|
|
124
|
+
[K, s, t, b, D, V]
|
|
125
|
+
), ye = m(() => $.flatMap((e) => {
|
|
126
|
+
var y, Q;
|
|
127
|
+
const n = (((y = t == null ? void 0 : t.data) == null ? void 0 : y.flat()) ?? []).find((c) => c.id === e);
|
|
128
|
+
return n ? (((Q = b == null ? void 0 : b.filter((c) => A(c, n)).pop()) == null ? void 0 : Q.label) ?? "id").split(",").map((c) => {
|
|
129
|
+
var ee;
|
|
130
|
+
return (ee = Ae(n, c)) == null ? void 0 : ee.toString();
|
|
131
|
+
}).filter((c) => !!c).map((c) => ({ id: e, value: c.trim() })) : { id: e, value: e };
|
|
132
|
+
}), [t == null ? void 0 : t.data, b, $, A]);
|
|
133
|
+
return /* @__PURE__ */ l(
|
|
134
|
+
x,
|
|
194
135
|
{
|
|
195
|
-
direction:
|
|
136
|
+
direction: E === "vertical" ? "row" : "column",
|
|
196
137
|
spacing: 1,
|
|
197
138
|
overflow: "hidden",
|
|
198
139
|
height: "100%",
|
|
199
140
|
width: "100%",
|
|
200
|
-
sx,
|
|
141
|
+
sx: se,
|
|
201
142
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
143
|
+
/* @__PURE__ */ i(x, { direction: "column", spacing: 1, sx: { position: "relative", flex: 1 }, children: /* @__PURE__ */ l(
|
|
144
|
+
T,
|
|
204
145
|
{
|
|
205
146
|
variant: "outlined",
|
|
206
147
|
sx: {
|
|
207
148
|
flex: 1,
|
|
208
149
|
position: "relative",
|
|
209
|
-
maxHeight: `calc(100vh - 64px - ${
|
|
150
|
+
maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
|
|
210
151
|
"& #viz": {
|
|
211
|
-
maxHeight: `calc(100vh - 64px - ${
|
|
152
|
+
maxHeight: `calc(100vh - 64px - ${o.spacing(1)})`,
|
|
212
153
|
width: "100%",
|
|
213
154
|
height: "100%",
|
|
214
|
-
backgroundColor:
|
|
155
|
+
backgroundColor: o.palette.background.paper
|
|
215
156
|
},
|
|
216
157
|
"& .path": {
|
|
217
|
-
transition:
|
|
218
|
-
duration:
|
|
219
|
-
})
|
|
158
|
+
transition: o.transitions.create(["opacity"], {
|
|
159
|
+
duration: o.transitions.duration.short
|
|
160
|
+
}),
|
|
161
|
+
transform: "translateY(-10px)"
|
|
220
162
|
},
|
|
221
163
|
"& .node": {
|
|
222
164
|
cursor: "pointer",
|
|
223
165
|
"& > path, & > text, & > polygon, & circle": {
|
|
224
|
-
transition:
|
|
225
|
-
duration:
|
|
166
|
+
transition: o.transitions.create(["stroke", "fill", "fill-opacity", "stroke-opacity"], {
|
|
167
|
+
duration: o.transitions.duration.short
|
|
226
168
|
})
|
|
227
169
|
},
|
|
228
170
|
"&.hover > .center": {
|
|
229
|
-
stroke:
|
|
171
|
+
stroke: k(o.palette.primary.main)
|
|
230
172
|
},
|
|
231
173
|
"&.hover > .border": {
|
|
232
|
-
stroke:
|
|
174
|
+
stroke: k(o.palette.primary.dark)
|
|
233
175
|
},
|
|
234
176
|
"&.selected > .center": {
|
|
235
|
-
stroke:
|
|
177
|
+
stroke: k(o.palette.success.main)
|
|
236
178
|
},
|
|
237
179
|
"&.selected > .border": {
|
|
238
|
-
stroke:
|
|
180
|
+
stroke: k(o.palette.success.dark)
|
|
239
181
|
},
|
|
240
182
|
"&.selected.hover > .center": {
|
|
241
|
-
stroke:
|
|
183
|
+
stroke: k(o.palette.primary.main)
|
|
242
184
|
},
|
|
243
185
|
"&.selected.hover > .border": {
|
|
244
|
-
stroke:
|
|
186
|
+
stroke: k(o.palette.primary.dark)
|
|
245
187
|
}
|
|
246
188
|
}
|
|
247
189
|
},
|
|
248
190
|
children: [
|
|
249
|
-
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
191
|
+
t ? X[M]() : /* @__PURE__ */ l(ke, { children: [
|
|
192
|
+
/* @__PURE__ */ i("svg", { id: "viz", ref: a, children: /* @__PURE__ */ i("g", { id: "view" }) }),
|
|
193
|
+
/* @__PURE__ */ i(
|
|
194
|
+
he,
|
|
253
195
|
{
|
|
254
196
|
variant: "h1",
|
|
255
197
|
color: "text.secondary",
|
|
@@ -260,23 +202,23 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
260
202
|
opacity: 0.3,
|
|
261
203
|
transform: "translateX(-50%) translateY(-50%)"
|
|
262
204
|
},
|
|
263
|
-
children:
|
|
205
|
+
children: C("graph.no.dataset")
|
|
264
206
|
}
|
|
265
207
|
)
|
|
266
208
|
] }),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
|
|
209
|
+
/* @__PURE__ */ i(
|
|
210
|
+
x,
|
|
269
211
|
{
|
|
270
212
|
direction: "column",
|
|
271
213
|
spacing: 1,
|
|
272
214
|
sx: {
|
|
273
215
|
position: "absolute",
|
|
274
|
-
top:
|
|
275
|
-
left:
|
|
276
|
-
right:
|
|
216
|
+
top: o.spacing(1),
|
|
217
|
+
left: o.spacing(1),
|
|
218
|
+
right: o.spacing(1)
|
|
277
219
|
},
|
|
278
|
-
children: /* @__PURE__ */
|
|
279
|
-
|
|
220
|
+
children: /* @__PURE__ */ l(
|
|
221
|
+
x,
|
|
280
222
|
{
|
|
281
223
|
direction: "row",
|
|
282
224
|
spacing: 1,
|
|
@@ -284,55 +226,55 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
284
226
|
"& > div:first-of-type": {
|
|
285
227
|
flex: 1,
|
|
286
228
|
maxWidth: "775px",
|
|
287
|
-
backgroundColor:
|
|
229
|
+
backgroundColor: ie(o.palette.background.paper, 0.8)
|
|
288
230
|
}
|
|
289
231
|
},
|
|
290
232
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
233
|
+
/* @__PURE__ */ i(
|
|
234
|
+
ze,
|
|
293
235
|
{
|
|
294
|
-
disablePortal:
|
|
295
|
-
onChange: (
|
|
296
|
-
onKeyDown:
|
|
297
|
-
options:
|
|
236
|
+
disablePortal: !0,
|
|
237
|
+
onChange: (e, n) => xe(n.id),
|
|
238
|
+
onKeyDown: ve,
|
|
239
|
+
options: ye,
|
|
298
240
|
sx: { width: "400px" },
|
|
299
|
-
getOptionLabel: (
|
|
300
|
-
filterOptions: (
|
|
301
|
-
renderOption: (
|
|
302
|
-
renderInput: (
|
|
241
|
+
getOptionLabel: (e) => e.value,
|
|
242
|
+
filterOptions: (e, n) => e.filter((r) => r.value.toLowerCase().includes(n.inputValue)),
|
|
243
|
+
renderOption: (e, n) => /* @__PURE__ */ Ce("li", { ...e, key: n.id + n.value }, n.value),
|
|
244
|
+
renderInput: (e) => /* @__PURE__ */ i(Se, { ...e, error: fe, label: C("graph.node.input.label") })
|
|
303
245
|
}
|
|
304
246
|
),
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
247
|
+
/* @__PURE__ */ l(Ee, { sx: { minWidth: "150px", backgroundColor: ie(o.palette.background.paper, 0.8) }, children: [
|
|
248
|
+
/* @__PURE__ */ i(Ie, { id: "viz-label", children: C("graph.visualization") }),
|
|
249
|
+
/* @__PURE__ */ i(
|
|
250
|
+
Oe,
|
|
309
251
|
{
|
|
310
|
-
label:
|
|
252
|
+
label: C("graph.visualization"),
|
|
311
253
|
labelId: "viz-label",
|
|
312
|
-
value:
|
|
313
|
-
onChange: (
|
|
254
|
+
value: M,
|
|
255
|
+
onChange: (e) => H(e.target.value),
|
|
314
256
|
sx: { textTransform: "capitalize" },
|
|
315
|
-
children: Object.keys(
|
|
257
|
+
children: Object.keys(X).map((e) => /* @__PURE__ */ i(Ne, { value: e, sx: { textTransform: "capitalize" }, children: e }, e))
|
|
316
258
|
}
|
|
317
259
|
)
|
|
318
260
|
] }),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
|
|
261
|
+
/* @__PURE__ */ i(
|
|
262
|
+
$e,
|
|
321
263
|
{
|
|
322
|
-
disabled:
|
|
323
|
-
expand:
|
|
324
|
-
onClick: () =>
|
|
325
|
-
"aria-expanded":
|
|
326
|
-
"aria-label":
|
|
264
|
+
disabled: h.length < 1,
|
|
265
|
+
expand: I,
|
|
266
|
+
onClick: () => B(!I),
|
|
267
|
+
"aria-expanded": I,
|
|
268
|
+
"aria-label": C("graph.show.more"),
|
|
327
269
|
size: "small",
|
|
328
270
|
sx: {
|
|
329
271
|
marginLeft: "auto !important",
|
|
330
272
|
alignSelf: "center"
|
|
331
273
|
},
|
|
332
|
-
children: /* @__PURE__ */
|
|
333
|
-
|
|
274
|
+
children: /* @__PURE__ */ i(
|
|
275
|
+
ae,
|
|
334
276
|
{
|
|
335
|
-
icon:
|
|
277
|
+
icon: E === "vertical" ? "ic:baseline-chevron-left" : "ic:baseline-expand-more",
|
|
336
278
|
fontSize: "medium"
|
|
337
279
|
}
|
|
338
280
|
)
|
|
@@ -343,64 +285,64 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
343
285
|
)
|
|
344
286
|
}
|
|
345
287
|
),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
288
|
+
/* @__PURE__ */ i(
|
|
289
|
+
T,
|
|
348
290
|
{
|
|
349
|
-
variant:
|
|
350
|
-
elevation:
|
|
291
|
+
variant: w ? "elevation" : "outlined",
|
|
292
|
+
elevation: w ? 4 : 0,
|
|
351
293
|
sx: {
|
|
352
294
|
position: "absolute",
|
|
353
|
-
bottom:
|
|
354
|
-
right:
|
|
295
|
+
bottom: o.spacing(0.5),
|
|
296
|
+
right: o.spacing(0.5),
|
|
355
297
|
px: 1,
|
|
356
298
|
py: 0.5,
|
|
357
299
|
border: "none !important"
|
|
358
300
|
},
|
|
359
|
-
children: /* @__PURE__ */
|
|
360
|
-
|
|
361
|
-
|
|
301
|
+
children: /* @__PURE__ */ l(x, { direction: "row", spacing: 0.5, alignItems: "center", children: [
|
|
302
|
+
w && /* @__PURE__ */ l("span", { children: [
|
|
303
|
+
s.x.toFixed(0),
|
|
362
304
|
", ",
|
|
363
|
-
|
|
305
|
+
s.y.toFixed(0),
|
|
364
306
|
" (",
|
|
365
|
-
|
|
307
|
+
s.k.toFixed(2),
|
|
366
308
|
"x",
|
|
367
309
|
")"
|
|
368
310
|
] }),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
311
|
+
/* @__PURE__ */ i(
|
|
312
|
+
Me,
|
|
371
313
|
{
|
|
372
|
-
size:
|
|
373
|
-
onClick: () =>
|
|
374
|
-
disabled:
|
|
375
|
-
children: /* @__PURE__ */
|
|
314
|
+
size: w ? "small" : "medium",
|
|
315
|
+
onClick: () => W(),
|
|
316
|
+
disabled: s.k === P.k && s.x === 0 && s.y === 0,
|
|
317
|
+
children: /* @__PURE__ */ i(ae, { icon: "ic:baseline-refresh", fontSize: w ? "small" : "medium" })
|
|
376
318
|
}
|
|
377
319
|
)
|
|
378
320
|
] })
|
|
379
321
|
}
|
|
380
322
|
),
|
|
381
|
-
|
|
382
|
-
|
|
323
|
+
F && /* @__PURE__ */ i(
|
|
324
|
+
T,
|
|
383
325
|
{
|
|
384
326
|
variant: "elevation",
|
|
385
327
|
elevation: 4,
|
|
386
328
|
sx: {
|
|
387
329
|
position: "absolute",
|
|
388
|
-
bottom:
|
|
389
|
-
left:
|
|
330
|
+
bottom: o.spacing(0.5),
|
|
331
|
+
left: o.spacing(0.5),
|
|
390
332
|
px: 1,
|
|
391
333
|
py: 0.5
|
|
392
334
|
},
|
|
393
|
-
children: /* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ i("code", { children: /* @__PURE__ */ l(x, { direction: "row", spacing: 1, children: [
|
|
336
|
+
/* @__PURE__ */ l("span", { children: [
|
|
395
337
|
"(",
|
|
396
338
|
"abs: ",
|
|
397
|
-
|
|
339
|
+
me.join(", "),
|
|
398
340
|
")"
|
|
399
341
|
] }),
|
|
400
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ l("span", { children: [
|
|
401
343
|
"(",
|
|
402
344
|
"rel: ",
|
|
403
|
-
|
|
345
|
+
ce.join(", "),
|
|
404
346
|
")"
|
|
405
347
|
] })
|
|
406
348
|
] }) })
|
|
@@ -409,21 +351,21 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
409
351
|
]
|
|
410
352
|
}
|
|
411
353
|
) }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
354
|
+
/* @__PURE__ */ i(
|
|
355
|
+
Pe,
|
|
414
356
|
{
|
|
415
|
-
in:
|
|
416
|
-
orientation:
|
|
417
|
-
appear:
|
|
418
|
-
unmountOnExit:
|
|
419
|
-
children: /* @__PURE__ */
|
|
420
|
-
|
|
357
|
+
in: I && h.length > 0,
|
|
358
|
+
orientation: E === "vertical" ? "horizontal" : "vertical",
|
|
359
|
+
appear: !0,
|
|
360
|
+
unmountOnExit: !0,
|
|
361
|
+
children: /* @__PURE__ */ i(
|
|
362
|
+
x,
|
|
421
363
|
{
|
|
422
364
|
direction: "column",
|
|
423
365
|
spacing: 1,
|
|
424
|
-
sx:
|
|
366
|
+
sx: E === "vertical" ? { width: "450px", height: "100%" } : { width: "100%", height: "300px" },
|
|
425
367
|
pb: 1,
|
|
426
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ i(He, { selectedNodeIds: h, findNode: be })
|
|
427
369
|
}
|
|
428
370
|
)
|
|
429
371
|
}
|
|
@@ -433,5 +375,5 @@ const Graph = ({ graph, sx = {} }) => {
|
|
|
433
375
|
);
|
|
434
376
|
};
|
|
435
377
|
export {
|
|
436
|
-
|
|
378
|
+
rt as default
|
|
437
379
|
};
|