@cyvest/cyvest-vis 5.2.0 → 5.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/README.md +44 -123
- package/dist/index.cjs +962 -1584
- package/dist/index.d.cts +131 -173
- package/dist/index.d.ts +131 -173
- package/dist/index.js +955 -1609
- package/dist/styles.css +132 -0
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
# @cyvest/cyvest-vis
|
|
2
2
|
|
|
3
|
-
React components for
|
|
3
|
+
Cytoscape-based React components for rendering Cyvest investigations.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Highlights
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
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
13
|
|
|
14
|
-
##
|
|
14
|
+
## Install / Build
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
pnpm install
|
|
17
|
+
pnpm install
|
|
18
18
|
pnpm --filter @cyvest/cyvest-vis build
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -26,129 +26,50 @@ pnpm --filter @cyvest/cyvest-vis test
|
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
28
28
|
|
|
29
|
-
### Basic Usage
|
|
30
|
-
|
|
31
29
|
```tsx
|
|
32
30
|
import { CyvestGraph } from "@cyvest/cyvest-vis";
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
function InvestigationView({ investigation }: { investigation: CyvestInvestigation }) {
|
|
36
|
-
return (
|
|
37
|
-
<CyvestGraph
|
|
38
|
-
investigation={investigation}
|
|
39
|
-
height={600}
|
|
40
|
-
showViewToggle
|
|
41
|
-
onNodeClick={(id) => console.log("Selected:", id)}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Components
|
|
48
|
-
|
|
49
|
-
#### `CyvestGraph`
|
|
31
|
+
import "@cyvest/cyvest-vis/styles.css";
|
|
50
32
|
|
|
51
|
-
Main component with toggle between Observables and Investigation views.
|
|
52
|
-
|
|
53
|
-
```tsx
|
|
54
33
|
<CyvestGraph
|
|
55
34
|
investigation={investigation}
|
|
56
|
-
height={
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onNodeClick={(nodeId) => {}}
|
|
61
|
-
/>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
#### `ObservablesGraph`
|
|
65
|
-
|
|
66
|
-
Force-directed graph showing all observables and their relationships.
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
import { ObservablesGraph } from "@cyvest/cyvest-vis";
|
|
70
|
-
|
|
71
|
-
<ObservablesGraph
|
|
72
|
-
investigation={investigation}
|
|
73
|
-
height={600}
|
|
74
|
-
width="100%"
|
|
75
|
-
showControls={true} // Show force layout controls
|
|
76
|
-
forceConfig={{
|
|
77
|
-
chargeStrength: -200,
|
|
78
|
-
linkDistance: 80,
|
|
79
|
-
collisionRadius: 45,
|
|
80
|
-
}}
|
|
81
|
-
onNodeClick={(nodeId) => {}}
|
|
82
|
-
onNodeDoubleClick={(nodeId) => {}}
|
|
83
|
-
/>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
#### `InvestigationGraph`
|
|
87
|
-
|
|
88
|
-
Hierarchical graph showing root → tags → checks structure.
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
import { InvestigationGraph } from "@cyvest/cyvest-vis";
|
|
92
|
-
|
|
93
|
-
<InvestigationGraph
|
|
94
|
-
investigation={investigation}
|
|
95
|
-
height={600}
|
|
96
|
-
width="100%"
|
|
97
|
-
onNodeClick={(nodeId, nodeType) => {
|
|
98
|
-
// nodeType: "root" | "check" | "tag"
|
|
35
|
+
height={620}
|
|
36
|
+
initialView="observables"
|
|
37
|
+
onNodeSelect={(event) => {
|
|
38
|
+
console.log(event.nodeId, event.label, event.nodeType);
|
|
99
39
|
}}
|
|
100
40
|
/>
|
|
101
41
|
```
|
|
102
42
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
InvestigationGraphProps,
|
|
128
|
-
ForceLayoutConfig,
|
|
129
|
-
ObservableNodeData,
|
|
130
|
-
InvestigationNodeData,
|
|
131
|
-
InvestigationNodeType,
|
|
132
|
-
} from "@cyvest/cyvest-vis";
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### Force Layout Configuration
|
|
136
|
-
|
|
137
|
-
```tsx
|
|
138
|
-
interface ForceLayoutConfig {
|
|
139
|
-
chargeStrength: number; // Repulsion strength (default: -200)
|
|
140
|
-
linkDistance: number; // Target link distance (default: 80)
|
|
141
|
-
centerStrength: number; // Center pull strength (default: 0.05)
|
|
142
|
-
collisionRadius: number; // Node collision radius (default: 45)
|
|
143
|
-
iterations: number; // Iterations for static layout (default: 300)
|
|
43
|
+
## Main Exports
|
|
44
|
+
|
|
45
|
+
- `CyvestGraph`
|
|
46
|
+
- `CyvestObservablesView`
|
|
47
|
+
- `CyvestInvestigationView`
|
|
48
|
+
- `createElkLayout`
|
|
49
|
+
- `truncateLabel`
|
|
50
|
+
- `getObservableIconSvg`
|
|
51
|
+
- `getInvestigationIconSvg`
|
|
52
|
+
|
|
53
|
+
## Theming
|
|
54
|
+
|
|
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;
|
|
144
67
|
}
|
|
145
68
|
```
|
|
146
69
|
|
|
147
|
-
##
|
|
148
|
-
|
|
149
|
-
- React 19+
|
|
150
|
-
- React DOM 19+
|
|
151
|
-
|
|
152
|
-
## License
|
|
70
|
+
## Breaking Changes vs v1
|
|
153
71
|
|
|
154
|
-
|
|
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`.
|