@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 CHANGED
@@ -1,28 +1,10 @@
1
1
  # @cyvest/cyvest-vis
2
2
 
3
- Cytoscape-based React components for rendering Cyvest investigations.
3
+ React components for exploring the observable relationship graph of a Cyvest
4
+ investigation with Cytoscape and `d3-force`.
4
5
 
5
- ## Highlights
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, event.nodeType);
19
+ console.log(event.nodeId, event.label);
39
20
  }}
40
21
  />
41
22
  ```
42
23
 
43
- ## Main Exports
24
+ `CyvestGraph` and `CyvestObservablesView` render the same observable graph.
25
+ `CyvestGraph` is the concise public entry point.
44
26
 
45
- - `CyvestGraph`
46
- - `CyvestObservablesView`
47
- - `CyvestInvestigationView`
48
- - `createElkLayout`
49
- - `truncateLabel`
50
- - `getObservableIconSvg`
51
- - `getInvestigationIconSvg`
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
- Use the `theme` prop or override CSS variables.
56
-
57
- ```css
58
- :root {
59
- --cyvest-background: #f4f7fb;
60
- --cyvest-grid-color: #d7dfeb;
61
- --cyvest-panel-bg: rgba(255, 255, 255, 0.96);
62
- --cyvest-panel-border: #d3dae6;
63
- --cyvest-panel-text: #172033;
64
- --cyvest-panel-muted: #556079;
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
- ## Breaking Changes vs v1
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
- - Rendering engine changed from React Flow to Cytoscape.
73
- - Events moved to `onNodeSelect` / `onEdgeSelect`.
74
- - Component names are now `CyvestObservablesView` and `CyvestInvestigationView`.
75
- - Import stylesheet with `@cyvest/cyvest-vis/styles.css`.
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
+ ```