@cyvest/cyvest-vis 5.4.0 → 6.0.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/README.md +57 -50
- package/dist/index.cjs +537 -637
- package/dist/index.d.cts +49 -60
- package/dist/index.d.ts +49 -60
- package/dist/index.js +541 -636
- package/dist/styles.css +29 -86
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
# @cyvest/cyvest-vis
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components for exploring the observable relationship graph of a Cyvest
|
|
4
|
+
investigation with Cytoscape and `d3-force`.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- Built on `@cyvest/cyvest-js` investigation and graph helpers
|
|
8
|
-
- Two views: observables graph and investigation hierarchy
|
|
9
|
-
- Layouts: ELK `stress` for observables, Dagre `LR` for investigation
|
|
10
|
-
- Professional built-in SVG icons for nodes
|
|
11
|
-
- Label truncation with full-value events
|
|
12
|
-
- Themeable with CSS variables and typed React props
|
|
13
|
-
|
|
14
|
-
## Install / Build
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pnpm install
|
|
18
|
-
pnpm --filter @cyvest/cyvest-vis build
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Run tests:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
pnpm --filter @cyvest/cyvest-vis test
|
|
25
|
-
```
|
|
6
|
+
The default design uses a neutral canvas, compact nodes, thin edges, and a
|
|
7
|
+
restrained level palette. Color is limited to security-level contours.
|
|
26
8
|
|
|
27
9
|
## Usage
|
|
28
10
|
|
|
@@ -33,43 +15,68 @@ import "@cyvest/cyvest-vis/styles.css";
|
|
|
33
15
|
<CyvestGraph
|
|
34
16
|
investigation={investigation}
|
|
35
17
|
height={620}
|
|
36
|
-
initialView="observables"
|
|
37
18
|
onNodeSelect={(event) => {
|
|
38
|
-
console.log(event.nodeId, event.label
|
|
19
|
+
console.log(event.nodeId, event.label);
|
|
39
20
|
}}
|
|
40
21
|
/>
|
|
41
22
|
```
|
|
42
23
|
|
|
43
|
-
|
|
24
|
+
`CyvestGraph` and `CyvestObservablesView` render the same observable graph.
|
|
25
|
+
`CyvestGraph` is the concise public entry point.
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
27
|
+
Hovering a node isolates its immediate neighborhood. The initial placement is
|
|
28
|
+
deterministic; a live force simulation then settles the graph and is reheated
|
|
29
|
+
while nodes are dragged.
|
|
30
|
+
|
|
31
|
+
## Force layout
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<CyvestGraph
|
|
35
|
+
investigation={investigation}
|
|
36
|
+
layout={{
|
|
37
|
+
linkDistance: 116,
|
|
38
|
+
chargeStrength: -420,
|
|
39
|
+
collisionPadding: 30,
|
|
40
|
+
radialStep: 126,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Set `physics={false}` to keep only the deterministic initial placement.
|
|
46
|
+
|
|
47
|
+
Available settings include `linkDistance`, `linkStrength`, `chargeStrength`,
|
|
48
|
+
`collisionPadding`, `radialStep`, `radialStrength`, `centerStrength`,
|
|
49
|
+
`iterations`, `padding`, and animation options.
|
|
52
50
|
|
|
53
51
|
## Theming
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
--cyvest-accent: #1f6feb;
|
|
66
|
-
--cyvest-font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
|
|
67
|
-
}
|
|
53
|
+
```tsx
|
|
54
|
+
<CyvestGraph
|
|
55
|
+
investigation={investigation}
|
|
56
|
+
theme={{
|
|
57
|
+
background: "#ffffff",
|
|
58
|
+
panelText: "#111827",
|
|
59
|
+
accent: "#334155",
|
|
60
|
+
edgeColor: "#d5dbe3",
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
68
63
|
```
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
Use `DARK_CYVEST_THEME` for the built-in dark theme.
|
|
66
|
+
|
|
67
|
+
## Exports
|
|
68
|
+
|
|
69
|
+
- `CyvestGraph`
|
|
70
|
+
- `CyvestObservablesView`
|
|
71
|
+
- `computeForcePositions`
|
|
72
|
+
- `createForceLayout`
|
|
73
|
+
- `startForceSimulation`
|
|
74
|
+
- theme, event, icon, label, color, and observable graph data types
|
|
75
|
+
|
|
76
|
+
## Development
|
|
71
77
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
78
|
+
```bash
|
|
79
|
+
corepack pnpm -C js --filter @cyvest/cyvest-vis test:ci
|
|
80
|
+
corepack pnpm -C js --filter @cyvest/cyvest-vis build
|
|
81
|
+
corepack pnpm -C js --filter @cyvest/cyvest-app dev
|
|
82
|
+
```
|