@rokkit/graph 1.8.0 → 1.8.2
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 -0
- package/dist/Graph.svelte +108 -134
- package/dist/Graph.svelte.d.ts +1 -1
- package/dist/GraphLegend.svelte +81 -10
- package/dist/GraphLegend.svelte.d.ts +15 -0
- package/dist/GraphState.svelte.d.ts +161 -52
- package/dist/GraphState.svelte.js +380 -304
- package/dist/actions/canvas.d.ts +18 -0
- package/dist/actions/canvas.js +59 -0
- package/dist/actions/choices.d.ts +12 -0
- package/dist/actions/choices.js +23 -0
- package/dist/actions/interactions.d.ts +20 -0
- package/dist/actions/interactions.js +57 -0
- package/dist/actions/listen.d.ts +2 -0
- package/dist/actions/listen.js +10 -0
- package/dist/canvas/frame.d.ts +41 -0
- package/dist/canvas/frame.js +34 -0
- package/dist/controls/BundleControl.svelte +11 -10
- package/dist/controls/BundleControl.svelte.d.ts +0 -7
- package/dist/controls/DensityControl.svelte +17 -9
- package/dist/controls/DensityControl.svelte.d.ts +0 -8
- package/dist/controls/DepthControl.svelte +11 -4
- package/dist/controls/DepthControl.svelte.d.ts +0 -9
- package/dist/controls/DrillBar.svelte +63 -0
- package/dist/controls/DrillBar.svelte.d.ts +9 -0
- package/dist/controls/EdgeStyleControl.svelte +10 -10
- package/dist/controls/EdgeStyleControl.svelte.d.ts +0 -6
- package/dist/controls/HiddenControl.svelte +27 -0
- package/dist/controls/HiddenControl.svelte.d.ts +7 -0
- package/dist/controls/MeasureControl.svelte +39 -0
- package/dist/controls/MeasureControl.svelte.d.ts +12 -0
- package/dist/controls/ToggleControl.svelte +33 -0
- package/dist/controls/ToggleControl.svelte.d.ts +13 -0
- package/dist/controls/ViolationsControl.svelte +27 -0
- package/dist/controls/ViolationsControl.svelte.d.ts +7 -0
- package/dist/controls/ZoomControl.svelte +21 -18
- package/dist/controls/zoom.d.ts +3 -0
- package/dist/controls/zoom.js +6 -0
- package/dist/diagrams/ArcDiagram.svelte +116 -0
- package/dist/diagrams/ArcDiagram.svelte.d.ts +31 -0
- package/dist/diagrams/CallTree.svelte +17 -5
- package/dist/diagrams/CallTree.svelte.d.ts +5 -1
- package/dist/diagrams/DependencyDiagram.svelte +18 -6
- package/dist/diagrams/DependencyDiagram.svelte.d.ts +5 -1
- package/dist/diagrams/DependencyMatrix.svelte +11 -32
- package/dist/diagrams/ErDiagram.svelte +18 -6
- package/dist/diagrams/ErDiagram.svelte.d.ts +5 -1
- package/dist/diagrams/LayersDiagram.svelte +124 -0
- package/dist/diagrams/LayersDiagram.svelte.d.ts +30 -0
- package/dist/diagrams/Neighborhood.svelte +26 -6
- package/dist/diagrams/Neighborhood.svelte.d.ts +11 -1
- package/dist/diagrams/PolymetricTree.svelte +116 -0
- package/dist/diagrams/PolymetricTree.svelte.d.ts +28 -0
- package/dist/diagrams/StructureDiagram.svelte +38 -8
- package/dist/diagrams/StructureDiagram.svelte.d.ts +9 -1
- package/dist/diagrams/Sunburst.svelte +44 -8
- package/dist/diagrams/Sunburst.svelte.d.ts +12 -2
- package/dist/diagrams/Treemap.svelte +44 -8
- package/dist/diagrams/Treemap.svelte.d.ts +12 -2
- package/dist/index.d.ts +10 -3
- package/dist/index.js +9 -2
- package/dist/layout/arcs.d.ts +6 -0
- package/dist/layout/arcs.js +141 -0
- package/dist/layout/cards.js +9 -2
- package/dist/layout/edges.d.ts +13 -1
- package/dist/layout/edges.js +26 -2
- package/dist/layout/extent.d.ts +17 -0
- package/dist/layout/extent.js +27 -0
- package/dist/layout/flow.js +3 -1
- package/dist/layout/index.d.ts +4 -1
- package/dist/layout/index.js +17 -2
- package/dist/layout/layers.d.ts +6 -0
- package/dist/layout/layers.js +180 -0
- package/dist/layout/matrix.d.ts +12 -0
- package/dist/layout/matrix.js +20 -0
- package/dist/layout/neighborhood.js +16 -7
- package/dist/layout/options.d.ts +1 -1
- package/dist/layout/options.js +16 -3
- package/dist/layout/percentile.d.ts +8 -0
- package/dist/layout/percentile.js +13 -0
- package/dist/layout/polymetric.d.ts +3 -0
- package/dist/layout/polymetric.js +221 -0
- package/dist/layout/radial.js +3 -1
- package/dist/layout/structure.js +7 -1
- package/dist/layout/sunburst.js +11 -4
- package/dist/layout/types.d.ts +79 -0
- package/dist/layout/world.js +11 -4
- package/dist/messages.d.ts +14 -0
- package/dist/messages.js +17 -0
- package/dist/model/condense.d.ts +8 -0
- package/dist/model/condense.js +114 -0
- package/dist/model/entities.d.ts +12 -0
- package/dist/model/entities.js +12 -0
- package/dist/model/normalize.d.ts +2 -6
- package/dist/model/normalize.js +64 -2
- package/dist/model/relationships.d.ts +30 -0
- package/dist/model/relationships.js +51 -0
- package/dist/model/share.d.ts +9 -0
- package/dist/model/share.js +43 -0
- package/dist/model/tree.d.ts +7 -1
- package/dist/model/tree.js +11 -4
- package/dist/preset.d.ts +18 -0
- package/dist/preset.js +34 -3
- package/dist/schema/EntitiesView.svelte +8 -6
- package/dist/schema/EntityView.svelte +13 -10
- package/dist/state/GraphConfig.svelte.d.ts +124 -0
- package/dist/state/GraphConfig.svelte.js +253 -0
- package/dist/state/GraphDrill.svelte.d.ts +52 -0
- package/dist/state/GraphDrill.svelte.js +115 -0
- package/dist/state/GraphGroups.svelte.d.ts +35 -0
- package/dist/state/GraphGroups.svelte.js +73 -0
- package/dist/state/GraphSelection.svelte.d.ts +53 -0
- package/dist/state/GraphSelection.svelte.js +94 -0
- package/dist/state/intents.d.ts +33 -0
- package/dist/state/intents.js +30 -0
- package/dist/state/text.d.ts +28 -0
- package/dist/state/text.js +56 -0
- package/dist/types.d.ts +72 -1
- package/package.json +5 -4
package/dist/types.d.ts
CHANGED
|
@@ -12,7 +12,11 @@ export type GraphRow = {
|
|
|
12
12
|
* (a view reading a table, a procedure calling a function). Layouts branch on
|
|
13
13
|
* this rather than on any schema-specific notion.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* `reference` (a foreign key) and `dependency` come from the data. `containment` is drawn by a
|
|
17
|
+
* tree layout (`polymetric`) between a container and what it holds — the tree's own links.
|
|
18
|
+
*/
|
|
19
|
+
export type EdgeKind = 'reference' | 'dependency' | 'containment';
|
|
16
20
|
export type GraphNode = {
|
|
17
21
|
/** Stable key. `${group}.${label}` when a group is present, else `label`. */
|
|
18
22
|
id: string;
|
|
@@ -54,8 +58,25 @@ export type GraphNode = {
|
|
|
54
58
|
*
|
|
55
59
|
* Accepts a delimited STRING too (`'dbd/core/lexer/parse'`), since that is how a file path
|
|
56
60
|
* arrives. See `GraphFields.pathDelimiter`.
|
|
61
|
+
*
|
|
62
|
+
* A host that gives containment as `parent` ids instead (#168) need not convert: a node with
|
|
63
|
+
* no path but a parent chain gets one, as ids (`GraphFields.parent`). The path is still what
|
|
64
|
+
* the model holds — the chain is read once, at normalisation.
|
|
57
65
|
*/
|
|
58
66
|
path?: string[];
|
|
67
|
+
/**
|
|
68
|
+
* The node ids this node STANDS FOR — a group, typically one strongly-connected component
|
|
69
|
+
* the host condensed (#166). rokkit computes no SCCs: it draws what the host grouped. While
|
|
70
|
+
* the group is collapsed its members are hidden and their edges reroute to it.
|
|
71
|
+
*/
|
|
72
|
+
members?: string[];
|
|
73
|
+
/** Whether a group starts collapsed. A node with `members` and no flag is collapsed. */
|
|
74
|
+
collapsed?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The layer the HOST assigned (#167) — 0 at the top, foundations at the bottom. rokkit
|
|
77
|
+
* computes no depth; the `layers` layout ranks by this.
|
|
78
|
+
*/
|
|
79
|
+
layer?: number;
|
|
59
80
|
rows: GraphRow[];
|
|
60
81
|
note?: string;
|
|
61
82
|
/** Source fields the map did not claim, passed through untouched. */
|
|
@@ -107,7 +128,27 @@ export type GraphEdge = {
|
|
|
107
128
|
overlay?: boolean;
|
|
108
129
|
/** A strength this edge carries — co-change count, call frequency. Drives stroke width. */
|
|
109
130
|
weight?: number;
|
|
131
|
+
/**
|
|
132
|
+
* The cheapest link to cut to break a cycle — the edge with the fewest occurrences (#166).
|
|
133
|
+
* Naming it is the actionable output of a cycles view, so it is styleable on its own
|
|
134
|
+
* (`data-edge-weakest`).
|
|
135
|
+
*/
|
|
136
|
+
weakest?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Coupling nothing in the code explains — a pair that changes together with no import
|
|
139
|
+
* between them (#169). The host computes it; the graph only styles it (`data-edge-hidden`).
|
|
140
|
+
*/
|
|
141
|
+
hidden?: boolean;
|
|
142
|
+
/** How many model edges this one stands for, when it aggregates a collapsed group's edges. */
|
|
143
|
+
count?: number;
|
|
144
|
+
/**
|
|
145
|
+
* How the edge sits against the layering (#167): `down` one layer (conformant), `skip` more
|
|
146
|
+
* than one down (legal, worth seeing), `up` climbing (the violation), `level` within a layer.
|
|
147
|
+
* The host says; when it does not, the `layers` layout derives it from the layers.
|
|
148
|
+
*/
|
|
149
|
+
conformance?: Conformance;
|
|
110
150
|
};
|
|
151
|
+
export type Conformance = 'down' | 'skip' | 'up' | 'level';
|
|
111
152
|
export type GraphModel = {
|
|
112
153
|
nodes: GraphNode[];
|
|
113
154
|
/** Structural edges — the ones layouts, neighbours and relationships see. */
|
|
@@ -169,6 +210,19 @@ export type GraphProps = {
|
|
|
169
210
|
label?: string;
|
|
170
211
|
/** Fires on selection AND on clear, where it receives `null`. */
|
|
171
212
|
onselect?: (id: string | null) => void;
|
|
213
|
+
/**
|
|
214
|
+
* The containment subtree drawn as the whole canvas (`world`, `sunburst`, `structure`).
|
|
215
|
+
* Bindable: drilling moves it. `[]` is the root.
|
|
216
|
+
*/
|
|
217
|
+
focusPath?: string[];
|
|
218
|
+
/** The reader drilled into a box — see `GraphStateConfig.ondrill`. */
|
|
219
|
+
ondrill?: (path: string[], node: GraphNode | null) => void | Promise<void>;
|
|
220
|
+
/** The reader drilled out — see `GraphStateConfig.ondrillup`. */
|
|
221
|
+
ondrillup?: (path: string[]) => void | Promise<void>;
|
|
222
|
+
/** The reader expanded a group — see `GraphStateConfig.onexpand`. */
|
|
223
|
+
onexpand?: (id: string, node: GraphNode) => void;
|
|
224
|
+
/** The reader collapsed a group — see `GraphStateConfig.oncollapse`. */
|
|
225
|
+
oncollapse?: (id: string, node: GraphNode) => void;
|
|
172
226
|
/** Icon class per node kind and row badge, merged over the built-in map. */
|
|
173
227
|
icons?: Record<string, string>;
|
|
174
228
|
class?: string;
|
|
@@ -225,6 +279,23 @@ export type GraphFields = {
|
|
|
225
279
|
relation?: string;
|
|
226
280
|
/** Path to a truthy flag marking an overlay edge — see `GraphEdge.overlay`. */
|
|
227
281
|
overlay?: string;
|
|
282
|
+
/** Path to a group's member ids — see `GraphNode.members`. */
|
|
283
|
+
members?: string;
|
|
284
|
+
/** Path to a group's starting state — see `GraphNode.collapsed`. */
|
|
285
|
+
collapsed?: string;
|
|
286
|
+
/** Path to a truthy flag marking the weakest edge of a cycle — see `GraphEdge.weakest`. */
|
|
287
|
+
weakest?: string;
|
|
288
|
+
/** Path to a truthy flag marking hidden coupling — see `GraphEdge.hidden`. */
|
|
289
|
+
hidden?: string;
|
|
290
|
+
/** Path to a node's host-assigned layer — see `GraphNode.layer`. */
|
|
291
|
+
layer?: string;
|
|
292
|
+
/**
|
|
293
|
+
* Path to a node's PARENT id — containment as a parent chain rather than a `path` (#168).
|
|
294
|
+
* Used only for a node with no `path`; it becomes one, as ids.
|
|
295
|
+
*/
|
|
296
|
+
parent?: string;
|
|
297
|
+
/** Path to an edge's conformance to the layering — see `GraphEdge.conformance`. */
|
|
298
|
+
conformance?: string;
|
|
228
299
|
/** Path to an edge's strength — see `GraphEdge.weight`. */
|
|
229
300
|
edgeWeight?: string;
|
|
230
301
|
cardinality?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/graph",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Node-link diagram components — pluggable layouts, ER/schema views",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
"check:types": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rokkit/core": "1.8.
|
|
49
|
+
"@rokkit/core": "1.8.2",
|
|
50
|
+
"@rokkit/states": "1.8.2"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@rokkit/ui": "1.8.
|
|
53
|
+
"@rokkit/ui": "1.8.2",
|
|
53
54
|
"svelte": "^5.0.0"
|
|
54
55
|
},
|
|
55
56
|
"peerDependenciesMeta": {
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@rokkit/ui": "1.8.
|
|
62
|
+
"@rokkit/ui": "1.8.2",
|
|
62
63
|
"@sveltejs/package": "^2.5.8",
|
|
63
64
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
64
65
|
"svelte": "^5.55.7",
|