@graphty/graphty-element 2.3.1 → 2.4.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/AGENTS.md +4 -3
- package/dist/ai.js +3 -3
- package/dist/catalog.js +28 -27
- package/dist/chunks/{AiManager-BBmGJbH4.js → AiManager-BD9XK30e.js} +5 -5
- package/dist/chunks/{DataSource-OeN3NeyD.js → DataSource-B8vf2uhW.js} +3 -3
- package/dist/chunks/{GraphSession-Bef1AYw9.js → GraphSession-dcwOjGJh.js} +2821 -2743
- package/dist/chunks/{GraphtyError-BwcnblTH.js → GraphtyError-B93WRH3e.js} +8 -6
- package/dist/chunks/{GraphtyLogger-5KEttFUo.js → GraphtyLogger-CqOVV13Y.js} +2 -2
- package/dist/chunks/{NodeStyle-DKj7HjMJ.js → NodeStyle-CtmA7dXi.js} +16 -14
- package/dist/chunks/{VoiceInputAdapter-Dr9Gcmds.js → VoiceInputAdapter-D0tHHi9G.js} +1 -1
- package/dist/chunks/{XRPivotCameraController-BbfgZWpS.js → XRPivotCameraController-DTfhvhHz.js} +2 -2
- package/dist/chunks/{algorithms-CpX56sUB.js → algorithms-BF0X6RPw.js} +780 -635
- package/dist/chunks/{capability-check-Blhb2aBB.js → capability-check-BJzlK4oL.js} +1 -1
- package/dist/chunks/{detect-Cqwshr9a.js → detect-vJxK7n0D.js} +2 -2
- package/dist/chunks/{format-detection-BXGO1lSn.js → format-detection-C80TLQ2e.js} +1 -1
- package/dist/chunks/{index-C0mIoumR.js → index-2xkq7wyD.js} +2623 -2241
- package/dist/chunks/{optionsFromZod-17lkrAJs.js → optionsFromZod-BuTOFgVM.js} +146 -139
- package/dist/chunks/{paletteRegistry-x7WOEKZY.js → paletteRegistry-A63C71Gn.js} +8 -6
- package/dist/chunks/{registry-CSba5QGJ.js → registry-jB46Gmeb.js} +1 -1
- package/dist/chunks/{scales-BRwl51k8.js → scales-B2d-7Bf0.js} +572 -399
- package/dist/chunks/{types-B7bX5c0K.js → types-C_c53VgR.js} +31 -26
- package/dist/commands.d.ts +4 -0
- package/dist/custom-elements.json +1 -1
- package/dist/extend.js +8 -8
- package/dist/graphty-catalog.json +245 -12
- package/dist/graphty.bundle.js +37836 -36835
- package/dist/graphty.js +11 -11
- package/dist/logging.js +2 -2
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +42 -40
- package/dist/session.js +6 -6
- package/dist/src/Graph.d.ts +79 -7
- package/dist/src/acceleration/AccelerationController.d.ts +14 -3
- package/dist/src/acceleration/types.d.ts +78 -0
- package/dist/src/algorithms/KCoreAlgorithm.d.ts +26 -0
- package/dist/src/algorithms/LinkPredictionAlgorithm.d.ts +41 -0
- package/dist/src/catalog/algorithms.d.ts +5 -5
- package/dist/src/catalog/index.d.ts +2 -2
- package/dist/src/catalog/layouts.d.ts +7 -6
- package/dist/src/catalog/types.d.ts +77 -6
- package/dist/src/config/EdgeStyle.d.ts +35 -0
- package/dist/src/config/index.d.ts +1 -1
- package/dist/src/data/GEXFDataSource.d.ts +23 -0
- package/dist/src/errors/codes.d.ts +14 -0
- package/dist/src/events.d.ts +30 -0
- package/dist/src/graphty-element.d.ts +66 -26
- package/dist/src/layout/GridLayoutEngine.d.ts +37 -0
- package/dist/src/layout/LayoutEngine.d.ts +7 -7
- package/dist/src/layout/NGraphLayoutEngine.d.ts +2 -0
- package/dist/src/layout/RadialLayoutEngine.d.ts +37 -0
- package/dist/src/layout/SimulationLayoutEngine.d.ts +12 -0
- package/dist/src/managers/DataManager.d.ts +69 -2
- package/dist/src/managers/EventManager.d.ts +10 -4
- package/dist/src/managers/GraphContext.d.ts +2 -1
- package/dist/src/managers/LayoutManager.d.ts +30 -3
- package/dist/src/meshes/MeshCache.d.ts +18 -0
- package/dist/src/meshes/NodeEffects.d.ts +16 -11
- package/dist/src/meshes/NodeMesh.d.ts +2 -2
- package/dist/src/meshes/RichTextParser.d.ts +26 -0
- package/dist/src/meshes/RichTextRenderer.d.ts +0 -1
- package/dist/src/session/cost/estimate.d.ts +1 -1
- package/dist/src/session/layout.d.ts +3 -3
- package/dist/src/session/runs/RunsApi.d.ts +1 -1
- package/dist/src/session/styles/StylesApi.d.ts +6 -0
- package/dist/src/session/styles/intern.d.ts +26 -5
- package/dist/src/session/styles/repaint.d.ts +2 -1
- package/dist/src/session/types.d.ts +6 -6
- package/dist/webgpu.js +2 -2
- package/package.json +6 -6
package/dist/graphty.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as e, a as
|
|
2
|
-
import { L as l, S as G, a as f } from "./chunks/paletteRegistry-
|
|
3
|
-
import { D, E as M } from "./chunks/DataSource-
|
|
4
|
-
import { I as P, J as U, p as c, q as m, A as u, C as x, x as B } from "./chunks/optionsFromZod-
|
|
5
|
-
import {
|
|
6
|
-
import { A as Q, a as X, G as j, i as z, b as Z } from "./chunks/GraphtyError-
|
|
7
|
-
import { B as aa, a as sa, b as ea, C as
|
|
1
|
+
import { A as e, a as r, b as E, D as O, E as o, d as S, G as R, e as _, I as L, L as t, 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 p } from "./chunks/index-2xkq7wyD.js";
|
|
2
|
+
import { L as l, S as G, a as f } from "./chunks/paletteRegistry-A63C71Gn.js";
|
|
3
|
+
import { D, E as M } from "./chunks/DataSource-B8vf2uhW.js";
|
|
4
|
+
import { I as P, J as U, p as c, q as m, A as u, C as x, x as B } from "./chunks/optionsFromZod-BuTOFgVM.js";
|
|
5
|
+
import { g as H, b, N as Y, c as F, P as W, R as K, S as k, d as q, e as v, f as w } from "./chunks/NodeStyle-CtmA7dXi.js";
|
|
6
|
+
import { A as Q, a as X, G as j, i as z, b as Z } from "./chunks/GraphtyError-B93WRH3e.js";
|
|
7
|
+
import { B as aa, a as sa, b as ea, C as ra, G as Ea, c as Oa, I as oa, O as Sa, d as Ra, e as _a, f as La, P as ta, 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
8
|
import { a as pa, G as da, V as la, i as Ga } from "./chunks/GraphStyle-Cwr55SAE.js";
|
|
9
9
|
import { c as ya } from "./chunks/common-DWNKjpH_.js";
|
|
10
10
|
export {
|
|
@@ -15,12 +15,12 @@ export {
|
|
|
15
15
|
m as ACCELERATION_POLICY_DEFAULT,
|
|
16
16
|
u as Algorithm,
|
|
17
17
|
e as AlgorithmManager,
|
|
18
|
-
|
|
18
|
+
r as AnimationCancelledError,
|
|
19
19
|
aa as BLUES_COLORS,
|
|
20
20
|
sa as BLUE_HIGHLIGHT,
|
|
21
21
|
ea as BLUE_ORANGE_COLORS,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
E as BUILTIN_PRESETS,
|
|
23
|
+
ra as CARBON_COLORS,
|
|
24
24
|
x as CPU_PRECISION,
|
|
25
25
|
pa as DEFAULT_VIEW_MODE,
|
|
26
26
|
O as DataManager,
|
|
@@ -31,7 +31,7 @@ export {
|
|
|
31
31
|
M as ErrorAggregator,
|
|
32
32
|
S as EventManager,
|
|
33
33
|
X as GRAPHTY_ERROR_CODES,
|
|
34
|
-
|
|
34
|
+
Ea as GREENS_COLORS,
|
|
35
35
|
Oa as GREEN_SUCCESS,
|
|
36
36
|
R as Graph,
|
|
37
37
|
da as GraphBackground,
|
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-CqOVV13Y.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-CqOVV13Y.js";
|
|
3
3
|
const g = "graphty-element-logging-config";
|
|
4
4
|
function O(t) {
|
|
5
5
|
try {
|
package/dist/schema.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
export type { Binding, BindingOverflow, Channel, ChannelValue, EdgeId, EdgeLinePattern, Encoding, LabelStyle, LayerId, LayerKind, LayerSource, LayerSpec, NodeId, Path, Query, ResultShape, Rgba, RunId, Scope, ScopeId, Selector, StaticStyle, StyleDocument, ThemeDescriptor, } from "./src/catalog/types";
|
|
23
23
|
export { isResultShape, RESULT_SHAPES } from "./src/catalog/types";
|
|
24
24
|
export type { AdHocData, EdgeStyleConfig, GraphBackgroundConfig, GraphSelectionStyleConfig, GraphSelectionStyleInput, ImageData, NodeStyleConfig, RichTextStyleType, ViewMode, } from "./src/config/index";
|
|
25
|
-
export { colorToHex, DEFAULT_SELECTION_STYLE, DEFAULT_VIEW_MODE, defaultEdgeStyle, defaultNodeStyle, defaultRichTextLabelStyle, EdgeStyle, GraphBackground, GraphSelectionStyleOpts, isViewMode, NodeShapes, NodeStyle, RichTextStyle, VIEW_MODE_VALUES, } from "./src/config/index";
|
|
25
|
+
export { colorToHex, DEFAULT_SELECTION_STYLE, DEFAULT_VIEW_MODE, defaultEdgeStyle, defaultNodeStyle, defaultRichTextLabelStyle, EdgeArrowTypes, EdgeLineTypes, EdgeStyle, GraphBackground, GraphSelectionStyleOpts, isViewMode, NodeShapes, NodeStyle, RichTextStyle, VIEW_MODE_VALUES, } from "./src/config/index";
|
|
26
26
|
export * from "./src/config/palettes/index";
|
|
27
27
|
export { areDistinguishableInGrayscale, colorDifference, isPaletteSafe, simulateDeuteranopia, simulateProtanopia, simulateTritanopia, toGrayscale, } from "./src/utils/styleHelpers/accessibility/colorblindSimulation";
|
|
28
28
|
export type { RgbColor } from "./src/utils/styleHelpers/color/interpolation";
|
package/dist/schema.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { R as N, e as x } from "./chunks/types-
|
|
2
|
-
import { M as
|
|
3
|
-
import { B as D, a as U, b as B, C as P, G as H, c as V, I as
|
|
4
|
-
import { D as Z, a as tt, G as nt, b as at, V as
|
|
5
|
-
import { E as rt,
|
|
6
|
-
import { c as
|
|
1
|
+
import { R as N, e as x } from "./chunks/types-C_c53VgR.js";
|
|
2
|
+
import { M as h, h as y, i as M } from "./chunks/interpolation-DY-PNpqX.js";
|
|
3
|
+
import { B as D, a as U, b as B, C as P, G as H, c as V, I as w, O as $, 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
|
+
import { D as Z, a as tt, G as nt, b as at, V as et, i as st } from "./chunks/GraphStyle-Cwr55SAE.js";
|
|
5
|
+
import { E as rt, a as ct, b as it, N as Ot, c as St, R as Rt, d as lt, e as ut, f as ft } from "./chunks/NodeStyle-CtmA7dXi.js";
|
|
6
|
+
import { c as Lt } 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);
|
|
9
9
|
if (!n)
|
|
@@ -11,11 +11,11 @@ function l(t) {
|
|
|
11
11
|
return [parseInt(n[1], 16), parseInt(n[2], 16), parseInt(n[3], 16)];
|
|
12
12
|
}
|
|
13
13
|
function E(t, n, o) {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
return
|
|
14
|
+
const s = (a) => {
|
|
15
|
+
const e = Math.round(Math.max(0, Math.min(255, a))).toString(16);
|
|
16
|
+
return e.length === 1 ? `0${e}` : e;
|
|
17
17
|
};
|
|
18
|
-
return `#${
|
|
18
|
+
return `#${s(t)}${s(n)}${s(o)}`;
|
|
19
19
|
}
|
|
20
20
|
function S(t) {
|
|
21
21
|
const n = t / 255;
|
|
@@ -25,44 +25,44 @@ function R(t) {
|
|
|
25
25
|
return t <= 31308e-7 ? t * 12.92 * 255 : (1.055 * Math.pow(t, 1 / 2.4) - 0.055) * 255;
|
|
26
26
|
}
|
|
27
27
|
function L(t) {
|
|
28
|
-
const [n, o,
|
|
28
|
+
const [n, o, s] = l(t), a = S(n), e = S(o), r = S(s), O = 0.567 * a + 0.433 * e + 0 * r, c = 0.558 * a + 0.442 * e + 0 * r, i = 0 * a + 0.242 * e + 0.758 * r;
|
|
29
29
|
return E(R(O), R(c), R(i));
|
|
30
30
|
}
|
|
31
31
|
function _(t) {
|
|
32
|
-
const [n, o,
|
|
32
|
+
const [n, o, s] = l(t), a = S(n), e = S(o), r = S(s), O = 0.625 * a + 0.375 * e + 0 * r, c = 0.7 * a + 0.3 * e + 0 * r, i = 0 * a + 0.3 * e + 0.7 * r;
|
|
33
33
|
return E(R(O), R(c), R(i));
|
|
34
34
|
}
|
|
35
35
|
function p(t) {
|
|
36
|
-
const [n, o,
|
|
36
|
+
const [n, o, s] = l(t), a = S(n), e = S(o), r = S(s), O = 0.95 * a + 0.05 * e + 0 * r, c = 0 * a + 0.433 * e + 0.567 * r, i = 0 * a + 0.475 * e + 0.525 * r;
|
|
37
37
|
return E(R(O), R(c), R(i));
|
|
38
38
|
}
|
|
39
39
|
function g(t) {
|
|
40
|
-
const [n, o,
|
|
40
|
+
const [n, o, s] = l(t), a = 0.2126 * n + 0.7152 * o + 0.0722 * s;
|
|
41
41
|
return E(a, a, a);
|
|
42
42
|
}
|
|
43
43
|
function f(t, n) {
|
|
44
|
-
const [o,
|
|
44
|
+
const [o, s, a] = l(t), [e, r, O] = l(n), c = o - e, i = s - r, u = a - O;
|
|
45
45
|
return Math.sqrt(c * c + i * i + u * u) / 2.55;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
return f(
|
|
47
|
+
function C(t, n, o = 10) {
|
|
48
|
+
const s = g(t), a = g(n);
|
|
49
|
+
return f(s, a) > o;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function b(t, n = 10) {
|
|
52
52
|
const o = {
|
|
53
53
|
protanopia: !0,
|
|
54
54
|
deuteranopia: !0,
|
|
55
55
|
tritanopia: !0,
|
|
56
56
|
grayscale: !0
|
|
57
57
|
};
|
|
58
|
-
for (let
|
|
59
|
-
for (let a =
|
|
60
|
-
const
|
|
58
|
+
for (let s = 0; s < t.length; s++)
|
|
59
|
+
for (let a = s + 1; a < t.length; a++) {
|
|
60
|
+
const e = t[s], r = t[a], O = L(e), c = L(r);
|
|
61
61
|
f(O, c) < n && (o.protanopia = !1);
|
|
62
|
-
const i = _(
|
|
62
|
+
const i = _(e), u = _(r);
|
|
63
63
|
f(i, u) < n && (o.deuteranopia = !1);
|
|
64
|
-
const
|
|
65
|
-
f(
|
|
64
|
+
const T = p(e), d = p(r);
|
|
65
|
+
f(T, d) < n && (o.tritanopia = !1), C(e, r, n) || (o.grayscale = !1);
|
|
66
66
|
}
|
|
67
67
|
return o;
|
|
68
68
|
}
|
|
@@ -73,16 +73,18 @@ export {
|
|
|
73
73
|
P as CARBON_COLORS,
|
|
74
74
|
Z as DEFAULT_SELECTION_STYLE,
|
|
75
75
|
tt as DEFAULT_VIEW_MODE,
|
|
76
|
-
rt as
|
|
76
|
+
rt as EdgeArrowTypes,
|
|
77
|
+
ct as EdgeLineTypes,
|
|
78
|
+
it as EdgeStyle,
|
|
77
79
|
H as GREENS_COLORS,
|
|
78
80
|
V as GREEN_SUCCESS,
|
|
79
81
|
nt as GraphBackground,
|
|
80
82
|
at as GraphSelectionStyleOpts,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
w as INFERNO_COLORS,
|
|
84
|
+
h as MISSING_DATA_COLOR,
|
|
85
|
+
Ot as NodeShapes,
|
|
86
|
+
St as NodeStyle,
|
|
87
|
+
$ as OKABE_ITO_COLORS,
|
|
86
88
|
F as ORANGES_COLORS,
|
|
87
89
|
W as ORANGE_WARNING,
|
|
88
90
|
Y as OTHER_GROUP_COLOR,
|
|
@@ -91,23 +93,23 @@ export {
|
|
|
91
93
|
q as PURPLE_GREEN_COLORS,
|
|
92
94
|
K as RED_BLUE_COLORS,
|
|
93
95
|
N as RESULT_SHAPES,
|
|
94
|
-
|
|
96
|
+
Rt as RichTextStyle,
|
|
95
97
|
v as TOL_MUTED_COLORS,
|
|
96
98
|
z as TOL_VIBRANT_COLORS,
|
|
97
|
-
|
|
99
|
+
et as VIEW_MODE_VALUES,
|
|
98
100
|
J as VIRIDIS_COLORS,
|
|
99
101
|
Q as YLORBR_COLORS,
|
|
100
|
-
|
|
102
|
+
C as areDistinguishableInGrayscale,
|
|
101
103
|
f as colorDifference,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
Lt as colorToHex,
|
|
105
|
+
lt as defaultEdgeStyle,
|
|
106
|
+
ut as defaultNodeStyle,
|
|
107
|
+
ft as defaultRichTextLabelStyle,
|
|
106
108
|
y as hexToRgb,
|
|
107
109
|
M as interpolatePalette,
|
|
108
|
-
|
|
110
|
+
b as isPaletteSafe,
|
|
109
111
|
x as isResultShape,
|
|
110
|
-
|
|
112
|
+
st as isViewMode,
|
|
111
113
|
_ as simulateDeuteranopia,
|
|
112
114
|
L as simulateProtanopia,
|
|
113
115
|
p as simulateTritanopia,
|
package/dist/session.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { R, e as _ } from "./chunks/types-
|
|
2
|
-
import { A as c, a as C, G as p, i as m, b as L } from "./chunks/GraphtyError-
|
|
3
|
-
import { p as O, q as U, R as I, t as P, u as y, w as N, x as D, y as w, z as v } from "./chunks/optionsFromZod-
|
|
4
|
-
import { D as h } from "./chunks/GraphSession-
|
|
5
|
-
import { a as b, b as x, c as F, d as z, Q as M, R as k, e as H, f as Y, S as j, T as q, g as Q, i as X, h as B, j as J, k as K } from "./chunks/GraphSession-
|
|
6
|
-
import { L as s } from "./chunks/scales-
|
|
1
|
+
import { R, e as _ } from "./chunks/types-C_c53VgR.js";
|
|
2
|
+
import { A as c, a as C, G as p, i as m, b as L } from "./chunks/GraphtyError-B93WRH3e.js";
|
|
3
|
+
import { p as O, q as U, R as I, t as P, u as y, w as N, x as D, y as w, z as v } from "./chunks/optionsFromZod-BuTOFgVM.js";
|
|
4
|
+
import { D as h } from "./chunks/GraphSession-dcwOjGJh.js";
|
|
5
|
+
import { a as b, b as x, c as F, d as z, Q as M, R as k, e as H, f as Y, S as j, T as q, g as Q, i as X, h as B, j as J, k as K } from "./chunks/GraphSession-dcwOjGJh.js";
|
|
6
|
+
import { L as s } from "./chunks/scales-B2d-7Bf0.js";
|
|
7
7
|
const u = [
|
|
8
8
|
{
|
|
9
9
|
id: "fixed",
|
package/dist/src/Graph.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export declare class Graph implements GraphContext {
|
|
|
49
49
|
runAlgorithmsOnLoad: boolean;
|
|
50
50
|
enableDetailedProfiling?: boolean;
|
|
51
51
|
private wasSettled;
|
|
52
|
+
/** How many loads `addDataFromSource` has started; the last one's id. */
|
|
53
|
+
private loadCount;
|
|
52
54
|
private resizeHandler;
|
|
53
55
|
/**
|
|
54
56
|
* The one acceleration controller this graph, its session and its element share.
|
|
@@ -202,11 +204,43 @@ export declare class Graph implements GraphContext {
|
|
|
202
204
|
*
|
|
203
205
|
* A load that fails part-way still paints: the rows that did arrive are in the store and on
|
|
204
206
|
* screen, so leaving them unpainted would be the same defect with a smaller blast radius.
|
|
207
|
+
*
|
|
208
|
+
* EVERY LOAD HAS AN ID. The promise resolves to it, and every event about this load --
|
|
209
|
+
* `data-loading-progress`, `data-loading-complete`, `data-loading-error`, `data-loaded` and
|
|
210
|
+
* the `error` beside a failure -- carries it as `loadId`, so a consumer that started two loads
|
|
211
|
+
* can tell whose report is whose.
|
|
205
212
|
* @param type - Type/name of the registered data source
|
|
206
213
|
* @param opts - Options to pass to the data source
|
|
207
|
-
* @
|
|
214
|
+
* @param options - How to load
|
|
215
|
+
* @param options.replace - Replace the graph with what the source holds, but only once all of
|
|
216
|
+
* it has parsed: a malformed or empty source rejects and leaves the graph as it was
|
|
217
|
+
* @returns Promise that resolves to the load's id when data is loaded
|
|
218
|
+
*/
|
|
219
|
+
addDataFromSource(type: string, opts?: object, options?: {
|
|
220
|
+
replace?: boolean;
|
|
221
|
+
}): Promise<{
|
|
222
|
+
loadId: number;
|
|
223
|
+
}>;
|
|
224
|
+
/**
|
|
225
|
+
* Give a load its id and its place in line, synchronously, at the moment it was asked for.
|
|
226
|
+
*
|
|
227
|
+
* `loadFromFile` and `loadFromUrl` read before they load, so taking the place when the read
|
|
228
|
+
* finished would let an earlier, slower read overtake a later load. Ids rise in call order.
|
|
229
|
+
* @param replace - Whether the load replaces the graph
|
|
230
|
+
* @returns The reservation to hand to `loadReserved`
|
|
208
231
|
*/
|
|
209
|
-
|
|
232
|
+
private reserveLoad;
|
|
233
|
+
/**
|
|
234
|
+
* Run a load whose place `reserveLoad` already took, then repaint what it loaded.
|
|
235
|
+
* @param type - Type/name of the registered data source
|
|
236
|
+
* @param opts - Options to pass to the data source
|
|
237
|
+
* @param load - The reservation
|
|
238
|
+
* @param load.loadId - The load's id
|
|
239
|
+
* @param load.generation - The load's place in line
|
|
240
|
+
* @param load.replace - Whether the load replaces the graph
|
|
241
|
+
* @returns The load's id
|
|
242
|
+
*/
|
|
243
|
+
private loadReserved;
|
|
210
244
|
/**
|
|
211
245
|
* Load graph data from a File object with auto-format detection
|
|
212
246
|
* @param file - File object from file input
|
|
@@ -216,13 +250,18 @@ export declare class Graph implements GraphContext {
|
|
|
216
250
|
* @param options.edgeSource - Where the node an edge starts at is named in the record. Left
|
|
217
251
|
* unset, the element reads `source`, then `src`, then `from`
|
|
218
252
|
* @param options.edgeTarget - Where the node an edge ends at is named in the record
|
|
253
|
+
* @param options.replace - Replace the graph, once the file has parsed; see `addDataFromSource`
|
|
254
|
+
* @returns Promise that resolves to the load's id when data is loaded
|
|
219
255
|
*/
|
|
220
256
|
loadFromFile(file: File, options?: {
|
|
221
257
|
format?: string;
|
|
222
258
|
nodeIdPath?: string;
|
|
223
259
|
edgeSource?: string;
|
|
224
260
|
edgeTarget?: string;
|
|
225
|
-
|
|
261
|
+
replace?: boolean;
|
|
262
|
+
}): Promise<{
|
|
263
|
+
loadId: number;
|
|
264
|
+
}>;
|
|
226
265
|
/**
|
|
227
266
|
* Load graph data from a URL with auto-format detection
|
|
228
267
|
* @remarks
|
|
@@ -237,6 +276,8 @@ export declare class Graph implements GraphContext {
|
|
|
237
276
|
* @param options.edgeSource - Where the node an edge starts at is named in the record. Left
|
|
238
277
|
* unset, the element reads `source`, then `src`, then `from`
|
|
239
278
|
* @param options.edgeTarget - Where the node an edge ends at is named in the record
|
|
279
|
+
* @param options.replace - Replace the graph, once the data has parsed; see `addDataFromSource`
|
|
280
|
+
* @returns Promise that resolves to the load's id when data is loaded
|
|
240
281
|
* @example
|
|
241
282
|
* ```typescript
|
|
242
283
|
* // Auto-detect format from extension
|
|
@@ -254,7 +295,10 @@ export declare class Graph implements GraphContext {
|
|
|
254
295
|
nodeIdPath?: string;
|
|
255
296
|
edgeSource?: string;
|
|
256
297
|
edgeTarget?: string;
|
|
257
|
-
|
|
298
|
+
replace?: boolean;
|
|
299
|
+
}): Promise<{
|
|
300
|
+
loadId: number;
|
|
301
|
+
}>;
|
|
258
302
|
/**
|
|
259
303
|
* Add a single node to the graph.
|
|
260
304
|
* @param node - Node data object to add
|
|
@@ -358,6 +402,21 @@ export declare class Graph implements GraphContext {
|
|
|
358
402
|
* @returns Promise that resolves once the graph holds exactly these edges
|
|
359
403
|
*/
|
|
360
404
|
setEdges(edges: Record<string | number, unknown>[], options?: AddEdgesOptions & QueueableOptions): Promise<void>;
|
|
405
|
+
/**
|
|
406
|
+
* Replace every node in the graph with a new set.
|
|
407
|
+
*
|
|
408
|
+
* What the `node-data` property does, and the node half of {@link setEdges}. A node whose id is
|
|
409
|
+
* not in the new set is removed the way {@link removeNodes} removes one, so the edges attached
|
|
410
|
+
* to it go too. A node whose id IS in the new set keeps its object and its position; its data
|
|
411
|
+
* is not rewritten. A set past the render ceiling is refused with `E_TOO_LARGE` before a node
|
|
412
|
+
* is removed, so the graph keeps the nodes it had.
|
|
413
|
+
* @param nodes - the nodes the graph should hold afterwards
|
|
414
|
+
* @param idPath - Key to use for node IDs (default: the configured node id path)
|
|
415
|
+
* @param options - Queue options for operation ordering
|
|
416
|
+
* @returns Promise that resolves once the graph holds exactly these nodes
|
|
417
|
+
* @since 2.3.0
|
|
418
|
+
*/
|
|
419
|
+
setNodes(nodes: Record<string | number, unknown>[], idPath?: string, options?: QueueableOptions): Promise<void>;
|
|
361
420
|
/**
|
|
362
421
|
* Set the layout algorithm and configuration.
|
|
363
422
|
* @remarks
|
|
@@ -523,6 +582,10 @@ export declare class Graph implements GraphContext {
|
|
|
523
582
|
* already-applied layer kept that layer's place, and the place it had was the order the RUNS
|
|
524
583
|
* FINISHED in -- so `applySuggestedStyles(["pagerank", "louvain"])` painted a PageRank
|
|
525
584
|
* picture whenever PageRank happened to finish last, and a Louvain one whenever it did not.
|
|
585
|
+
*
|
|
586
|
+
* It starts the style edits and returns at once. To wait for the picture, await
|
|
587
|
+
* {@link Graph.waitForStableFrame} after the call: it settles only once every suggested layer
|
|
588
|
+
* is added, stacked in the order named and painted.
|
|
526
589
|
* @param algorithmKey - A catalogue key such as "degree", a 1.10 address such as
|
|
527
590
|
* "graphty:degree", or an array of either.
|
|
528
591
|
* @returns True when at least one suggestion was applied, false when no finished run of that
|
|
@@ -714,7 +777,13 @@ export declare class Graph implements GraphContext {
|
|
|
714
777
|
*
|
|
715
778
|
* It does nothing while no style pass is bound: a pass whose answer nothing draws is a pass
|
|
716
779
|
* over the graph for no picture.
|
|
717
|
-
*
|
|
780
|
+
*
|
|
781
|
+
* NOTHING AFTER TEARDOWN, AND NOTHING ACROSS A CLEAR. It is queued behind loads and runs, so
|
|
782
|
+
* it can come due after `dispose()` or while the data it started on is being cleared. Either
|
|
783
|
+
* one stops it, quietly: the graph it was painting is gone, and that is not an error.
|
|
784
|
+
* @param signal - The queue operation's own signal, when it runs as one.
|
|
785
|
+
* @returns True when the whole graph was painted, false when there was nothing to paint with
|
|
786
|
+
* or the pass was stopped.
|
|
718
787
|
*/
|
|
719
788
|
private repaintFromSession;
|
|
720
789
|
/**
|
|
@@ -984,7 +1053,9 @@ export declare class Graph implements GraphContext {
|
|
|
984
1053
|
* Set whether the layout engine should run.
|
|
985
1054
|
*
|
|
986
1055
|
* Resuming a simulation layout that had settled restarts it, so "play" moves nodes again;
|
|
987
|
-
* pausing stops the per-frame stepping and nothing else.
|
|
1056
|
+
* pausing stops the per-frame stepping and nothing else. A pause holds until
|
|
1057
|
+
* `setRunning(true)`: loading data, setting a layout, an accelerator attaching or a drag
|
|
1058
|
+
* never resume it.
|
|
988
1059
|
* @param running - True to start the layout, false to stop it
|
|
989
1060
|
*/
|
|
990
1061
|
setRunning(running: boolean): void;
|
|
@@ -1552,7 +1623,8 @@ export declare class Graph implements GraphContext {
|
|
|
1552
1623
|
* Set graph data (delegates to data manager)
|
|
1553
1624
|
* @param data - Graph data object
|
|
1554
1625
|
* @param data.nodes - Array of node data objects
|
|
1555
|
-
* @param data.edges - Array of edge data objects
|
|
1626
|
+
* @param data.edges - Array of edge data objects. They load as one batch, so the endpoint
|
|
1627
|
+
* spelling (source/target, src/dst or from/to) is decided once for all of them.
|
|
1556
1628
|
*/
|
|
1557
1629
|
setData(data: {
|
|
1558
1630
|
nodes: Record<string, unknown>[];
|
|
@@ -82,7 +82,11 @@ type AccelerationOutcome<T> = {
|
|
|
82
82
|
interface AccelerationControllerOptions {
|
|
83
83
|
/** What the consumer asked for. Defaults to `"auto"`. */
|
|
84
84
|
readonly policy?: AccelerationPolicy;
|
|
85
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* The `acceleration.minNodes` threshold. Left out, the general threshold is 0 and the
|
|
87
|
+
* built-in per-capability floors of {@link ACCELERATION_MIN_NODES_BY_CAPABILITY} apply; any
|
|
88
|
+
* value, including 0, is the consumer's own number and switches those floors off.
|
|
89
|
+
*/
|
|
86
90
|
readonly minNodes?: number;
|
|
87
91
|
/** The largest graph an accelerator will be asked to compute exactly, passed to the factory. */
|
|
88
92
|
readonly exactMaxNodes?: number;
|
|
@@ -223,9 +227,10 @@ export declare class AccelerationController {
|
|
|
223
227
|
/**
|
|
224
228
|
* Decides where one piece of work runs, before any of it starts.
|
|
225
229
|
*
|
|
226
|
-
* The decision is the only place a CPU answer can come from, and there are
|
|
230
|
+
* The decision is the only place a CPU answer can come from, and there are five of them:
|
|
227
231
|
* the policy is `"off"`, no accelerator is attached, the graph is below
|
|
228
|
-
* `acceleration.minNodes`,
|
|
232
|
+
* `acceleration.minNodes`, the graph is below the built-in floor measured for this
|
|
233
|
+
* capability, or the attached accelerator does not implement this capability.
|
|
229
234
|
*
|
|
230
235
|
* Under `"required"` two of them throw instead of answering quietly -- no accelerator, and
|
|
231
236
|
* an accelerator without this capability -- because both are absence, and absence is what
|
|
@@ -233,6 +238,12 @@ export declare class AccelerationController {
|
|
|
233
238
|
* runs on the CPU: an accelerator IS attached and healthy, and the threshold is a statement
|
|
234
239
|
* about what pays, not about what is possible. `"off"` cannot arise under `"required"`,
|
|
235
240
|
* because a policy is one of three.
|
|
241
|
+
*
|
|
242
|
+
* The built-in floor is different from the threshold in both directions. It applies only
|
|
243
|
+
* while the consumer has NOT set `acceleration.minNodes` -- a consumer's number, even 0,
|
|
244
|
+
* replaces it -- and it does NOT apply under `"required"`, because `"required"` is the
|
|
245
|
+
* policy a benchmark runs under and a benchmark of the small end of the curve must be able to
|
|
246
|
+
* reach the device.
|
|
236
247
|
* @param work - The capability the work needs and the size of the graph it is over.
|
|
237
248
|
* @returns Where the work runs.
|
|
238
249
|
* @throws A `GraphtyError` with `E_NO_ACCELERATOR` when the policy is `"required"` and the
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* The file is free of Babylon.js, Lit and DOM references so it can be re-exported from the
|
|
17
17
|
* Node-safe entry points.
|
|
18
18
|
*/
|
|
19
|
+
import type { AlgorithmAccelerator } from "@graphty/algorithms";
|
|
19
20
|
import type { AccelerationErrorCode } from "../errors";
|
|
20
21
|
/**
|
|
21
22
|
* Where hardware acceleration stands, in one word.
|
|
@@ -362,3 +363,80 @@ export declare const ACCELERATION_MIN_NODES_KEY = "acceleration.minNodes";
|
|
|
362
363
|
* which is not part of the published documentation site.
|
|
363
364
|
*/
|
|
364
365
|
export declare const ACCELERATION_MIN_NODES_DEFAULT = 0;
|
|
366
|
+
/**
|
|
367
|
+
* Where and when the per-capability floors below were measured, as the plan's reason quotes it.
|
|
368
|
+
*/
|
|
369
|
+
export declare const ACCELERATION_MIN_NODES_MEASUREMENT = "RTX 4070 SUPER, headless Chromium, 2026-09-25";
|
|
370
|
+
/**
|
|
371
|
+
* The node count below which the element declines the accelerator for one capability, when the
|
|
372
|
+
* consumer has not set {@link ACCELERATION_MIN_NODES_KEY} themselves.
|
|
373
|
+
*
|
|
374
|
+
* {@link ACCELERATION_MIN_NODES_DEFAULT} is 0 because it was measured for the forceatlas2
|
|
375
|
+
* LAYOUT, whose accelerated frame was never slower than the CPU's at any size. A traversal is a
|
|
376
|
+
* different shape of work: the whole walk is one call, and on the device that call has a floor
|
|
377
|
+
* of several submit round trips whatever the size, so below some node count the CPU walk is done
|
|
378
|
+
* before the device has started. One number cannot serve both, which is why the layout default
|
|
379
|
+
* stays 0 and each algorithm capability the adapters route carries its own floor here.
|
|
380
|
+
*
|
|
381
|
+
* MEASURED, not guessed. `tmp/traversal-threshold/kernel-cpu-vs-gpu.ts` (the harness, kept
|
|
382
|
+
* out of the tree) mounted `<graphty-element acceleration="required">` in headless Chromium on
|
|
383
|
+
* the dev box (RTX 4070 SUPER through ANGLE's Vulkan backend, 2026-09-25, load average
|
|
384
|
+
* 18 to 23), took the accelerator the element built, built seeded undirected graphs with ten
|
|
385
|
+
* edges per node and integer weights 1..10 in the page, and timed the two dispatchers
|
|
386
|
+
* `Algorithm.accelerated()` uses -- `accelerated(null)` for the CPU port and
|
|
387
|
+
* `accelerated(narrowAlgorithms(accelerator))` for the device -- directly on the snapshot, so no
|
|
388
|
+
* renderer frame is in the loop. Medians of nine warm calls after one cold call, in ms:
|
|
389
|
+
*
|
|
390
|
+
* | nodes / edges | BFS cpu | BFS gpu | sssp cpu | sssp gpu | pageRank cpu | pageRank gpu | components cpu | components gpu |
|
|
391
|
+
* | ------------- | ------: | ------: | -------: | -------: | -----------: | -----------: | -------------: | -------------: |
|
|
392
|
+
* | 1k / 10k | 0.1 | 7.8 | 0.3 | 7.3 | 0.7 | 3.0 | 0.2 | 3.9 |
|
|
393
|
+
* | 5k / 50k | 0.6 | 8.8 | 1.6 | 7.9 | 5.3 | 2.9 | 1.2 | 5.3 |
|
|
394
|
+
* | 10k / 100k | 1.0 | 7.5 | 2.8 | 7.2 | 4.6 | 2.9 | 2.3 | 7.4 |
|
|
395
|
+
* | 20k / 200k | 1.7 | 9.1 | 3.8 | 13.5 | 16.2 | 3.0 | 4.8 | 7.5 |
|
|
396
|
+
* | 50k / 500k | 5.7 | 13.0 | 25.8 | 27.6 | 50.3 | 4.3 | 11.6 | 7.8 |
|
|
397
|
+
* | 100k / 1M | 9.8 | 17.3 | 30.4 | 49.2 | 67.4 | 5.6 | 16.2 | 8.6 |
|
|
398
|
+
* | 200k / 2M | 17.6 | 23.2 | 73.0 | 79.6 | 148.3 | 10.5 | 29.9 | 11.5 |
|
|
399
|
+
* | 500k / 5M | 88.3 | 33.6 | 343.8 | 150.3 | 523.0 | 36.1 | 99.7 | 20.9 |
|
|
400
|
+
* | 1M / 10M | 250.9 | 24.2 | 1031.1 | 274.9 | 1762.4 | 17.5 | 215.7 | 43.2 |
|
|
401
|
+
*
|
|
402
|
+
* The two traversals were then measured twice more around their crossover, because the device's
|
|
403
|
+
* time at one size moves with what else the box is doing (the first sweep's 200k row was taken
|
|
404
|
+
* at a load average of 22.6, the repeats at about 18):
|
|
405
|
+
*
|
|
406
|
+
* | nodes / edges | BFS cpu | BFS gpu | sssp cpu | sssp gpu |
|
|
407
|
+
* | ------------- | ------: | ------: | -------: | -------: |
|
|
408
|
+
* | 100k / 1M | 7.4 | 9.5 | 26.9 | 20.9 |
|
|
409
|
+
* | 200k / 2M | 15.6 | 10.1 | 66.3 | 37.8 |
|
|
410
|
+
* | 200k / 2M | 17.8 | 11.0 | 70.6 | 42.5 |
|
|
411
|
+
* | 300k / 3M | 35.2 | 13.3 | 129.2 | 77.1 |
|
|
412
|
+
* | 300k / 3M | 34.4 | 18.9 | 129.8 | 65.2 |
|
|
413
|
+
* | 400k / 4M | 63.3 | 30.7 | 226.6 | 128.2 |
|
|
414
|
+
* | 500k / 5M | 93.1 | 32.5 | 361.9 | 200.0 |
|
|
415
|
+
*
|
|
416
|
+
* So: BFS loses at 100k in both runs and splits at 200k (one loss, two wins); Dijkstra splits at
|
|
417
|
+
* both 100k and 200k; from 300k up the device wins every run of both by two to ten times.
|
|
418
|
+
* PageRank wins from 5k and connected components from 50k, in the one run each was measured.
|
|
419
|
+
*
|
|
420
|
+
* A floor is the smallest measured size at which the device's median was at or below the CPU
|
|
421
|
+
* port's IN EVERY RUN, so a size that won under one load and lost under another is below it. A
|
|
422
|
+
* capability that is not listed has no floor and follows {@link ACCELERATION_MIN_NODES_DEFAULT}.
|
|
423
|
+
*
|
|
424
|
+
* Two things the table does not cover. It is one card and one browser: a slower CPU or a
|
|
425
|
+
* slower device moves the crossover, and a consumer who has measured their own machine sets
|
|
426
|
+
* `acceleration.minNodes`, which replaces every floor here with their number. And it is the
|
|
427
|
+
* kernel's time, not the run's: through the element a run also publishes its result rows,
|
|
428
|
+
* which costs the same on either path and is why the element-level numbers in the issue read
|
|
429
|
+
* higher on both sides.
|
|
430
|
+
*
|
|
431
|
+
* Under `acceleration="required"` the floors do not apply: `"required"` is what a benchmark
|
|
432
|
+
* runs under, and a benchmark of the small end of the curve has to reach the device.
|
|
433
|
+
*/
|
|
434
|
+
/**
|
|
435
|
+
* The capabilities a floor can name: the seam's algorithm members, by their exact names.
|
|
436
|
+
*
|
|
437
|
+
* Typed against the seam rather than as a string so that a member renamed on one side and not
|
|
438
|
+
* the other is a compile error here, not a floor that silently stops applying and sends that
|
|
439
|
+
* capability back to the GPU at every size.
|
|
440
|
+
*/
|
|
441
|
+
export type FlooredCapability = Exclude<keyof AlgorithmAccelerator, "kind" | "release">;
|
|
442
|
+
export declare const ACCELERATION_MIN_NODES_BY_CAPABILITY: Readonly<Partial<Record<FlooredCapability, number>>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FieldDescriptor, NodeId } from "../catalog/types";
|
|
2
|
+
import { MetricAlgorithm } from "./metrics/MetricAlgorithm";
|
|
3
|
+
import type { MetricMeasurement, MetricRunContext } from "./metrics/types";
|
|
4
|
+
/**
|
|
5
|
+
* K-core decomposition: how deep in the graph's densely connected core each node sits.
|
|
6
|
+
*
|
|
7
|
+
* A node's core number is the largest k for which it belongs to a k-core -- the largest part of
|
|
8
|
+
* the graph in which every node has at least k neighbours. Every node has one, so every node is
|
|
9
|
+
* measured.
|
|
10
|
+
*/
|
|
11
|
+
export declare class KCoreAlgorithm extends MetricAlgorithm {
|
|
12
|
+
static namespace: string;
|
|
13
|
+
static type: string;
|
|
14
|
+
/**
|
|
15
|
+
* The fields a k-core result publishes.
|
|
16
|
+
* @returns The uniform node-metric fields.
|
|
17
|
+
*/
|
|
18
|
+
protected resultFields(): readonly FieldDescriptor[];
|
|
19
|
+
/**
|
|
20
|
+
* Give every node its core number.
|
|
21
|
+
* @param context - Where progress goes and where cancellation arrives.
|
|
22
|
+
* @param nodeIds - The nodes to measure.
|
|
23
|
+
* @returns One core number per node.
|
|
24
|
+
*/
|
|
25
|
+
protected measure(context: MetricRunContext, nodeIds: readonly NodeId[]): Promise<MetricMeasurement>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Link prediction: the pairs of unconnected nodes most likely to be joined next.
|
|
3
|
+
*
|
|
4
|
+
* The answer is a list of scored pairs, not a value on each node or edge -- a predicted link is
|
|
5
|
+
* an edge that does not exist yet, so there is no element to hang it on. The result is shaped as
|
|
6
|
+
* a pair list, which is why a run of it suggests no style: painting it would mean inventing the
|
|
7
|
+
* thing it painted.
|
|
8
|
+
*/
|
|
9
|
+
import { adamicAdarPrediction, commonNeighborsPrediction } from "@graphty/algorithms";
|
|
10
|
+
import { type OptionsSchema as ZodOptionsSchema } from "../config";
|
|
11
|
+
import { type AlgorithmOutput, type AlgorithmRunContext, DeclaredAlgorithm } from "./results";
|
|
12
|
+
import type { OptionsSchema } from "./types/OptionSchema";
|
|
13
|
+
/** The two scoring methods, by the name the `method` option takes. */
|
|
14
|
+
declare const METHODS: {
|
|
15
|
+
readonly "adamic-adar": typeof adamicAdarPrediction;
|
|
16
|
+
readonly "common-neighbors": typeof commonNeighborsPrediction;
|
|
17
|
+
};
|
|
18
|
+
/** Options for link prediction. */
|
|
19
|
+
interface LinkPredictionOptions extends Record<string, unknown> {
|
|
20
|
+
/** Which score ranks the pairs. */
|
|
21
|
+
method: keyof typeof METHODS;
|
|
22
|
+
/** How many of the best-scoring pairs to keep. */
|
|
23
|
+
topK: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Link prediction: scores every pair of nodes that is not already joined by how many neighbours
|
|
27
|
+
* the two share, and keeps the best.
|
|
28
|
+
*/
|
|
29
|
+
export declare class LinkPredictionAlgorithm extends DeclaredAlgorithm<LinkPredictionOptions> {
|
|
30
|
+
static namespace: string;
|
|
31
|
+
static type: string;
|
|
32
|
+
static zodOptionsSchema: ZodOptionsSchema;
|
|
33
|
+
static optionsSchema: OptionsSchema;
|
|
34
|
+
/**
|
|
35
|
+
* Score every unconnected pair of nodes and keep the best.
|
|
36
|
+
* @param context - What the element gave the run.
|
|
37
|
+
* @returns The scored pairs, best first, or null when the graph has no nodes.
|
|
38
|
+
*/
|
|
39
|
+
compute(context: AlgorithmRunContext): Promise<AlgorithmOutput | null>;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
* `JSON.stringify`, a `postMessage` to a worker and a write to a saved document, and a
|
|
21
21
|
* closure survives none of those. A cost estimate that needs code belongs to
|
|
22
22
|
* `session.estimate()`, which runs where the code is.
|
|
23
|
-
* - **The table only lists what ships.**
|
|
24
|
-
* `clustering-coefficient`,
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* - **The table only lists what ships.** Two members of `KNOWN_ALGORITHMS` -- `all-paths` and
|
|
24
|
+
* `clustering-coefficient`, listed in `DEPRECATED_ALGORITHMS` -- are not implemented and
|
|
25
|
+
* therefore have no descriptor here. A catalogue that advertised them would be lying about
|
|
26
|
+
* what the element can run.
|
|
27
27
|
*
|
|
28
28
|
* Two conventions worth stating once:
|
|
29
29
|
*
|
|
@@ -70,7 +70,7 @@ export interface BuiltInAlgorithmDescriptor extends AlgorithmDescriptor {
|
|
|
70
70
|
/**
|
|
71
71
|
* Every algorithm this package registers, as a plain-JSON descriptor.
|
|
72
72
|
*
|
|
73
|
-
* Twenty-
|
|
73
|
+
* Twenty-three descriptors for twenty-five registered algorithms: the two single-source
|
|
74
74
|
* shortest-path engines are one key with a `method` parameter, and the two component algorithms
|
|
75
75
|
* are one key with a `strength` parameter. Each descriptor's `legacyKeys` names the 1.10 keys it
|
|
76
76
|
* replaces and the parameters that reproduce them.
|
|
@@ -9,8 +9,8 @@ export type { LabelAnimation, LabelBadge, LabelGradientDirection, LabelGradientT
|
|
|
9
9
|
export { LABEL_STYLE_FIELDS } from "./label-style";
|
|
10
10
|
export type { OptionsFromZodOptions, OptionsSource, OptionUiMeta } from "./optionsFromZod";
|
|
11
11
|
export { optionsFromZod } from "./optionsFromZod";
|
|
12
|
-
export type { AlgorithmDescriptor, AlgorithmKey, AttributeDescriptor, AttributeType, Binding, CameraDescriptor, CameraId, CatalogApi, Channel, ChannelValue, CostClass, DrawingMode, EdgeId, EdgeLinePattern, Encoding, FieldDescriptor, FormatDescriptor, FormatId, FunctionDescriptor, GraphtyErrorCode, KnownAlgorithm, LabelStyle, LayerId, LayerKind, LayerSource, LayerSpec, LayoutDescriptor, LayoutId, LogSinkDescriptor, LogSinkId, MetricAvailability, NodeId, OptionBound, OptionChoice, OptionDescriptor, OptionType, PaletteDescriptor, PaletteId, Path, Query, QueryValidation, ResultShape, Rgba, RunId, ScaleDescriptor, Scope, ScopeId, Selector, StaticStyle, StyleDocument, ThemeDescriptor, } from "./types";
|
|
13
|
-
export { ATTRIBUTE_TYPES, COST_CLASSES, isAttributeType, isCostClass, isOptionBound, isOptionType, isResultShape, KNOWN_ALGORITHMS, KNOWN_CAMERA_IDS, KNOWN_FORMAT_IDS, KNOWN_LAYOUT_IDS, KNOWN_LOG_SINK_IDS, KNOWN_PALETTE_IDS, OPTION_BOUND_SOURCES, OPTION_TYPES, RESULT_SHAPES, } from "./types";
|
|
12
|
+
export type { AlgorithmDescriptor, AlgorithmKey, AttributeDescriptor, AttributeType, Binding, CameraDescriptor, CameraId, CatalogApi, Channel, ChannelValue, CostClass, DeprecatedAlgorithm, DeprecatedCatalogMethod, DrawingMode, EdgeId, EdgeLinePattern, Encoding, FieldDescriptor, FormatDescriptor, FormatId, FunctionDescriptor, GraphtyErrorCode, KnownAlgorithm, LabelStyle, LayerId, LayerKind, LayerSource, LayerSpec, LayoutDescriptor, LayoutId, LogSinkDescriptor, LogSinkId, MetricAvailability, NodeId, OptionBound, OptionChoice, OptionDescriptor, OptionType, PaletteDescriptor, PaletteId, Path, Query, QueryValidation, ResultShape, Rgba, RunId, ScaleDescriptor, Scope, ScopeId, Selector, StaticStyle, StyleDocument, ThemeDescriptor, } from "./types";
|
|
13
|
+
export { ATTRIBUTE_TYPES, COST_CLASSES, DEPRECATED_ALGORITHMS, isAttributeType, isCostClass, isOptionBound, isOptionType, isResultShape, KNOWN_ALGORITHMS, KNOWN_CAMERA_IDS, KNOWN_FORMAT_IDS, KNOWN_LAYOUT_IDS, KNOWN_LOG_SINK_IDS, KNOWN_PALETTE_IDS, OPTION_BOUND_SOURCES, OPTION_TYPES, RESULT_SHAPES, } from "./types";
|
|
14
14
|
/**
|
|
15
15
|
* What the element does NOT serve on the styling surface, said out loud.
|
|
16
16
|
*
|