@rokkit/graph 1.6.0 → 1.7.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 +59 -2
- package/dist/Graph.svelte +121 -72
- package/dist/GraphLegend.svelte +112 -0
- package/dist/GraphLegend.svelte.d.ts +33 -0
- package/dist/GraphState.svelte.d.ts +107 -15
- package/dist/GraphState.svelte.js +186 -3
- package/dist/controls/BundleControl.svelte +30 -0
- package/dist/controls/BundleControl.svelte.d.ts +16 -0
- package/dist/controls/DensityControl.svelte +39 -0
- package/dist/controls/DensityControl.svelte.d.ts +16 -0
- package/dist/controls/DepthControl.svelte +34 -0
- package/dist/controls/DepthControl.svelte.d.ts +17 -0
- package/dist/controls/EdgeStyleControl.svelte +31 -0
- package/dist/controls/EdgeStyleControl.svelte.d.ts +14 -0
- package/dist/controls/ZoomControl.svelte +47 -0
- package/dist/controls/ZoomControl.svelte.d.ts +7 -0
- package/dist/controls/zoom.d.ts +6 -0
- package/dist/controls/zoom.js +12 -0
- package/dist/diagrams/CallTree.svelte +135 -0
- package/dist/diagrams/CallTree.svelte.d.ts +37 -0
- package/dist/diagrams/DependencyDiagram.svelte +124 -0
- package/dist/diagrams/DependencyDiagram.svelte.d.ts +30 -0
- package/dist/diagrams/DiagramFrame.svelte +36 -0
- package/dist/diagrams/DiagramFrame.svelte.d.ts +20 -0
- package/dist/diagrams/ErDiagram.svelte +128 -0
- package/dist/diagrams/ErDiagram.svelte.d.ts +33 -0
- package/dist/diagrams/Neighborhood.svelte +127 -0
- package/dist/diagrams/Neighborhood.svelte.d.ts +33 -0
- package/dist/diagrams/StructureDiagram.svelte +131 -0
- package/dist/diagrams/StructureDiagram.svelte.d.ts +31 -0
- package/dist/diagrams/Sunburst.svelte +124 -0
- package/dist/diagrams/Sunburst.svelte.d.ts +32 -0
- package/dist/diagrams/Treemap.svelte +124 -0
- package/dist/diagrams/Treemap.svelte.d.ts +32 -0
- package/dist/icons.d.ts +5 -0
- package/dist/icons.js +5 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +23 -1
- package/dist/layout/arc.d.ts +13 -0
- package/dist/layout/arc.js +58 -0
- package/dist/layout/bundle.d.ts +30 -0
- package/dist/layout/bundle.js +80 -0
- package/dist/layout/cluster.js +2 -0
- package/dist/layout/flow.d.ts +8 -0
- package/dist/layout/flow.js +141 -0
- package/dist/layout/hierarchy.d.ts +42 -0
- package/dist/layout/hierarchy.js +175 -0
- package/dist/layout/index.d.ts +7 -1
- package/dist/layout/index.js +8 -2
- package/dist/layout/neighborhood.js +164 -28
- package/dist/layout/options.d.ts +44 -0
- package/dist/layout/options.js +106 -0
- package/dist/layout/order.d.ts +11 -0
- package/dist/layout/order.js +153 -0
- package/dist/layout/points.js +27 -35
- package/dist/layout/radial.d.ts +16 -0
- package/dist/layout/radial.js +214 -0
- package/dist/layout/rank.d.ts +15 -0
- package/dist/layout/rank.js +105 -0
- package/dist/layout/rings.d.ts +20 -0
- package/dist/layout/rings.js +92 -0
- package/dist/layout/sizing.d.ts +37 -0
- package/dist/layout/sizing.js +79 -0
- package/dist/layout/squarify.d.ts +14 -0
- package/dist/layout/squarify.js +114 -0
- package/dist/layout/structure.d.ts +9 -0
- package/dist/layout/structure.js +367 -0
- package/dist/layout/sunburst.d.ts +8 -0
- package/dist/layout/sunburst.js +126 -0
- package/dist/layout/types.d.ts +141 -0
- package/dist/layout/world.d.ts +9 -0
- package/dist/layout/world.js +144 -0
- package/dist/model/normalize.js +47 -1
- package/dist/model/tree.d.ts +27 -0
- package/dist/model/tree.js +182 -0
- package/dist/types.d.ts +55 -3
- package/package.json +9 -4
package/dist/types.d.ts
CHANGED
|
@@ -21,6 +21,41 @@ export type GraphNode = {
|
|
|
21
21
|
group?: string;
|
|
22
22
|
/** Closed vocabulary — table | view | matview | function | procedure | enum. */
|
|
23
23
|
kind?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A quantity this node carries — declarations in a module, rows in a table, bytes in a
|
|
26
|
+
* bundle. Drives size in `points` (`sizeBy: 'weight'`) and the sequential colour channel.
|
|
27
|
+
*
|
|
28
|
+
* Optional because most graphs have no such number, and degree stays the default so no
|
|
29
|
+
* existing caller changes. A node without one sizes at the floor rather than vanishing.
|
|
30
|
+
*/
|
|
31
|
+
weight?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Named quantities this node carries — `{ declarations: 900, unresolved: 0.9 }`.
|
|
34
|
+
*
|
|
35
|
+
* A bag rather than more fields because size and shade are INDEPENDENT measures with
|
|
36
|
+
* different ranges, and the control that motivates them switches between several at
|
|
37
|
+
* runtime: naming a key re-runs the layout, where re-mapping `fields` would re-normalize
|
|
38
|
+
* the whole model on every toggle. `weight` remains the named default for size.
|
|
39
|
+
*/
|
|
40
|
+
measures?: Record<string, number>;
|
|
41
|
+
/**
|
|
42
|
+
* This node's OWN full path, outermost first and INCLUDING itself —
|
|
43
|
+
* `['dbd', 'core', 'lexer', 'parse']`.
|
|
44
|
+
*
|
|
45
|
+
* `group` is one flat key and a codebase is containment six deep: project › repository ›
|
|
46
|
+
* folder › module › file › symbol. A path needs nothing to exist that does not, and cannot
|
|
47
|
+
* dangle the way a `parent` id can. A node without one sits at the root.
|
|
48
|
+
*
|
|
49
|
+
* **Containment is PREFIX**, which is what makes a container an ordinary node: anything
|
|
50
|
+
* whose path extends past this one is inside it. A container therefore keeps its own id,
|
|
51
|
+
* label, note, measures and edges — there is no id convention to satisfy and no second
|
|
52
|
+
* kind of node. A prefix nothing declares is synthesised, so the easy case still needs
|
|
53
|
+
* only leaves.
|
|
54
|
+
*
|
|
55
|
+
* Accepts a delimited STRING too (`'dbd/core/lexer/parse'`), since that is how a file path
|
|
56
|
+
* arrives. See `GraphFields.pathDelimiter`.
|
|
57
|
+
*/
|
|
58
|
+
path?: string[];
|
|
24
59
|
rows: GraphRow[];
|
|
25
60
|
note?: string;
|
|
26
61
|
/** Source fields the map did not claim, passed through untouched. */
|
|
@@ -85,8 +120,17 @@ export type GraphProps = {
|
|
|
85
120
|
arrange?: import('./layout/types.js').Arrange;
|
|
86
121
|
/** Outer grouping axis — `group` (default) or `kind`. */
|
|
87
122
|
groupBy?: import('./layout/types.js').NodeAxis;
|
|
123
|
+
/** Paint each card with its group's ramp — schema stays visible in a clusterless layout. */
|
|
124
|
+
groupTint?: boolean;
|
|
88
125
|
/** Subdivide each cluster by a second axis. Omit for one level. */
|
|
89
126
|
nestBy?: import('./layout/types.js').NodeAxis;
|
|
127
|
+
/**
|
|
128
|
+
* `points` only — what a node's size encodes. `degree` (default) counts edges, `weight`
|
|
129
|
+
* reads `GraphNode.weight`, and any other string names a key in `GraphNode.measures`.
|
|
130
|
+
*/
|
|
131
|
+
sizeBy?: string;
|
|
132
|
+
/** How the measure maps onto area — `linear` (default) or `log`. */
|
|
133
|
+
sizeScale?: 'linear' | 'log';
|
|
90
134
|
edgeStyle?: import('./layout/types.js').EdgeStyle;
|
|
91
135
|
/** `neighborhood` only — the node the view centres on. Defaults to the selection. */
|
|
92
136
|
focus?: string | null;
|
|
@@ -99,16 +143,16 @@ export type GraphProps = {
|
|
|
99
143
|
*/
|
|
100
144
|
zoom?: number;
|
|
101
145
|
/** Built-in zoom controls, ctrl/pinch-wheel zoom and drag-to-pan. Default true. */
|
|
146
|
+
/** Ctrl/pinch-wheel zoom and drag-to-pan. The BUTTON bar is `ZoomControl`, placed by you. */
|
|
102
147
|
zoomable?: boolean;
|
|
103
|
-
/** Built-in names/keys/all detail toggle on the canvas. Default true. */
|
|
104
|
-
densityToggle?: boolean;
|
|
105
148
|
/**
|
|
106
149
|
* Draw an arrowhead at each edge's target instead of a plain anchor dot. Default true —
|
|
107
150
|
* an edge is directed, and two identical dots discard that.
|
|
108
151
|
*/
|
|
109
152
|
arrows?: boolean;
|
|
110
153
|
label?: string;
|
|
111
|
-
|
|
154
|
+
/** Fires on selection AND on clear, where it receives `null`. */
|
|
155
|
+
onselect?: (id: string | null) => void;
|
|
112
156
|
/** Icon class per node kind and row badge, merged over the built-in map. */
|
|
113
157
|
icons?: Record<string, string>;
|
|
114
158
|
class?: string;
|
|
@@ -123,6 +167,14 @@ export type GraphFields = {
|
|
|
123
167
|
label?: string;
|
|
124
168
|
group?: string;
|
|
125
169
|
kind?: string;
|
|
170
|
+
/** Path to a per-node quantity — see `GraphNode.weight`. */
|
|
171
|
+
weight?: string;
|
|
172
|
+
/** Path to a containment chain — see `GraphNode.path`. */
|
|
173
|
+
path?: string;
|
|
174
|
+
/** Separator when `path` resolves to a STRING rather than an array. Defaults to `/`. */
|
|
175
|
+
pathDelimiter?: string;
|
|
176
|
+
/** Path to an object of named quantities — see `GraphNode.measures`. */
|
|
177
|
+
measures?: string;
|
|
126
178
|
rows?: string;
|
|
127
179
|
note?: string;
|
|
128
180
|
/** Row-level paths, read against each entry of the `rows` array. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/graph",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Node-link diagram components — pluggable layouts, ER/schema views",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"svelte": "./dist/index.js",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./icons": {
|
|
24
|
+
"types": "./dist/icons.d.ts",
|
|
25
|
+
"svelte": "./dist/icons.js",
|
|
26
|
+
"default": "./dist/icons.js"
|
|
27
|
+
},
|
|
23
28
|
"./schema": {
|
|
24
29
|
"types": "./dist/schema/index.d.ts",
|
|
25
30
|
"svelte": "./dist/schema/index.js",
|
|
@@ -41,10 +46,10 @@
|
|
|
41
46
|
"check:types": "tsc --noEmit"
|
|
42
47
|
},
|
|
43
48
|
"dependencies": {
|
|
44
|
-
"@rokkit/core": "1.
|
|
49
|
+
"@rokkit/core": "1.7.0"
|
|
45
50
|
},
|
|
46
51
|
"peerDependencies": {
|
|
47
|
-
"@rokkit/ui": "1.
|
|
52
|
+
"@rokkit/ui": "1.7.0",
|
|
48
53
|
"svelte": "^5.0.0"
|
|
49
54
|
},
|
|
50
55
|
"peerDependenciesMeta": {
|
|
@@ -53,7 +58,7 @@
|
|
|
53
58
|
}
|
|
54
59
|
},
|
|
55
60
|
"devDependencies": {
|
|
56
|
-
"@rokkit/ui": "1.
|
|
61
|
+
"@rokkit/ui": "1.7.0",
|
|
57
62
|
"@sveltejs/package": "^2.5.8",
|
|
58
63
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
59
64
|
"svelte": "^5.55.7",
|