@graphty/graphty-element 2.0.1 → 2.2.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 +3 -3
- package/dist/ai.js +4 -4
- package/dist/catalog.js +5 -5
- package/dist/chunks/{AiManager-awS0MNr1.js → AiManager-DWwQiBQu.js} +5 -5
- package/dist/chunks/{Algorithm-BdcqHKps.js → Algorithm-RQ629NLb.js} +210 -92
- package/dist/chunks/{DataSource-DK4GZBKg.js → DataSource-DEg3igzS.js} +3 -3
- package/dist/chunks/{GraphSession-D87eymV8.js → GraphSession-CtqyVNsw.js} +2518 -2239
- package/dist/chunks/{GraphtyError-B3eKs4yg.js → GraphtyError-BwcnblTH.js} +10 -8
- package/dist/chunks/{GraphtyLogger-CK03SnJi.js → GraphtyLogger-5KEttFUo.js} +1 -1
- package/dist/chunks/{NodeStyle-CS7dj20m.js → NodeStyle-Cup9O1lu.js} +2 -1
- package/dist/chunks/{VoiceInputAdapter-CcnCmxo5.js → VoiceInputAdapter-mD0x3z7t.js} +1 -1
- package/dist/chunks/{XRPivotCameraController-UjMsbran.js → XRPivotCameraController-Clil9NhV.js} +2 -2
- package/dist/chunks/{cameras-BeIAlMWR.js → cameras-DFXNYBze.js} +2 -2
- package/dist/chunks/{capability-check-DcKFwS6q.js → capability-check-dXwQ_z5B.js} +1 -1
- package/dist/chunks/{detect-B-YbbP7i.js → detect-CqN0mC6u.js} +3 -3
- package/dist/chunks/{format-detection-DohSEZnb.js → format-detection-C8vbCSlS.js} +1 -1
- package/dist/chunks/{index-uohvGegX.js → index-2VIpMJZP.js} +1576 -1211
- package/dist/chunks/{paletteRegistry-B-oS4YxP.js → paletteRegistry-NrWOKT-A.js} +17 -17
- package/dist/chunks/{registry-DU-e49Y2.js → registry-CSba5QGJ.js} +1 -1
- package/dist/chunks/{scales-DvGid5Ln.js → scales-BUS7NWy2.js} +2206 -1357
- package/dist/custom-elements.json +1 -1
- package/dist/extend.js +26 -27
- package/dist/graphty-catalog.json +7 -4
- package/dist/graphty.bundle.js +36288 -34368
- package/dist/graphty.js +66 -64
- package/dist/index.d.ts +1 -1
- package/dist/logging.js +2 -2
- package/dist/schema.js +1 -1
- package/dist/session.d.ts +2 -1
- package/dist/session.js +37 -33
- package/dist/src/Edge.d.ts +1 -1
- package/dist/src/Graph.d.ts +41 -7
- package/dist/src/Node.d.ts +1 -1
- package/dist/src/acceleration/AccelerationController.d.ts +27 -0
- package/dist/src/acceleration/index.d.ts +1 -1
- package/dist/src/acceleration/narrow.d.ts +56 -0
- package/dist/src/acceleration/types.d.ts +88 -7
- package/dist/src/algorithms/Algorithm.d.ts +96 -2
- package/dist/src/algorithms/BFSAlgorithm.d.ts +9 -0
- package/dist/src/algorithms/DijkstraAlgorithm.d.ts +2 -8
- package/dist/src/algorithms/PageRankAlgorithm.d.ts +8 -0
- package/dist/src/algorithms/utils/graphUtils.d.ts +13 -0
- package/dist/src/cameras/OrbitCameraController.d.ts +1 -0
- package/dist/src/catalog/layouts.d.ts +13 -1
- package/dist/src/config/GraphBehavior.d.ts +13 -0
- package/dist/src/config/GraphStyle.d.ts +1 -1
- package/dist/src/config/StyleTemplate.d.ts +4 -0
- package/dist/src/data/CSVDataSource.d.ts +1 -0
- package/dist/src/data/csv-variant-detection.d.ts +11 -0
- package/dist/src/errors/codes.d.ts +14 -1
- package/dist/src/events.d.ts +17 -4
- package/dist/src/graphty-element.d.ts +48 -3
- package/dist/src/layout/ForceAtlas2LayoutEngine.d.ts +28 -45
- package/dist/src/layout/LayoutEngine.d.ts +7 -7
- package/dist/src/layout/SimulationLayoutEngine.d.ts +458 -0
- package/dist/src/layout/SpringElectricalLayoutEngine.d.ts +32 -0
- package/dist/src/layout/SpringLayoutEngine.d.ts +22 -32
- package/dist/src/managers/EventManager.d.ts +7 -0
- package/dist/src/managers/GraphContext.d.ts +6 -0
- package/dist/src/managers/LayoutManager.d.ts +98 -4
- package/dist/src/managers/RenderManager.d.ts +7 -0
- package/dist/src/managers/UpdateManager.d.ts +1 -1
- package/dist/src/session/catalog.d.ts +2 -2
- package/dist/src/session/query.d.ts +83 -0
- package/dist/src/session/runs/types.d.ts +10 -4
- package/dist/src/session/selection/targets.d.ts +20 -3
- package/dist/src/session/styles/StylesApi.d.ts +18 -0
- package/dist/src/session/styles/legend.d.ts +9 -0
- package/dist/src/session/styles/predicate.d.ts +11 -0
- package/dist/src/session/styles/sources.d.ts +16 -0
- package/dist/src/session/types.d.ts +38 -2
- package/dist/src/testing/fakeAccelerator.d.ts +323 -0
- package/dist/webgpu.d.ts +23 -1
- package/dist/webgpu.js +70 -32
- package/package.json +10 -8
- package/dist/chunks/types-Dwm9waL2.js +0 -7
package/dist/graphty.js
CHANGED
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
import { A as e, a as
|
|
2
|
-
import { a as
|
|
3
|
-
import { D as
|
|
4
|
-
import {
|
|
5
|
-
import { e as
|
|
6
|
-
import { A as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { c as la } from "./chunks/common-DWNKjpH_.js";
|
|
1
|
+
import { A as e, a as E, b as r, D as O, E as o, d as S, G as R, e as _, I as t, L, N as C, O as A, R as N, S as n, f as I, g as T, h as g, U as i, i as l } from "./chunks/index-2VIpMJZP.js";
|
|
2
|
+
import { a as p, S as G, b as f } from "./chunks/paletteRegistry-NrWOKT-A.js";
|
|
3
|
+
import { D as y, E as D } from "./chunks/DataSource-DEg3igzS.js";
|
|
4
|
+
import { k as P, l as U, g as c, h as m, A as u, C as x, i as B } from "./chunks/Algorithm-RQ629NLb.js";
|
|
5
|
+
import { e as H, E as b, N as Y, a as F, P as W, R as k, S as K, d as v, b as w, c as Q } from "./chunks/NodeStyle-Cup9O1lu.js";
|
|
6
|
+
import { A as j, a as q, G as z, i as J, b as Z } from "./chunks/GraphtyError-BwcnblTH.js";
|
|
7
|
+
import { B as aa, a as sa, b as ea, C as Ea, G as ra, c as Oa, I as oa, O as Sa, d as Ra, e as _a, f as ta, P as La, g as Ca, h as Aa, R as Na, T as na, i as Ia, V as Ta, Y as ga } from "./chunks/sequential-Zym81qm7.js";
|
|
8
|
+
import { a as la, G as da, V as pa, i as Ga } from "./chunks/GraphStyle-D0PXnZKu.js";
|
|
9
|
+
import { c as ha } from "./chunks/common-DWNKjpH_.js";
|
|
11
10
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
j as ACCELERATION_ERROR_CODES,
|
|
12
|
+
P as ACCELERATION_MIN_NODES_DEFAULT,
|
|
13
|
+
U as ACCELERATION_MIN_NODES_KEY,
|
|
14
|
+
c as ACCELERATION_POLICIES,
|
|
15
|
+
m as ACCELERATION_POLICY_DEFAULT,
|
|
16
|
+
u as Algorithm,
|
|
16
17
|
e as AlgorithmManager,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
E as AnimationCancelledError,
|
|
19
|
+
aa as BLUES_COLORS,
|
|
20
|
+
sa as BLUE_HIGHLIGHT,
|
|
21
|
+
ea as BLUE_ORANGE_COLORS,
|
|
22
|
+
r as BUILTIN_PRESETS,
|
|
23
|
+
Ea as CARBON_COLORS,
|
|
24
|
+
x as CPU_PRECISION,
|
|
25
|
+
la as DEFAULT_VIEW_MODE,
|
|
25
26
|
O as DataManager,
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
y as DataSource,
|
|
28
|
+
H as EDGE_CONSTANTS,
|
|
28
29
|
o as Edge,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
b as EdgeStyle,
|
|
31
|
+
D as ErrorAggregator,
|
|
31
32
|
S as EventManager,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
q as GRAPHTY_ERROR_CODES,
|
|
34
|
+
ra as GREENS_COLORS,
|
|
35
|
+
Oa as GREEN_SUCCESS,
|
|
35
36
|
R as Graph,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
da as GraphBackground,
|
|
38
|
+
_ as Graphty,
|
|
39
|
+
z as GraphtyError,
|
|
40
|
+
oa as INFERNO_COLORS,
|
|
41
|
+
t as InputManager,
|
|
42
|
+
p as LayoutEngine,
|
|
42
43
|
L as LayoutManager,
|
|
43
44
|
C as Node,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
Y as NodeShapes,
|
|
46
|
+
F as NodeStyle,
|
|
47
|
+
Sa as OKABE_ITO_COLORS,
|
|
48
|
+
Ra as ORANGES_COLORS,
|
|
49
|
+
_a as ORANGE_WARNING,
|
|
50
|
+
ta as OTHER_GROUP_COLOR,
|
|
50
51
|
A as OperationQueueManager,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
La as PASTEL_COLORS,
|
|
53
|
+
Ca as PLASMA_COLORS,
|
|
54
|
+
Aa as PURPLE_GREEN_COLORS,
|
|
55
|
+
W as PolyhedronType,
|
|
56
|
+
Na as RED_BLUE_COLORS,
|
|
56
57
|
N as RenderManager,
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
k as RichTextStyle,
|
|
59
|
+
K as SHAPE_CONSTANTS,
|
|
59
60
|
n as ScreenshotError,
|
|
60
|
-
|
|
61
|
+
I as ScreenshotErrorCode,
|
|
61
62
|
T as SelectionManager,
|
|
62
|
-
|
|
63
|
+
G as SimpleLayoutConfig,
|
|
63
64
|
f as SimpleLayoutEngine,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
g as StatsManager,
|
|
66
|
+
na as TOL_MUTED_COLORS,
|
|
67
|
+
Ia as TOL_VIBRANT_COLORS,
|
|
68
|
+
i as UpdateManager,
|
|
69
|
+
pa as VIEW_MODE_VALUES,
|
|
70
|
+
Ta as VIRIDIS_COLORS,
|
|
70
71
|
ga as YLORBR_COLORS,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
ha as colorToHex,
|
|
73
|
+
v as defaultEdgeStyle,
|
|
74
|
+
w as defaultNodeStyle,
|
|
75
|
+
Q as defaultRichTextLabelStyle,
|
|
76
|
+
l as defaultXRConfig,
|
|
77
|
+
B as isAccelerationPolicy,
|
|
78
|
+
J as isGraphtyError,
|
|
79
|
+
Z as isGraphtyErrorCode,
|
|
80
|
+
Ga as isViewMode
|
|
79
81
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -70,4 +70,4 @@ export { BUILTIN_PRESETS } from "./src/camera/presets";
|
|
|
70
70
|
export type { AccelerationErrorCode, GraphtyErrorCode, GraphtyErrorInit, GraphtyErrorJson, GraphtyErrorSource, GraphtyErrorTarget, } from "./src/errors";
|
|
71
71
|
export { ACCELERATION_ERROR_CODES, GRAPHTY_ERROR_CODES, GraphtyError, isGraphtyError, isGraphtyErrorCode, } from "./src/errors";
|
|
72
72
|
export type { AccelerationCapabilities, AccelerationPolicy, AccelerationPrecision, AccelerationState, AccelerationStatus, AcceleratorDeviceInfo, AcceleratorFactory, AcceleratorFactoryOptions, CalibrationRecord, Capabilities, CaptureCapability, GraphAccelerator, Limits, WorkerCapability, XrCapability, } from "./src/acceleration";
|
|
73
|
-
export { ACCELERATION_MIN_NODES_DEFAULT, ACCELERATION_MIN_NODES_KEY, CPU_PRECISION } from "./src/acceleration";
|
|
73
|
+
export { ACCELERATION_MIN_NODES_DEFAULT, ACCELERATION_MIN_NODES_KEY, ACCELERATION_POLICIES, ACCELERATION_POLICY_DEFAULT, CPU_PRECISION, isAccelerationPolicy, } from "./src/acceleration";
|
package/dist/logging.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as c, p } from "./chunks/GraphtyLogger-
|
|
2
|
-
import { G, e as C, f as M, g as w, h as N, i as V, j as I, k as P, m as U, n as T, o as x } from "./chunks/GraphtyLogger-
|
|
1
|
+
import { d as c, p } from "./chunks/GraphtyLogger-5KEttFUo.js";
|
|
2
|
+
import { G, e as C, f as M, g as w, h as N, i as V, j as I, k as P, m as U, n as T, o as x } from "./chunks/GraphtyLogger-5KEttFUo.js";
|
|
3
3
|
const g = "graphty-element-logging-config";
|
|
4
4
|
function O(t) {
|
|
5
5
|
try {
|
package/dist/schema.js
CHANGED
|
@@ -2,7 +2,7 @@ import { R as N, e as x } from "./chunks/types-B7bX5c0K.js";
|
|
|
2
2
|
import { M as A, h as y, i as M } from "./chunks/interpolation-DY-PNpqX.js";
|
|
3
3
|
import { B as D, a as U, b as B, C as P, G as H, c as V, I as $, O as w, d as F, e as W, f as Y, P as j, g as k, h as q, R as K, T as v, i as z, V as J, Y as Q } from "./chunks/sequential-Zym81qm7.js";
|
|
4
4
|
import { D as Z, a as tt, G as nt, b as at, V as st, i as et } from "./chunks/GraphStyle-D0PXnZKu.js";
|
|
5
|
-
import { E as rt, N as ct, a as it, R as Ot, d as St, b as Rt, c as lt } from "./chunks/NodeStyle-
|
|
5
|
+
import { E as rt, N as ct, a as it, R as Ot, d as St, b as Rt, c as lt } from "./chunks/NodeStyle-Cup9O1lu.js";
|
|
6
6
|
import { c as ft } from "./chunks/common-DWNKjpH_.js";
|
|
7
7
|
function l(t) {
|
|
8
8
|
const n = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
package/dist/session.d.ts
CHANGED
|
@@ -93,7 +93,8 @@ export type { Binding, BindingOverflow, Channel, EdgeId, Encoding, FieldDescript
|
|
|
93
93
|
export { isResultShape, RESULT_SHAPES } from "./src/catalog/types";
|
|
94
94
|
export type { ChannelExplanation, ElementLayerSpec, EncodingRun, EncodingSpec, ExplainTarget, FieldWords, HighlightSpec, Layer, LayerPosition, LayerProblem, LegendBlock, LegendSwatch, RepaintReason, RepaintReport, SessionStylesApi, StyleChange, StyleContribution, StyleExplanation, StylesApi, TemplateOptions, TemplateReport, UnboundLayer, ValidationResult, } from "./src/session/styles";
|
|
95
95
|
export { quotePath } from "./src/session/styles";
|
|
96
|
-
export type { AccelerationCapabilities, AccelerationPolicy, AccelerationState, AccelerationStatus, Capabilities, CaptureCapability, Limits, WorkerCapability, XrCapability, } from "./src/acceleration";
|
|
96
|
+
export type { AccelerationCapabilities, AccelerationPolicy, AccelerationPrecision, AccelerationState, AccelerationStatus, AcceleratorDeviceInfo, Capabilities, CaptureCapability, GraphAccelerator, Limits, WorkerCapability, XrCapability, } from "./src/acceleration";
|
|
97
|
+
export { ACCELERATION_POLICIES, ACCELERATION_POLICY_DEFAULT, isAccelerationPolicy, } from "./src/acceleration";
|
|
97
98
|
export type { DefaultableLimits } from "./src/session";
|
|
98
99
|
export { DEFAULT_LIMITS } from "./src/session";
|
|
99
100
|
export type { AccelerationErrorCode, GraphtyErrorCode, GraphtyErrorInit, GraphtyErrorJson, GraphtyErrorSource, GraphtyErrorTarget, } from "./src/errors";
|
package/dist/session.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { R, e as
|
|
2
|
-
import { A, a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { R as A, e as R } from "./chunks/types-B7bX5c0K.js";
|
|
2
|
+
import { A as _, a as C, G as g, i as m, b as L } from "./chunks/GraphtyError-BwcnblTH.js";
|
|
3
|
+
import { g as U, h as I, i as N } from "./chunks/Algorithm-RQ629NLb.js";
|
|
4
|
+
import { D as h } from "./chunks/GraphSession-CtqyVNsw.js";
|
|
5
|
+
import { a as y, b as D, c as w, Q as b, R as v, d as G, e as x, S as z, T as F, f as M, i as j, g as H, h as Y, j as k } from "./chunks/GraphSession-CtqyVNsw.js";
|
|
6
|
+
import { R as Q, w as X, x as B, y as J, z as K, A as V } from "./chunks/paletteRegistry-NrWOKT-A.js";
|
|
7
|
+
import { a as n } from "./chunks/scales-BUS7NWy2.js";
|
|
7
8
|
const u = Object.freeze({
|
|
8
9
|
/** Above this node count the element draws less visual detail. A shipped default, not measured. */
|
|
9
10
|
largeGraphThreshold: 1e4,
|
|
@@ -64,34 +65,37 @@ function f(e, a = {}) {
|
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
-
U as
|
|
69
|
-
|
|
68
|
+
_ as ACCELERATION_ERROR_CODES,
|
|
69
|
+
U as ACCELERATION_POLICIES,
|
|
70
|
+
I as ACCELERATION_POLICY_DEFAULT,
|
|
71
|
+
y as DEFAULT_COST_GATE_LIMITS,
|
|
72
|
+
D as DEFAULT_EXACT_COMPUTATION_CAP_SECONDS,
|
|
70
73
|
u as DEFAULT_LIMITS,
|
|
71
|
-
|
|
74
|
+
w as DEFAULT_SCOPE_SAMPLE,
|
|
72
75
|
h as DEFAULT_SELECTION_CAP,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
76
|
+
C as GRAPHTY_ERROR_CODES,
|
|
77
|
+
g as GraphtyError,
|
|
78
|
+
b as QUEUE_POLICIES,
|
|
79
|
+
Q as RESULT_FIELD_NAMES,
|
|
80
|
+
X as RESULT_ROOT,
|
|
81
|
+
A as RESULT_SHAPES,
|
|
82
|
+
B as RESULT_SHAPE_CONTRACTS,
|
|
83
|
+
v as RUN_ID_PATTERN,
|
|
84
|
+
G as RUN_PHASES,
|
|
85
|
+
x as RUN_STATUSES,
|
|
86
|
+
z as SET_OPS,
|
|
87
|
+
F as TERMINAL_RUN_STATUSES,
|
|
88
|
+
M as createGraphSession,
|
|
89
|
+
J as defaultReading,
|
|
90
|
+
N as isAccelerationPolicy,
|
|
91
|
+
j as isAlgorithmRunCommand,
|
|
92
|
+
m as isGraphtyError,
|
|
93
|
+
L as isGraphtyErrorCode,
|
|
94
|
+
R as isResultShape,
|
|
95
|
+
H as isRunId,
|
|
96
|
+
Y as isRunStatus,
|
|
97
|
+
k as isTerminalRunStatus,
|
|
98
|
+
K as quotePath,
|
|
95
99
|
f as recommendLayout,
|
|
96
|
-
|
|
100
|
+
V as resultPath
|
|
97
101
|
};
|
package/dist/src/Edge.d.ts
CHANGED
|
@@ -249,7 +249,7 @@ export declare class Edge {
|
|
|
249
249
|
* (it disposes a per-element ShaderMaterial that Babylon's default flags would leave behind),
|
|
250
250
|
* so it is routed to that rather than to `AbstractMesh.dispose`.
|
|
251
251
|
*
|
|
252
|
-
* A DISPOSED EDGE STILL RECEIVES CALLS, which is why {@link Edge.
|
|
252
|
+
* A DISPOSED EDGE STILL RECEIVES CALLS, which is why {@link Edge.isDisposed} exists: the layout
|
|
253
253
|
* engine keeps its own edge list and `UpdateManager` walks it every frame regardless of what
|
|
254
254
|
* DataManager holds. Calling this twice is safe.
|
|
255
255
|
*/
|
package/dist/src/Graph.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import "./algorithms/index";
|
|
|
4
4
|
import "@babylonjs/core/Culling/ray";
|
|
5
5
|
import "@babylonjs/core/Animations/animatable";
|
|
6
6
|
import { AbstractMesh, Engine, Scene, WebGPUEngine, WebXRDefaultExperience } from "@babylonjs/core";
|
|
7
|
+
import { AccelerationController } from "./acceleration";
|
|
7
8
|
import { VoiceInputAdapter } from "./ai/input/VoiceInputAdapter";
|
|
8
9
|
import type { ApiKeyManager } from "./ai/keys";
|
|
9
10
|
import type { CameraState } from "./camera/types.js";
|
|
@@ -49,6 +50,16 @@ export declare class Graph implements GraphContext {
|
|
|
49
50
|
enableDetailedProfiling?: boolean;
|
|
50
51
|
private wasSettled;
|
|
51
52
|
private resizeHandler;
|
|
53
|
+
/**
|
|
54
|
+
* The one acceleration controller this graph, its session and its element share.
|
|
55
|
+
*
|
|
56
|
+
* Built here because it is the earliest owner both the element's `acceleration` attribute and
|
|
57
|
+
* the session can reach: the element builds its Graph in its own constructor, before Lit has
|
|
58
|
+
* parsed an attribute, and the Graph builds the session in its. It is disposed by
|
|
59
|
+
* {@link shutdown}, so it lives and dies with the graph.
|
|
60
|
+
* @since 2.0.0
|
|
61
|
+
*/
|
|
62
|
+
readonly acceleration: AccelerationController;
|
|
52
63
|
/** Event manager for adding/removing event listeners */
|
|
53
64
|
readonly eventManager: EventManager;
|
|
54
65
|
private renderManager;
|
|
@@ -94,6 +105,20 @@ export declare class Graph implements GraphContext {
|
|
|
94
105
|
* Shuts down the graph, stopping animations and disposing all resources.
|
|
95
106
|
*/
|
|
96
107
|
shutdown(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Frees the accelerator's device buffers for a snapshot the graph has stopped showing.
|
|
110
|
+
*
|
|
111
|
+
* `release` is feature-tested, never required: `GraphAccelerator` declares it through the index
|
|
112
|
+
* signature, so a third party may implement one layout and no residency at all. The undirected
|
|
113
|
+
* copy is released beside the snapshot because that is the copy the device usually holds -- a
|
|
114
|
+
* layout simulation loads the undirected view of every snapshot -- and is skipped when the
|
|
115
|
+
* graph is undirected already, where the two are one object.
|
|
116
|
+
* @param snapshot - The snapshot to release; null before the first freeze, and nothing is done.
|
|
117
|
+
* @param undirected - Its undirected copy, when the caller already holds it. Left out, it is
|
|
118
|
+
* looked up here -- and only once there is something to release it to, so a graph running on
|
|
119
|
+
* the CPU never derives a copy nobody asked for.
|
|
120
|
+
*/
|
|
121
|
+
private releaseSnapshot;
|
|
97
122
|
/**
|
|
98
123
|
* Executes all algorithms specified in the style template configuration.
|
|
99
124
|
*/
|
|
@@ -251,7 +276,7 @@ export declare class Graph implements GraphContext {
|
|
|
251
276
|
* @returns Promise that resolves when nodes are added
|
|
252
277
|
* @since 1.0.0
|
|
253
278
|
* @see {@link addEdges} for adding edges
|
|
254
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/data--
|
|
279
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/data--basic | Data Loading Examples}
|
|
255
280
|
* @example
|
|
256
281
|
* ```typescript
|
|
257
282
|
* // Add nodes with default ID field
|
|
@@ -296,7 +321,7 @@ export declare class Graph implements GraphContext {
|
|
|
296
321
|
* @returns Promise that resolves when edges are added
|
|
297
322
|
* @since 1.0.0
|
|
298
323
|
* @see {@link addNodes} for adding nodes first
|
|
299
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/data--
|
|
324
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/data--basic | Data Loading Examples}
|
|
300
325
|
* @example
|
|
301
326
|
* ```typescript
|
|
302
327
|
* // Add edges with default source/target fields
|
|
@@ -350,8 +375,8 @@ export declare class Graph implements GraphContext {
|
|
|
350
375
|
* @returns Promise that resolves when layout is initialized
|
|
351
376
|
* @since 1.0.0
|
|
352
377
|
* @see {@link waitForSettled} to wait for layout completion
|
|
353
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/layout--
|
|
354
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/
|
|
378
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/layout-3d--circular | 3D Layout Examples}
|
|
379
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/layout-2d--circular | 2D Layout Examples}
|
|
355
380
|
* @example
|
|
356
381
|
* ```typescript
|
|
357
382
|
* // Use force-directed layout with custom settings
|
|
@@ -398,8 +423,8 @@ export declare class Graph implements GraphContext {
|
|
|
398
423
|
* @since 1.0.0
|
|
399
424
|
* @see {@link Graph.run} for the verb that replaces this one
|
|
400
425
|
* @see {@link applySuggestedStyles} to visualize results
|
|
401
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/algorithms-centrality--degree | Centrality Examples}
|
|
402
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/algorithms-community--louvain | Community Detection}
|
|
426
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/algorithms-centrality--degree | Centrality Examples}
|
|
427
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/algorithms-community--louvain | Community Detection}
|
|
403
428
|
* @example
|
|
404
429
|
* ```typescript
|
|
405
430
|
* // This entry point starts the work and hands nothing back. Everything below reads the
|
|
@@ -721,6 +746,12 @@ export declare class Graph implements GraphContext {
|
|
|
721
746
|
* @returns The EventManager instance
|
|
722
747
|
*/
|
|
723
748
|
getEventManager(): EventManager;
|
|
749
|
+
/**
|
|
750
|
+
* Get the acceleration controller this graph owns, for a manager reached through GraphContext.
|
|
751
|
+
* @returns The acceleration controller
|
|
752
|
+
* @since 2.0.0
|
|
753
|
+
*/
|
|
754
|
+
getAcceleration(): AccelerationController;
|
|
724
755
|
/**
|
|
725
756
|
* Get the currently selected node.
|
|
726
757
|
*
|
|
@@ -750,7 +781,7 @@ export declare class Graph implements GraphContext {
|
|
|
750
781
|
* @since 1.0.0
|
|
751
782
|
* @see {@link deselectNode} to clear selection
|
|
752
783
|
* @see {@link getSelectedNode} to get current selection
|
|
753
|
-
* @see {@link https://graphty.app/storybook/element/?path=/story/selection--
|
|
784
|
+
* @see {@link https://graphty.app/storybook/graphty-element/?path=/story/selection--mode-3-d | Selection Examples}
|
|
754
785
|
* @example
|
|
755
786
|
* ```typescript
|
|
756
787
|
* // Select a node and show its details
|
|
@@ -919,6 +950,9 @@ export declare class Graph implements GraphContext {
|
|
|
919
950
|
isRunning(): boolean;
|
|
920
951
|
/**
|
|
921
952
|
* Set whether the layout engine should run.
|
|
953
|
+
*
|
|
954
|
+
* Resuming a simulation layout that had settled restarts it, so "play" moves nodes again;
|
|
955
|
+
* pausing stops the per-frame stepping and nothing else.
|
|
922
956
|
* @param running - True to start the layout, false to stop it
|
|
923
957
|
*/
|
|
924
958
|
setRunning(running: boolean): void;
|
package/dist/src/Node.d.ts
CHANGED
|
@@ -263,7 +263,7 @@ export declare class Node {
|
|
|
263
263
|
* `removeFromHighlight` call below is what is safe to do: it removes THIS mesh, which for an
|
|
264
264
|
* instanced node the layer never held.
|
|
265
265
|
*
|
|
266
|
-
* A DISPOSED NODE STILL RECEIVES CALLS, which is why
|
|
266
|
+
* A DISPOSED NODE STILL RECEIVES CALLS, which is why the private `disposed` flag exists rather than
|
|
267
267
|
* this method simply freeing things. `DataManager.clear()` does not notify the layout engine
|
|
268
268
|
* (its own standing TODO), so `UpdateManager` keeps iterating the engine's node and edge
|
|
269
269
|
* lists; and `SelectionManager.selectedNode` holds a Node across a dataset boundary and calls
|
|
@@ -129,9 +129,18 @@ export declare class AccelerationController {
|
|
|
129
129
|
get status(): AccelerationStatus;
|
|
130
130
|
/**
|
|
131
131
|
* The published capabilities subset, which is the `graphty-capabilities-change` detail.
|
|
132
|
+
*
|
|
133
|
+
* The same object is returned until the next transition, so `prev === next` is a valid
|
|
134
|
+
* staleness test for a reader that caches it.
|
|
132
135
|
* @returns The capabilities the acceleration subsystem publishes.
|
|
133
136
|
*/
|
|
134
137
|
get capabilities(): AccelerationCapabilities;
|
|
138
|
+
/**
|
|
139
|
+
* Whether {@link dispose} has already run, so a caller can skip {@link start} on a
|
|
140
|
+
* controller whose graph has been shut down.
|
|
141
|
+
* @returns True once the controller has been disposed.
|
|
142
|
+
*/
|
|
143
|
+
get disposed(): boolean;
|
|
135
144
|
/**
|
|
136
145
|
* The one-word state, for a caller that wants only that.
|
|
137
146
|
* @returns The state.
|
|
@@ -234,6 +243,24 @@ export declare class AccelerationController {
|
|
|
234
243
|
* (`AbortError`, `TimeoutError`) propagates unchanged.
|
|
235
244
|
*/
|
|
236
245
|
run<T>(work: AcceleratedWork, fn: (accelerator: GraphAccelerator) => T | Promise<T>): Promise<AccelerationOutcome<T>>;
|
|
246
|
+
/**
|
|
247
|
+
* Marks the start of a span of accelerated work that this controller does not itself drive.
|
|
248
|
+
*
|
|
249
|
+
* {@link run} covers work shaped like a call: one function, one promise, `"active"` for as
|
|
250
|
+
* long as it takes. A simulation is not shaped like that -- the element hands the graph to
|
|
251
|
+
* the accelerator once and then steps it every frame until the arrangement settles -- so the
|
|
252
|
+
* layout bridge marks the span instead. Without it the state a consumer reads would say
|
|
253
|
+
* `"idle"`, which its own documentation defines as nothing using the accelerator, for the
|
|
254
|
+
* whole of a GPU layout.
|
|
255
|
+
*
|
|
256
|
+
* Counted the way `run()` is: spans overlap freely and the state falls back to `"idle"` when
|
|
257
|
+
* the last one ends. The returned function is idempotent, so a caller may end its span at a
|
|
258
|
+
* settle and again at a dispose without counting out twice. On a disposed controller the
|
|
259
|
+
* call is a no-op rather than a throw: there is no state left to publish, and a frame loop is
|
|
260
|
+
* the wrong place for a shutdown to surface.
|
|
261
|
+
* @returns Ends the span.
|
|
262
|
+
*/
|
|
263
|
+
beginWork(): () => void;
|
|
237
264
|
/**
|
|
238
265
|
* Releases the accelerator and stops publishing.
|
|
239
266
|
*
|
|
@@ -9,4 +9,4 @@ export { AccelerationController } from "./AccelerationController";
|
|
|
9
9
|
export type { AcceleratorRegistration, RegisterAcceleratorOptions } from "./registry";
|
|
10
10
|
export { AcceleratorRegistry, acceleratorRegistry, registerAccelerator } from "./registry";
|
|
11
11
|
export type { AccelerationCapabilities, AccelerationPolicy, AccelerationPrecision, AccelerationState, AccelerationStatus, AcceleratorDeviceInfo, AcceleratorFactory, AcceleratorFactoryOptions, CalibrationRecord, Capabilities, CaptureCapability, GraphAccelerator, Limits, WorkerCapability, XrCapability, } from "./types";
|
|
12
|
-
export { ACCELERATION_MIN_NODES_DEFAULT, ACCELERATION_MIN_NODES_KEY, CPU_PRECISION, DEFAULT_ACCELERATOR_PRECISION, } from "./types";
|
|
12
|
+
export { ACCELERATION_MIN_NODES_DEFAULT, ACCELERATION_MIN_NODES_KEY, ACCELERATION_POLICIES, ACCELERATION_POLICY_DEFAULT, CPU_PRECISION, DEFAULT_ACCELERATOR_PRECISION, isAccelerationPolicy, } from "./types";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Narrowing the element's accelerator to the seam a CPU package's dispatcher feature-tests.
|
|
3
|
+
*
|
|
4
|
+
* The element attaches ONE {@link GraphAccelerator}, whose accelerated members are open-ended:
|
|
5
|
+
* `webgpu.ts` forwards every callable the peer implements by name, so the object grows a member
|
|
6
|
+
* each time the GPU package ports another layout or algorithm and the element needs no edit.
|
|
7
|
+
* The CPU packages' dispatchers take a narrower thing -- `@graphty/layout`'s `LayoutAccelerator`
|
|
8
|
+
* is three optional layout members plus `release`, and `@graphty/algorithms`'s
|
|
9
|
+
* `AlgorithmAccelerator` is one optional member per algorithm -- and they decide CPU or
|
|
10
|
+
* accelerator by asking whether the member EXISTS (`accelerator?.forceAtlas2 !== undefined` in
|
|
11
|
+
* `createSimulation`, `acc?.pageRank !== undefined` in `accelerated`).
|
|
12
|
+
*
|
|
13
|
+
* That is why this copies only the members that are functions rather than spelling out
|
|
14
|
+
* `forceAtlas2: accelerator.forceAtlas2` for each: an accelerator that implements ForceAtlas2 and
|
|
15
|
+
* nothing else must hand the dispatcher an object with no `fruchtermanReingold` key at all, which
|
|
16
|
+
* is the GPU package's own rule for its accelerator ("an unimplemented member must not exist").
|
|
17
|
+
* A key present and undefined would read as implemented to anything testing with `in`.
|
|
18
|
+
*
|
|
19
|
+
* `dispose` is never copied. The element's controller owns the accelerator's lifetime -- it
|
|
20
|
+
* disposes one it built and leaves an injected one alone -- and a layout that could dispose the
|
|
21
|
+
* device out from under the next run would take that decision away from it.
|
|
22
|
+
*/
|
|
23
|
+
import type { AlgorithmAccelerator } from "@graphty/algorithms";
|
|
24
|
+
import type { LayoutAccelerator } from "@graphty/layout";
|
|
25
|
+
import type { GraphAccelerator } from "./types";
|
|
26
|
+
/**
|
|
27
|
+
* Narrows the attached accelerator to the layout seam `createSimulation` feature-tests.
|
|
28
|
+
*
|
|
29
|
+
* The returned object is fresh on every call and holds only the members the accelerator actually
|
|
30
|
+
* implements, each bound to it, so a simulation built from it keeps working however the caller
|
|
31
|
+
* stores it.
|
|
32
|
+
* @param accelerator - The accelerator the controller has attached.
|
|
33
|
+
* @returns The layout half of it, for `createSimulation`'s third argument.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const decision = controller.plan({ capability: "forceAtlas2", nodeCount });
|
|
37
|
+
* const simulation = createSimulation("forceatlas2", options, decision.accelerated ? narrowLayout(decision.accelerator) : null);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function narrowLayout(accelerator: GraphAccelerator): LayoutAccelerator;
|
|
41
|
+
/**
|
|
42
|
+
* Narrows the attached accelerator to the algorithm seam `accelerated()` feature-tests.
|
|
43
|
+
*
|
|
44
|
+
* The returned object is fresh on every call and holds only the members the accelerator actually
|
|
45
|
+
* implements, each bound to it, so the dispatcher runs the accelerated implementation where one
|
|
46
|
+
* exists and the CPU port everywhere else.
|
|
47
|
+
* @param accelerator - The accelerator the controller has attached.
|
|
48
|
+
* @returns The algorithm half of it, for `accelerated()`.
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const outcome = await controller.run({ capability: "pageRank", nodeCount }, (acc) =>
|
|
52
|
+
* accelerated(narrowAlgorithms(acc)).pageRank(snapshot, options),
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function narrowAlgorithms(accelerator: GraphAccelerator): AlgorithmAccelerator;
|