@cccsaurora/clue-ui 0.15.0-dev.30 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +141 -37
- package/ActionForm-DgfJwTzt.js +0 -436
- package/AnnotationPreview-BvNpZOP0.js +0 -188
- package/ClueEnrichContext-DXwLVp0M.js +0 -518
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_Map-kgDsDYxq.js +0 -64
- package/_MapCache-DabaaWfq.js +0 -161
- package/_Uint8Array-BlVVH1tp.js +0 -129
- package/_baseAssignValue-CNbcU6Nb.js +0 -25
- package/_baseClone-D3a8Pa4T.js +0 -284
- package/_baseExtremum-B1o1zHjR.js +0 -33
- package/_baseFlatten-D4huXoEI.js +0 -92
- package/_baseGet-BSK_nnoz.js +0 -109
- package/_baseIsEqual-B5xLoweL.js +0 -238
- package/_baseIteratee-p6Nj07-n.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-CpupKWcL.js +0 -89
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BpVy5xMi.js +0 -63
- package/_getPrototype-D1LAdQKO.js +0 -5
- package/_getTag-D3ToyefI.js +0 -126
- package/api/lookup/enrich.d.ts +0 -10
- package/api/lookup/index.d.ts +0 -5
- package/api/lookup/types.d.ts +0 -5
- package/api/lookup/types_detection.d.ts +0 -5
- package/cloneDeep-CjP5k9zW.js +0 -8
- package/components/AnnotationBody.d.ts +0 -6
- package/components/AnnotationBody.js +0 -56
- package/components/AnnotationDetailPopover.d.ts +0 -14
- package/components/AnnotationDetailPopover.js +0 -61
- package/components/AnnotationDetails.d.ts +0 -8
- package/components/AnnotationDetails.js +0 -172
- package/components/AnnotationEntry.d.ts +0 -6
- package/components/AnnotationEntry.js +0 -59
- package/components/AnnotationPreview.d.ts +0 -14
- package/components/AnnotationPreview.js +0 -11
- package/components/ClassificationChip.d.ts +0 -11
- package/components/ClassificationChip.js +0 -52
- package/components/CountBadge.d.ts +0 -8
- package/components/CountBadge.js +0 -34
- package/components/EnrichedCard.d.ts +0 -14
- package/components/EnrichedCard.js +0 -162
- package/components/EnrichedChip.d.ts +0 -9
- package/components/EnrichedChip.js +0 -176
- package/components/EnrichedTypography.d.ts +0 -16
- package/components/EnrichedTypography.js +0 -178
- package/components/ErrorBoundary.d.ts +0 -15
- package/components/ErrorBoundary.js +0 -36
- package/components/RetryFailedEnrichments.d.ts +0 -2
- package/components/RetryFailedEnrichments.js +0 -13
- package/components/SourcePicker.d.ts +0 -2
- package/components/SourcePicker.js +0 -98
- package/components/actions/ActionForm.d.ts +0 -6
- package/components/actions/ActionForm.js +0 -16
- package/components/actions/ExecutePopover.d.ts +0 -10
- package/components/actions/ExecutePopover.js +0 -93
- package/components/actions/ResultModal.d.ts +0 -9
- package/components/actions/ResultModal.js +0 -46
- package/components/actions/form/schemaAdapter.d.ts +0 -3
- package/components/actions/form/schemaAdapter.js +0 -47
- package/components/display/graph/ExpandMoreButton.d.ts +0 -7
- package/components/display/graph/ExpandMoreButton.js +0 -18
- package/components/display/graph/elements/NodeCard.d.ts +0 -10
- package/components/display/graph/elements/NodeCard.js +0 -146
- package/components/display/graph/elements/NodeTag.d.ts +0 -9
- package/components/display/graph/elements/NodeTag.js +0 -17
- package/components/display/graph/index.d.ts +0 -9
- package/components/display/graph/index.js +0 -438
- package/components/display/graph/visualizations/Leaf.d.ts +0 -25
- package/components/display/graph/visualizations/Leaf.js +0 -125
- package/components/display/graph/visualizations/cloud/index.d.ts +0 -24
- package/components/display/graph/visualizations/cloud/index.js +0 -141
- package/components/display/graph/visualizations/icons/BaseIcon.d.ts +0 -12
- package/components/display/graph/visualizations/icons/BaseIcon.js +0 -37
- package/components/display/graph/visualizations/icons/BugIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/BugIcon.js +0 -18
- package/components/display/graph/visualizations/icons/HostIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/HostIcon.js +0 -24
- package/components/display/graph/visualizations/icons/NetworkIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/NetworkIcon.js +0 -24
- package/components/display/graph/visualizations/icons/ProcessIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/ProcessIcon.js +0 -18
- package/components/display/graph/visualizations/icons/TargetIcon.d.ts +0 -5
- package/components/display/graph/visualizations/icons/TargetIcon.js +0 -19
- package/components/display/graph/visualizations/icons/index.d.ts +0 -2
- package/components/display/graph/visualizations/icons/index.js +0 -16
- package/components/display/graph/visualizations/panels/NodePanel.d.ts +0 -8
- package/components/display/graph/visualizations/panels/NodePanel.js +0 -12
- package/components/display/graph/visualizations/tree/BundleLine.d.ts +0 -29
- package/components/display/graph/visualizations/tree/BundleLine.js +0 -121
- package/components/display/graph/visualizations/tree/Triangle.d.ts +0 -9
- package/components/display/graph/visualizations/tree/Triangle.js +0 -26
- package/components/display/graph/visualizations/tree/index.d.ts +0 -36
- package/components/display/graph/visualizations/tree/index.js +0 -485
- package/components/display/graph/visualizations/tree/types.d.ts +0 -11
- package/components/display/graph/visualizations/tree/types.js +0 -1
- package/components/display/icons/Iconified.d.ts +0 -9
- package/components/display/icons/Iconified.js +0 -29
- package/components/display/json/index.d.ts +0 -14
- package/components/display/json/index.js +0 -12
- package/components/display/markdown/DynamicTabs.d.ts +0 -8
- package/components/display/markdown/DynamicTabs.js +0 -26
- package/components/display/markdown/index.d.ts +0 -9
- package/components/display/markdown/index.js +0 -13389
- package/components/display/markdown/markdownPlugins/tabs.d.ts +0 -3
- package/components/display/markdown/markdownPlugins/tabs.js +0 -4
- package/components/enrichment/EnrichPopover.d.ts +0 -10
- package/components/enrichment/EnrichPopover.js +0 -88
- package/components/fetchers/Fetcher.d.ts +0 -17
- package/components/fetchers/Fetcher.js +0 -188
- package/components/fetchers/PreviewModal.d.ts +0 -8
- package/components/fetchers/PreviewModal.js +0 -22
- package/components/fetchers/StatusChip.d.ts +0 -8
- package/components/fetchers/StatusChip.js +0 -30
- package/components/group/Entry.d.ts +0 -8
- package/components/group/Entry.js +0 -15
- package/components/group/Group.d.ts +0 -12
- package/components/group/Group.js +0 -15
- package/components/group/GroupControl.d.ts +0 -4
- package/components/group/GroupControl.js +0 -103
- package/components/stats/QueryStatus.d.ts +0 -4
- package/components/stats/QueryStatus.js +0 -61
- package/countBy-C69WslUA.js +0 -14
- package/data/event.d.ts +0 -12
- package/data/event.js +0 -8
- package/database/index.d.ts +0 -4
- package/database/index.js +0 -4
- package/database/selector.schema.json.d.ts +0 -119
- package/database/status.schema.json.d.ts +0 -38
- package/database/types.d.ts +0 -64
- package/debounce-bV0h5FC5.js +0 -92
- package/en/translation.json +0 -135
- package/fr/translation.json +0 -135
- package/get-D3C3lEU3.js +0 -8
- package/groupBy-DC2oOuBN.js +0 -14
- package/hooks/ClueActionContext.d.ts +0 -86
- package/hooks/ClueActionContext.js +0 -18
- package/hooks/ClueComponentContext.d.ts +0 -10
- package/hooks/ClueComponentContext.js +0 -40
- package/hooks/ClueConfigProvider.d.ts +0 -12
- package/hooks/ClueConfigProvider.js +0 -23
- package/hooks/ClueDatabaseContext.d.ts +0 -10
- package/hooks/ClueDatabaseContext.js +0 -23
- package/hooks/ClueEnrichContext.d.ts +0 -6
- package/hooks/ClueEnrichContext.js +0 -15
- package/hooks/ClueEnrichContextType.d.ts +0 -113
- package/hooks/ClueEnrichProps.d.ts +0 -81
- package/hooks/ClueFetcherContext.d.ts +0 -35
- package/hooks/ClueFetcherContext.js +0 -88
- package/hooks/ClueGroupContext.d.ts +0 -14
- package/hooks/ClueGroupContext.js +0 -23
- package/hooks/CluePopupContext.d.ts +0 -24
- package/hooks/CluePopupContext.js +0 -12
- package/hooks/ClueProvider.d.ts +0 -9
- package/hooks/ClueProvider.js +0 -14
- package/hooks/selectors.d.ts +0 -10
- package/hooks/selectors.js +0 -24
- package/hooks/useAnnotations.d.ts +0 -24
- package/hooks/useAnnotations.js +0 -69
- package/hooks/useClue.d.ts +0 -4
- package/hooks/useClue.js +0 -8
- package/hooks/useClueActions.d.ts +0 -4
- package/hooks/useClueActions.js +0 -5
- package/hooks/useClueConfig.d.ts +0 -1
- package/hooks/useClueConfig.js +0 -8
- package/hooks/useClueTypeConfig.d.ts +0 -17
- package/hooks/useClueTypeConfig.js +0 -7
- package/hooks/useComparator.d.ts +0 -16
- package/hooks/useComparator.js +0 -1060
- package/hooks/useErrors.d.ts +0 -17
- package/hooks/useErrors.js +0 -35
- package/hooks/useMyHighlights.d.ts +0 -11
- package/hooks/useMyHighlights.js +0 -74
- package/hooks/useMyLocalStorage.d.ts +0 -16
- package/hooks/useMyLocalStorage.js +0 -80
- package/iconify-CXMreGTg.js +0 -1782
- package/icons/Action.d.ts +0 -9
- package/icons/Action.js +0 -90
- package/icons/Assessment.d.ts +0 -11
- package/icons/Assessment.js +0 -123
- package/icons/Context.d.ts +0 -12
- package/icons/Context.js +0 -83
- package/icons/Opinion.d.ts +0 -11
- package/icons/Opinion.js +0 -125
- package/icons/iconMap.d.ts +0 -7
- package/icons/iconMap.js +0 -10
- package/identity-CPGTqrE4.js +0 -6
- package/index-BDVjGvMI.js +0 -696
- package/index-BDrtH5ec.js +0 -465
- package/index-C9lySIVX.js +0 -1172
- package/index-DJYqRcxJ.js +0 -15750
- package/index-Dn2NHyXg.js +0 -17654
- package/index.css +0 -21
- package/isEmpty-BQkZubqU.js +0 -29
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/isUndefined-CE8h73dH.js +0 -10
- package/last-CUCl67Im.js +0 -7
- package/main.d.ts +0 -42
- package/main.js +0 -70
- package/public/manifest.json +0 -16
- package/public/robots.txt +0 -3
- package/public/svg/dark/clue-h.svg +0 -52
- package/public/svg/dark/clue-icon1-simple.svg +0 -33
- package/public/svg/dark/clue-icon1.svg +0 -44
- package/public/svg/dark/clue-icon2-simple.svg +0 -26
- package/public/svg/dark/clue-icon2.svg +0 -37
- package/public/svg/dark/clue-name.svg +0 -14
- package/public/svg/dark/clue-v.svg +0 -52
- package/public/svg/light/clue-h.svg +0 -60
- package/public/svg/light/clue-icon1-simple.svg +0 -37
- package/public/svg/light/clue-icon1.svg +0 -48
- package/public/svg/light/clue-icon2-simple.svg +0 -30
- package/public/svg/light/clue-icon2.svg +0 -41
- package/public/svg/light/clue-name.svg +0 -14
- package/public/svg/light/clue-v.svg +0 -60
- package/sortBy-B-UKp4GT.js +0 -100
- package/sumBy-MYkDPHZL.js +0 -8
- package/tabs-xGuUGsJd.js +0 -254
- package/text/Frequency.d.ts +0 -9
- package/text/Frequency.js +0 -49
- package/toFinite-CArjry_l.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/types/EnrichmentProps.d.ts +0 -73
- package/types/RunningActionData.d.ts +0 -15
- package/types/WithActionData.d.ts +0 -9
- package/types/action.d.ts +0 -25
- package/types/config.d.ts +0 -16
- package/types/fetcher.d.ts +0 -60
- package/types/graph.d.ts +0 -101
- package/types/lookup.d.ts +0 -62
- package/types/network.d.ts +0 -9
- package/useClueTypeConfig-D9ZSxa4F.js +0 -3096
- package/utils/chain.d.ts +0 -14
- package/utils/chain.js +0 -106
- package/utils/classificationParser.d.ts +0 -195
- package/utils/classificationParser.js +0 -553
- package/utils/constants.d.ts +0 -26
- package/utils/constants.js +0 -36
- package/utils/graph.d.ts +0 -13
- package/utils/graph.js +0 -79
- package/utils/hashUtil.d.ts +0 -6
- package/utils/hashUtil.js +0 -11
- package/utils/line.d.ts +0 -28
- package/utils/line.js +0 -136
- package/utils/loggerUtil.d.ts +0 -6
- package/utils/loggerUtil.js +0 -8
- package/utils/sessionStorage.d.ts +0 -9
- package/utils/sessionStorage.js +0 -51
- package/utils/utils.d.ts +0 -13
- package/utils/utils.js +0 -11
- package/utils/window.d.ts +0 -3
- package/utils/window.js +0 -24
- package/utils-CxIhC2xH.js +0 -4182
|
@@ -1,125 +0,0 @@
|
|
|
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
|
-
}
|
|
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
|
|
27
|
-
}) => {
|
|
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);
|
|
44
|
-
},
|
|
45
|
-
[nodeId, onClick, isSelected]
|
|
46
|
-
);
|
|
47
|
-
const handleOnHoverChanged = useCallback(
|
|
48
|
-
(value) => {
|
|
49
|
-
setIsHovered(value);
|
|
50
|
-
onHoverChanged == null ? void 0 : onHoverChanged(nodeId, value);
|
|
51
|
-
},
|
|
52
|
-
[nodeId, onHoverChanged]
|
|
53
|
-
);
|
|
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(
|
|
64
|
-
"g",
|
|
65
|
-
{
|
|
66
|
-
id: "node-" + nodeId.replace(/[^A-Za-z0-9]*/g, ""),
|
|
67
|
-
style: { strokeLinecap: "round" },
|
|
68
|
-
className: classNames.join(" "),
|
|
69
|
-
onClick: handleOnClick,
|
|
70
|
-
onMouseOver: () => handleOnHoverChanged(true),
|
|
71
|
-
onMouseLeave: () => handleOnHoverChanged(false),
|
|
72
|
-
children: [
|
|
73
|
-
children,
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
75
|
-
"path",
|
|
76
|
-
{
|
|
77
|
-
className: "border",
|
|
78
|
-
d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
|
|
79
|
-
style: {
|
|
80
|
-
strokeOpacity: nodeOpacity,
|
|
81
|
-
...style,
|
|
82
|
-
strokeWidth: `calc(${strokeWidth} * 2)`,
|
|
83
|
-
stroke: style.stroke ?? nodeColor.border
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
nodeId + "-border"
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
"path",
|
|
90
|
-
{
|
|
91
|
-
className: "center",
|
|
92
|
-
d: `M ${x} ${y} L ${x} ${y + Math.max(height, 0)}`,
|
|
93
|
-
style: {
|
|
94
|
-
strokeOpacity: nodeOpacity,
|
|
95
|
-
...style,
|
|
96
|
-
strokeWidth,
|
|
97
|
-
stroke: style.fill ?? nodeColor.center
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
nodeId + "-middle"
|
|
101
|
-
),
|
|
102
|
-
(isHovered || alwaysShowText) && label.split("\n").reverse().map((_label, index, arr) => /* @__PURE__ */ jsx(
|
|
103
|
-
"text",
|
|
104
|
-
{
|
|
105
|
-
x: x + letterWidth,
|
|
106
|
-
y: y - letterSize / 2 + arr.length - index * letterSize,
|
|
107
|
-
fill: textColor,
|
|
108
|
-
style: {
|
|
109
|
-
cursor: "default",
|
|
110
|
-
fontFamily: '"Lucida Console", monospace',
|
|
111
|
-
fontSize: letterSize + "px",
|
|
112
|
-
fillOpacity: nodeOpacity
|
|
113
|
-
},
|
|
114
|
-
children: _label
|
|
115
|
-
},
|
|
116
|
-
nodeId + "-label-" + _label
|
|
117
|
-
))
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
nodeId
|
|
121
|
-
);
|
|
122
|
-
};
|
|
123
|
-
export {
|
|
124
|
-
Leaf as default
|
|
125
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NestedDataset } from "../../../../../types/graph";
|
|
2
|
-
import { MutableRefObject } from 'react';
|
|
3
|
-
|
|
4
|
-
declare const DEFAULT_OPTIONS: {
|
|
5
|
-
width: string;
|
|
6
|
-
backgroundColor: string;
|
|
7
|
-
textColor: string;
|
|
8
|
-
nodeColor: {
|
|
9
|
-
border: string;
|
|
10
|
-
center: string;
|
|
11
|
-
};
|
|
12
|
-
letterSize: number;
|
|
13
|
-
letterWidth: number;
|
|
14
|
-
nodeRadius: number;
|
|
15
|
-
lineWidth: number;
|
|
16
|
-
circlePadding: any;
|
|
17
|
-
};
|
|
18
|
-
type Options = Partial<typeof DEFAULT_OPTIONS>;
|
|
19
|
-
declare const _default: import('react').NamedExoticComponent<{
|
|
20
|
-
svgRef?: MutableRefObject<SVGSVGElement>;
|
|
21
|
-
graph: NestedDataset;
|
|
22
|
-
options?: Options;
|
|
23
|
-
}>;
|
|
24
|
-
export default _default;
|
|
@@ -1,141 +0,0 @@
|
|
|
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-DJYqRcxJ.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-C69WslUA.js";
|
|
8
|
-
import { s as sumBy } from "../../../../../sumBy-MYkDPHZL.js";
|
|
9
|
-
import { memo, useRef, useMemo, useCallback } from "react";
|
|
10
|
-
import Leaf from "../Leaf.js";
|
|
11
|
-
const DEFAULT_OPTIONS = {
|
|
12
|
-
width: "100%",
|
|
13
|
-
backgroundColor: "grey",
|
|
14
|
-
textColor: "black",
|
|
15
|
-
nodeColor: {
|
|
16
|
-
border: "black",
|
|
17
|
-
center: "white"
|
|
18
|
-
},
|
|
19
|
-
letterSize: 12,
|
|
20
|
-
letterWidth: 8,
|
|
21
|
-
nodeRadius: 8,
|
|
22
|
-
lineWidth: 2,
|
|
23
|
-
circlePadding: null
|
|
24
|
-
// We'll make this dynamic
|
|
25
|
-
};
|
|
26
|
-
DEFAULT_OPTIONS.circlePadding = 3 * DEFAULT_OPTIONS.nodeRadius;
|
|
27
|
-
const Cloud = ({ svgRef, graph, options = {} }) => {
|
|
28
|
-
const {
|
|
29
|
-
width,
|
|
30
|
-
backgroundColor,
|
|
31
|
-
textColor,
|
|
32
|
-
letterSize,
|
|
33
|
-
letterWidth,
|
|
34
|
-
circlePadding,
|
|
35
|
-
nodeRadius,
|
|
36
|
-
nodeColor,
|
|
37
|
-
lineWidth
|
|
38
|
-
} = {
|
|
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()
|
|
52
|
-
}))
|
|
53
|
-
),
|
|
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)))
|
|
60
|
-
),
|
|
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
|
|
68
|
-
}))
|
|
69
|
-
),
|
|
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,
|
|
78
|
-
value: 1
|
|
79
|
-
}))
|
|
80
|
-
}));
|
|
81
|
-
return pack(
|
|
82
|
-
hierarchy({ children: data }).sum((d) => d.children ? sumBy(d.children, (c) => c.value) : d.value)
|
|
83
|
-
).children;
|
|
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]
|
|
88
|
-
);
|
|
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(
|
|
99
|
-
"path",
|
|
100
|
-
{
|
|
101
|
-
d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
|
|
102
|
-
stroke: "black",
|
|
103
|
-
strokeWidth: lineWidth + 3,
|
|
104
|
-
strokeOpacity: opacities(link)
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
108
|
-
"path",
|
|
109
|
-
{
|
|
110
|
-
d: `M ${source.x} ${source.y} L ${target.x} ${target.y}`,
|
|
111
|
-
stroke: "white",
|
|
112
|
-
strokeWidth: lineWidth,
|
|
113
|
-
strokeOpacity: opacities(link)
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
] }, source.data.id + target.data.id);
|
|
117
|
-
}),
|
|
118
|
-
cloudLocations.map((cloud) => /* @__PURE__ */ jsx("g", { children: cloud.children.map((node) => /* @__PURE__ */ jsx(
|
|
119
|
-
Leaf,
|
|
120
|
-
{
|
|
121
|
-
nodeId: node.data.id,
|
|
122
|
-
height: 0,
|
|
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
|
|
133
|
-
},
|
|
134
|
-
node.data.id
|
|
135
|
-
)) }, cloud.id))
|
|
136
|
-
] }) });
|
|
137
|
-
};
|
|
138
|
-
const Cloud$1 = memo(Cloud);
|
|
139
|
-
export {
|
|
140
|
-
Cloud$1 as default
|
|
141
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, FC, SVGProps } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface IconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
-
x?: number;
|
|
5
|
-
y?: number;
|
|
6
|
-
width?: number;
|
|
7
|
-
height?: number;
|
|
8
|
-
size?: number;
|
|
9
|
-
circleStyle?: CSSProperties;
|
|
10
|
-
}
|
|
11
|
-
declare const BaseIcon: FC<IconProps>;
|
|
12
|
-
export default BaseIcon;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
const DEFAULTS = {
|
|
4
|
-
size: 20
|
|
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(
|
|
21
|
-
"svg",
|
|
22
|
-
{
|
|
23
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
-
viewBox: "0 -960 960 960",
|
|
25
|
-
width: width ?? size,
|
|
26
|
-
height: height ?? size,
|
|
27
|
-
...trimmedProps,
|
|
28
|
-
x,
|
|
29
|
-
y,
|
|
30
|
-
children: props.children
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
] });
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
BaseIcon as default
|
|
37
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
{
|
|
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
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
BugIcon as default
|
|
18
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
{
|
|
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
|
-
"path",
|
|
14
|
-
{
|
|
15
|
-
style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
|
|
16
|
-
d: "M40-120v-80h880v80H40Zm120-120q-33 0-56.5-23.5T80-320v-440q0-33 23.5-56.5T160-840h640q33 0 56.5 23.5T880-760v440q0 33-23.5 56.5T800-240H160Zm0-80h640v-440H160v440Zm0 0v-440 440Z"
|
|
17
|
-
}
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
HostIcon as default
|
|
24
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
{
|
|
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
|
-
"path",
|
|
14
|
-
{
|
|
15
|
-
style: { transform: "scale(0.75) translateX(16%) translateY(-18%)" },
|
|
16
|
-
d: "M120-80v-280h120v-160h200v-80H320v-280h320v280H520v80h200v160h120v280H520v-280h120v-80H320v80h120v280H120Zm280-600h160v-120H400v120ZM200-160h160v-120H200v120Zm400 0h160v-120H600v120ZM480-680ZM360-280Zm240 0Z"
|
|
17
|
-
}
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
NetworkIcon as default
|
|
24
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
{
|
|
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
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
ProcessIcon as default
|
|
18
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
{
|
|
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
|
-
}
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
TargetIcon as default
|
|
19
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import BugIcon from "./BugIcon.js";
|
|
2
|
-
import HostIcon from "./HostIcon.js";
|
|
3
|
-
import NetworkIcon from "./NetworkIcon.js";
|
|
4
|
-
import ProcessIcon from "./ProcessIcon.js";
|
|
5
|
-
import TargetIcon from "./TargetIcon.js";
|
|
6
|
-
const ICON_MAP = {
|
|
7
|
-
bug: BugIcon,
|
|
8
|
-
target: TargetIcon,
|
|
9
|
-
host: HostIcon,
|
|
10
|
-
network: NetworkIcon,
|
|
11
|
-
process: ProcessIcon
|
|
12
|
-
};
|
|
13
|
-
const getIcon = (icon) => ICON_MAP[icon];
|
|
14
|
-
export {
|
|
15
|
-
getIcon as default
|
|
16
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Skeleton } from "@mui/material";
|
|
3
|
-
import NodeCard from "../../elements/NodeCard.js";
|
|
4
|
-
const NodePanel = ({ selectedNodeIds, findNode }) => {
|
|
5
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
-
selectedNodeIds.map((selectedNodeId) => findNode(selectedNodeId)).filter((node) => !!node).map((node) => /* @__PURE__ */ jsx(NodeCard, { node }, node.id)),
|
|
7
|
-
selectedNodeIds.length < 1 && /* @__PURE__ */ jsx(Skeleton, { variant: "rounded", height: 150 })
|
|
8
|
-
] });
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
NodePanel as default
|
|
12
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Bundle } from './types';
|
|
3
|
-
|
|
4
|
-
declare const BundleLine: FC<{
|
|
5
|
-
bundle: Bundle;
|
|
6
|
-
linesByLevel: {
|
|
7
|
-
[level: number]: Set<string>;
|
|
8
|
-
};
|
|
9
|
-
paddingByLevel: {
|
|
10
|
-
[level: number]: number;
|
|
11
|
-
};
|
|
12
|
-
nodeLocations: {
|
|
13
|
-
[id: string]: [number, number, number];
|
|
14
|
-
};
|
|
15
|
-
inputsByNode: {
|
|
16
|
-
[id: string]: Set<string>;
|
|
17
|
-
};
|
|
18
|
-
outputsByNode: {
|
|
19
|
-
[id: string]: Set<string>;
|
|
20
|
-
};
|
|
21
|
-
lineWidth: number;
|
|
22
|
-
linePaddingX: number;
|
|
23
|
-
linePaddingY: number;
|
|
24
|
-
maxArcRadius: number;
|
|
25
|
-
highlightedPath: Set<string>;
|
|
26
|
-
lineDirection: 'horizontal' | 'vertical';
|
|
27
|
-
colorTheme?: string;
|
|
28
|
-
}>;
|
|
29
|
-
export default BundleLine;
|