@graphty/graphty-element 2.6.2 → 3.0.1
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/dist/ai.js +3 -3
- package/dist/catalog.js +53 -54
- package/dist/chunks/{AiManager-4iQpsJW1.js → AiManager-Bhh0rR_p.js} +706 -655
- package/dist/chunks/GraphSession-DPoTaT3b.js +21175 -0
- package/dist/chunks/{GraphtyLogger-B_O67a6c.js → GraphtyLogger-BtcBJQPL.js} +1 -1
- package/dist/chunks/{VoiceInputAdapter-Cc6mHXTI.js → VoiceInputAdapter-CdLsJ_nG.js} +1 -1
- package/dist/chunks/{XRPivotCameraController-BLa89LXn.js → XRPivotCameraController-CiLJ9Gz6.js} +2 -2
- package/dist/chunks/algorithms-qij74zEN.js +6811 -0
- package/dist/chunks/{capability-check-Am2zliFj.js → capability-check-BbgTejS3.js} +1 -1
- package/dist/chunks/definePalette-BYt2Llxs.js +1333 -0
- package/dist/chunks/fields-5uVC1Pll.js +4999 -0
- package/dist/chunks/{format-detection-BHwrAVzW.js → format-detection-FKaDMshR.js} +1 -1
- package/dist/chunks/{index-BkBLbvui.js → index-Cc_6D9hV.js} +6034 -7127
- package/dist/chunks/interpolation-Dk206AhZ.js +105 -0
- package/dist/chunks/paletteRegistry-De3CGdst.js +357 -0
- package/dist/chunks/parse-SVp77JbE.js +669 -0
- package/dist/chunks/{pluginRegistry-Bs8bEkz9.js → pluginRegistry-Ddfl6Mv2.js} +27 -24
- package/dist/chunks/{registry-BdGvyZou.js → registry-CgMqldp4.js} +1 -1
- package/dist/chunks/{DataSource-BL2UzPff.js → sources-BbAJCDIH.js} +279 -108
- package/dist/commands.d.ts +128 -19
- package/dist/commands.js +49 -1
- package/dist/custom-elements.json +1 -1
- package/dist/extend.d.ts +10 -2
- package/dist/extend.js +64 -57
- package/dist/graphty-catalog.json +6 -3
- package/dist/graphty.bundle.js +267177 -240648
- package/dist/graphty.js +84 -78
- package/dist/index.d.ts +4 -0
- package/dist/logging.js +2 -2
- package/dist/schema.js +70 -71
- package/dist/session.d.ts +5 -6
- package/dist/session.js +40 -86
- package/dist/src/Edge.d.ts +31 -67
- package/dist/src/Graph.d.ts +335 -77
- package/dist/src/Node.d.ts +36 -3
- package/dist/src/NodeBehavior.d.ts +28 -0
- package/dist/src/Styles.d.ts +15 -4
- package/dist/src/acceleration/AccelerationController.d.ts +8 -0
- package/dist/src/acceleration/narrow.d.ts +9 -1
- package/dist/src/acceleration/types.d.ts +10 -0
- package/dist/src/ai/AiController.d.ts +12 -0
- package/dist/src/ai/AiManager.d.ts +7 -0
- package/dist/src/ai/commands/AlgorithmCommands.d.ts +1 -1
- package/dist/src/ai/commands/LayoutCommands.d.ts +1 -1
- package/dist/src/ai/commands/StyleCommands.d.ts +1 -1
- package/dist/src/ai/commands/types.d.ts +20 -1
- package/dist/src/algorithms/Algorithm.d.ts +21 -4
- package/dist/src/algorithms/BFSAlgorithm.d.ts +0 -9
- package/dist/src/algorithms/BellmanFordAlgorithm.d.ts +0 -14
- package/dist/src/algorithms/DFSAlgorithm.d.ts +1 -1
- package/dist/src/algorithms/FloydWarshallAlgorithm.d.ts +5 -0
- package/dist/src/algorithms/GirvanNewmanAlgorithm.d.ts +5 -0
- package/dist/src/algorithms/LeidenAlgorithm.d.ts +5 -0
- package/dist/src/algorithms/PageRankAlgorithm.d.ts +1 -1
- package/dist/src/algorithms/StronglyConnectedComponentsAlgorithm.d.ts +1 -1
- package/dist/src/algorithms/metrics/fields.d.ts +23 -1
- package/dist/src/algorithms/utils/graphUtils.d.ts +13 -1
- package/dist/src/catalog/paletteRegistry.d.ts +4 -4
- package/dist/src/catalog/registry.d.ts +3 -2
- package/dist/src/catalog/types.d.ts +18 -1
- package/dist/src/config/GraphStyle.d.ts +1 -1
- package/dist/src/config/StyleTemplate.d.ts +2 -2
- package/dist/src/config/xr-config-schema.d.ts +4 -4
- package/dist/src/data/CSVDataSource.d.ts +77 -22
- package/dist/src/data/ErrorAggregator.d.ts +5 -0
- package/dist/src/data/GEXFDataSource.d.ts +12 -61
- package/dist/src/data/GraphMLDataSource.d.ts +3 -44
- package/dist/src/data/GraphStore.d.ts +322 -15
- package/dist/src/data/JsonDataSource.d.ts +43 -1
- package/dist/src/data/graph-io-import.d.ts +89 -0
- package/dist/src/data/graph-io-records.d.ts +64 -0
- package/dist/src/data/lane.d.ts +23 -0
- package/dist/src/data/positions.d.ts +13 -0
- package/dist/src/data/seedPosition.d.ts +16 -0
- package/dist/src/errors/GraphtyError.d.ts +3 -1
- package/dist/src/errors/codes.d.ts +23 -0
- package/dist/src/events.d.ts +12 -0
- package/dist/src/graphty-element.d.ts +149 -54
- package/dist/src/input/types.d.ts +2 -0
- package/dist/src/layout/D3GraphLayoutEngine.d.ts +17 -3
- package/dist/src/layout/FixedLayoutEngine.d.ts +20 -4
- package/dist/src/layout/KamadaKawaiLayoutEngine.d.ts +6 -0
- package/dist/src/layout/LayoutEngine.d.ts +214 -116
- package/dist/src/layout/NGraphLayoutEngine.d.ts +10 -3
- package/dist/src/layout/SimulationLayoutEngine.d.ts +8 -3
- package/dist/src/managers/AlgorithmManager.d.ts +24 -5
- package/dist/src/managers/DataManager.d.ts +258 -181
- package/dist/src/managers/EventManager.d.ts +5 -2
- package/dist/src/managers/GraphContext.d.ts +7 -0
- package/dist/src/managers/InputManager.d.ts +11 -0
- package/dist/src/managers/LayoutManager.d.ts +129 -50
- package/dist/src/managers/RenderManager.d.ts +14 -1
- package/dist/src/managers/UpdateManager.d.ts +20 -0
- package/dist/src/screenshot/ScreenshotCapture.d.ts +1 -1
- package/dist/src/session/GraphSession.d.ts +83 -6
- package/dist/src/session/commands/algo.d.ts +169 -0
- package/dist/src/session/commands/config.d.ts +45 -0
- package/dist/src/session/commands/data.d.ts +178 -0
- package/dist/src/session/commands/doors.d.ts +93 -0
- package/dist/src/session/commands/index.d.ts +20 -0
- package/dist/src/session/commands/layout.d.ts +104 -0
- package/dist/src/session/commands/positions.d.ts +30 -0
- package/dist/src/session/commands/sets.d.ts +113 -0
- package/dist/src/session/commands/style.d.ts +92 -0
- package/dist/src/session/commands/view.d.ts +57 -0
- package/dist/src/session/commands/visibility.d.ts +41 -0
- package/dist/src/session/data.d.ts +131 -4
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/planning.d.ts +25 -8
- package/dist/src/session/project/Dispatcher.d.ts +905 -0
- package/dist/src/session/project/History.d.ts +382 -0
- package/dist/src/session/project/arrangement.d.ts +247 -0
- package/dist/src/session/project/derive.d.ts +132 -0
- package/dist/src/session/project/digest.d.ts +33 -0
- package/dist/src/session/project/draft.d.ts +194 -0
- package/dist/src/session/project/graphOps.d.ts +304 -0
- package/dist/src/session/project/ingest.d.ts +364 -0
- package/dist/src/session/project/state.d.ts +145 -0
- package/dist/src/session/project/strict.d.ts +68 -0
- package/dist/src/session/results/RunResult.d.ts +48 -0
- package/dist/src/session/results/statistics.d.ts +20 -0
- package/dist/src/session/runs/Run.d.ts +80 -4
- package/dist/src/session/runs/RunsApi.d.ts +23 -6
- package/dist/src/session/runs/types.d.ts +25 -6
- package/dist/src/session/scope/ElementMask.d.ts +14 -0
- package/dist/src/session/scope/ScopeApi.d.ts +3 -22
- package/dist/src/session/scope/spaces.d.ts +29 -0
- package/dist/src/session/sealed.d.ts +22 -0
- package/dist/src/session/selection/SelectionApi.d.ts +14 -4
- package/dist/src/session/sets/SetsApi.d.ts +13 -5
- package/dist/src/session/sets/store.d.ts +54 -53
- package/dist/src/session/sets/types.d.ts +5 -2
- package/dist/src/session/styles/Layer.d.ts +5 -0
- package/dist/src/session/styles/StylesApi.d.ts +68 -17
- package/dist/src/session/styles/autoApply.d.ts +64 -53
- package/dist/src/session/styles/index.d.ts +3 -3
- package/dist/src/session/styles/predicate.d.ts +7 -0
- package/dist/src/session/styles/repaint.d.ts +16 -1
- package/dist/src/session/styles/sources.d.ts +1 -1
- package/dist/src/session/types.d.ts +625 -54
- package/dist/src/session/visibility/VisibilityApi.d.ts +38 -18
- package/dist/src/session/visibility/filter.d.ts +10 -0
- package/dist/src/simple/defineAlgorithm.d.ts +28 -0
- package/dist/src/simple/defineLayout.d.ts +35 -0
- package/dist/src/simple/defineLogDestination.d.ts +31 -0
- package/dist/src/simple/definePalette.d.ts +26 -0
- package/dist/src/simple/definition.d.ts +106 -0
- package/dist/src/simple/options.d.ts +33 -0
- package/dist/src/simple/source.d.ts +49 -0
- package/dist/src/simple/types.d.ts +366 -0
- package/dist/src/simple/view.d.ts +107 -0
- package/dist/webgpu.js +2 -2
- package/package.json +10 -12
- package/dist/chunks/GraphSession-BhuHSXIo.js +0 -12819
- package/dist/chunks/GraphStyle-Cwr55SAE.js +0 -65
- package/dist/chunks/algorithms-BJ6DQMOe.js +0 -3777
- package/dist/chunks/detect-fyuVnlCT.js +0 -88
- package/dist/chunks/interpolation-DY-PNpqX.js +0 -43
- package/dist/chunks/optionsFromZod-CKMYSwTz.js +0 -3636
- package/dist/chunks/paletteRegistry-BCFSwJGK.js +0 -1196
- package/dist/chunks/parse-BMTqt4SS.js +0 -3658
- package/dist/src/data/csv-variant-detection.d.ts +0 -29
- package/dist/src/data/ingest.d.ts +0 -104
package/dist/commands.d.ts
CHANGED
|
@@ -1,25 +1,134 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file `@graphty/graphty-element/commands`: the serialisable form of every verb.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* This entry point is where the serialisable half is published -- the `Command` union, the typed
|
|
8
|
-
* builders that produce one, `parsePattern` and `formatCommand`, and the JSON Schema generated
|
|
9
|
-
* from the union at build time -- so that an agent can be handed the element's whole vocabulary
|
|
10
|
-
* as data rather than as prose.
|
|
4
|
+
* Every change a session makes is a command: plain data with an `op`, which `session.execute`
|
|
5
|
+
* runs, a transaction groups into one undoable step, and a recipe, a journal or an agent's tool
|
|
6
|
+
* call can carry. This entry point publishes the vocabulary as data:
|
|
11
7
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
8
|
+
* - `SessionCommand`, the union of every command, the same type `./session` publishes;
|
|
9
|
+
* - `COMMANDS`, one entry per op saying whether it is undoable, or exempt from the history and
|
|
10
|
+
* why;
|
|
11
|
+
* - `isSessionCommand`, which tells a value that names a known op from anything else.
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
* The typed builders, `parsePattern`, `formatCommand` and the JSON Schema generated from the
|
|
14
|
+
* union are still to come (GitHub issue #337).
|
|
15
|
+
*
|
|
16
|
+
* What the element can do today is published as data by `@graphty/graphty-element/catalog`: the
|
|
17
|
+
* algorithms, layouts, formats, palettes and scales that exist, with every option each accepts.
|
|
18
|
+
*/
|
|
19
|
+
import type { SessionCommand } from "./src/session/planning";
|
|
20
|
+
export type { SessionCommand };
|
|
21
|
+
/** How one op behaves under undo: a step in the history, or exempt from it and why. */
|
|
22
|
+
export type CommandMeta = {
|
|
23
|
+
readonly undo: "undoable";
|
|
24
|
+
} | {
|
|
25
|
+
readonly undo: "exempt";
|
|
26
|
+
/** Why it changes nothing a project file saves. */
|
|
27
|
+
readonly reason: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Every op in the vocabulary, and how it behaves under undo. An op missing here, or declaring
|
|
31
|
+
* neither, is a compile error.
|
|
32
|
+
*/
|
|
33
|
+
export declare const COMMANDS: Readonly<{
|
|
34
|
+
readonly "algo.run": {
|
|
35
|
+
readonly undo: "undoable";
|
|
36
|
+
};
|
|
37
|
+
readonly "algo.legacy": {
|
|
38
|
+
readonly undo: "undoable";
|
|
39
|
+
};
|
|
40
|
+
readonly "algo.remove": {
|
|
41
|
+
readonly undo: "undoable";
|
|
42
|
+
};
|
|
43
|
+
readonly batch: {
|
|
44
|
+
readonly undo: "undoable";
|
|
45
|
+
};
|
|
46
|
+
readonly "data.apply": {
|
|
47
|
+
readonly undo: "undoable";
|
|
48
|
+
};
|
|
49
|
+
readonly "data.import": {
|
|
50
|
+
readonly undo: "undoable";
|
|
51
|
+
};
|
|
52
|
+
readonly "data.expand": {
|
|
53
|
+
readonly undo: "undoable";
|
|
54
|
+
};
|
|
55
|
+
readonly "style.patch": {
|
|
56
|
+
readonly undo: "undoable";
|
|
57
|
+
};
|
|
58
|
+
readonly "style.encode": {
|
|
59
|
+
readonly undo: "undoable";
|
|
60
|
+
};
|
|
61
|
+
readonly "style.template": {
|
|
62
|
+
readonly undo: "undoable";
|
|
63
|
+
};
|
|
64
|
+
readonly "visibility.set": {
|
|
65
|
+
readonly undo: "undoable";
|
|
66
|
+
};
|
|
67
|
+
readonly "visibility.window": {
|
|
68
|
+
readonly undo: "undoable";
|
|
69
|
+
};
|
|
70
|
+
readonly "visibility.context": {
|
|
71
|
+
readonly undo: "undoable";
|
|
72
|
+
};
|
|
73
|
+
readonly "set.create": {
|
|
74
|
+
readonly undo: "undoable";
|
|
75
|
+
};
|
|
76
|
+
readonly "set.rename": {
|
|
77
|
+
readonly undo: "undoable";
|
|
78
|
+
};
|
|
79
|
+
readonly "set.redefine": {
|
|
80
|
+
readonly undo: "undoable";
|
|
81
|
+
};
|
|
82
|
+
readonly "set.members": {
|
|
83
|
+
readonly undo: "undoable";
|
|
84
|
+
};
|
|
85
|
+
readonly "set.remove": {
|
|
86
|
+
readonly undo: "undoable";
|
|
87
|
+
};
|
|
88
|
+
readonly "set.restore": {
|
|
89
|
+
readonly undo: "undoable";
|
|
90
|
+
};
|
|
91
|
+
readonly "view.save": {
|
|
92
|
+
readonly undo: "undoable";
|
|
93
|
+
};
|
|
94
|
+
readonly "view.remove": {
|
|
95
|
+
readonly undo: "undoable";
|
|
96
|
+
};
|
|
97
|
+
readonly "view.camera": {
|
|
98
|
+
readonly undo: "exempt";
|
|
99
|
+
readonly reason: "Where the camera is looking is view state, not saved in a project file.";
|
|
100
|
+
};
|
|
101
|
+
readonly "config.set": {
|
|
102
|
+
readonly undo: "undoable";
|
|
103
|
+
};
|
|
104
|
+
readonly "positions.set": {
|
|
105
|
+
readonly undo: "undoable";
|
|
106
|
+
};
|
|
107
|
+
readonly "positions.pin": {
|
|
108
|
+
readonly undo: "undoable";
|
|
109
|
+
};
|
|
110
|
+
readonly "layout.set": {
|
|
111
|
+
readonly undo: "undoable";
|
|
112
|
+
};
|
|
113
|
+
readonly "layout.scope": {
|
|
114
|
+
readonly undo: "undoable";
|
|
115
|
+
};
|
|
116
|
+
readonly "view.dimension": {
|
|
117
|
+
readonly undo: "undoable";
|
|
118
|
+
};
|
|
119
|
+
readonly "layout.transport": {
|
|
120
|
+
readonly undo: "exempt";
|
|
121
|
+
readonly reason: "A moving layout is in-flight computation; where it comes to rest is sealed into the step on top.";
|
|
122
|
+
};
|
|
123
|
+
readonly "view.immersive": {
|
|
124
|
+
readonly undo: "exempt";
|
|
125
|
+
readonly reason: "Entering or leaving VR or AR is a device session, not the document.";
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Whether a value is a command: an object whose `op` names an op in {@link COMMANDS}. The
|
|
130
|
+
* arguments are checked when the command runs.
|
|
131
|
+
* @param value - Anything.
|
|
132
|
+
* @returns True when it names a known op.
|
|
24
133
|
*/
|
|
25
|
-
export
|
|
134
|
+
export declare function isSessionCommand(value: unknown): value is SessionCommand;
|
package/dist/commands.js
CHANGED
|
@@ -1 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
const n = Object.freeze({
|
|
2
|
+
"algo.run": { undo: "undoable" },
|
|
3
|
+
"algo.legacy": { undo: "undoable" },
|
|
4
|
+
"algo.remove": { undo: "undoable" },
|
|
5
|
+
batch: { undo: "undoable" },
|
|
6
|
+
"data.apply": { undo: "undoable" },
|
|
7
|
+
"data.import": { undo: "undoable" },
|
|
8
|
+
"data.expand": { undo: "undoable" },
|
|
9
|
+
"style.patch": { undo: "undoable" },
|
|
10
|
+
"style.encode": { undo: "undoable" },
|
|
11
|
+
"style.template": { undo: "undoable" },
|
|
12
|
+
"visibility.set": { undo: "undoable" },
|
|
13
|
+
"visibility.window": { undo: "undoable" },
|
|
14
|
+
"visibility.context": { undo: "undoable" },
|
|
15
|
+
"set.create": { undo: "undoable" },
|
|
16
|
+
"set.rename": { undo: "undoable" },
|
|
17
|
+
"set.redefine": { undo: "undoable" },
|
|
18
|
+
"set.members": { undo: "undoable" },
|
|
19
|
+
"set.remove": { undo: "undoable" },
|
|
20
|
+
"set.restore": { undo: "undoable" },
|
|
21
|
+
"view.save": { undo: "undoable" },
|
|
22
|
+
"view.remove": { undo: "undoable" },
|
|
23
|
+
"view.camera": {
|
|
24
|
+
undo: "exempt",
|
|
25
|
+
reason: "Where the camera is looking is view state, not saved in a project file."
|
|
26
|
+
},
|
|
27
|
+
"config.set": { undo: "undoable" },
|
|
28
|
+
"positions.set": { undo: "undoable" },
|
|
29
|
+
"positions.pin": { undo: "undoable" },
|
|
30
|
+
"layout.set": { undo: "undoable" },
|
|
31
|
+
"layout.scope": { undo: "undoable" },
|
|
32
|
+
"view.dimension": { undo: "undoable" },
|
|
33
|
+
"layout.transport": {
|
|
34
|
+
undo: "exempt",
|
|
35
|
+
reason: "A moving layout is in-flight computation; where it comes to rest is sealed into the step on top."
|
|
36
|
+
},
|
|
37
|
+
"view.immersive": {
|
|
38
|
+
undo: "exempt",
|
|
39
|
+
reason: "Entering or leaving VR or AR is a device session, not the document."
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
function d(e) {
|
|
43
|
+
const o = e?.op;
|
|
44
|
+
return typeof e == "object" && typeof o == "string" && Object.hasOwn(n, o);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
n as COMMANDS,
|
|
48
|
+
d as isSessionCommand
|
|
49
|
+
};
|