@kanzo-tech/graph 0.14.0 → 0.15.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 +12 -15
- package/dist/core/categories.d.ts +18 -6
- package/dist/core/categories.d.ts.map +1 -1
- package/dist/core/categories.js +41 -10
- package/dist/core/categories.js.map +1 -1
- package/dist/core/channels.d.ts +10 -5
- package/dist/core/channels.d.ts.map +1 -1
- package/dist/core/channels.js +11 -13
- package/dist/core/channels.js.map +1 -1
- package/dist/core/detail.d.ts +14 -8
- package/dist/core/detail.d.ts.map +1 -1
- package/dist/core/detail.js +33 -15
- package/dist/core/detail.js.map +1 -1
- package/dist/core/filter.d.ts +3 -1
- package/dist/core/filter.d.ts.map +1 -1
- package/dist/core/filter.js +54 -50
- package/dist/core/filter.js.map +1 -1
- package/dist/core/load.d.ts +58 -0
- package/dist/core/load.d.ts.map +1 -0
- package/dist/core/load.js +115 -0
- package/dist/core/load.js.map +1 -0
- package/dist/core/state.d.ts +27 -55
- package/dist/core/state.d.ts.map +1 -1
- package/dist/core/store.d.ts +1 -3
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/store.js +160 -175
- package/dist/core/store.js.map +1 -1
- package/dist/core/types.d.ts +21 -17
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -25
- package/dist/index.js.map +1 -1
- package/dist/parts/gesture.d.ts +1 -10
- package/dist/parts/gesture.d.ts.map +1 -1
- package/dist/parts/gesture.js +28 -28
- package/dist/parts/gesture.js.map +1 -1
- package/dist/parts/graph-canvas.d.ts.map +1 -1
- package/dist/parts/graph-canvas.js +119 -108
- package/dist/parts/graph-canvas.js.map +1 -1
- package/dist/parts/graph-inspector.d.ts +4 -4
- package/dist/parts/graph-inspector.d.ts.map +1 -1
- package/dist/parts/graph-inspector.js +55 -57
- package/dist/parts/graph-inspector.js.map +1 -1
- package/dist/parts/graph-legend.d.ts +4 -4
- package/dist/parts/graph-legend.d.ts.map +1 -1
- package/dist/parts/graph-legend.js +21 -21
- package/dist/parts/graph-legend.js.map +1 -1
- package/dist/parts/overlays.d.ts +2 -4
- package/dist/parts/overlays.d.ts.map +1 -1
- package/dist/parts/overlays.js +45 -45
- package/dist/parts/overlays.js.map +1 -1
- package/dist/react/use-graph-state.d.ts +4 -2
- package/dist/react/use-graph-state.d.ts.map +1 -1
- package/dist/react/use-graph-state.js +10 -6
- package/dist/react/use-graph-state.js.map +1 -1
- package/dist/react/use-graph.d.ts +1 -4
- package/dist/react/use-graph.d.ts.map +1 -1
- package/dist/react/use-graph.js +38 -49
- package/dist/react/use-graph.js.map +1 -1
- package/dist/render/graph-looks.d.ts.map +1 -1
- package/dist/render/graph-looks.js.map +1 -1
- package/dist/render/graph-model.d.ts +6 -8
- package/dist/render/graph-model.d.ts.map +1 -1
- package/dist/render/graph-model.js +51 -57
- package/dist/render/graph-model.js.map +1 -1
- package/dist/render/graph-sim.d.ts +2 -3
- package/dist/render/graph-sim.d.ts.map +1 -1
- package/dist/render/graph-sim.js.map +1 -1
- package/dist/render/renderer.d.ts +6 -11
- package/dist/render/renderer.d.ts.map +1 -1
- package/dist/render/renderer.js +120 -173
- package/dist/render/renderer.js.map +1 -1
- package/dist/section.d.ts.map +1 -1
- package/dist/section.js +3 -7
- package/dist/section.js.map +1 -1
- package/package.json +11 -11
- package/dist/core/refine.d.ts +0 -14
- package/dist/core/refine.d.ts.map +0 -1
- package/dist/core/refine.js +0 -20
- package/dist/core/refine.js.map +0 -1
- package/dist/core/resident.d.ts +0 -79
- package/dist/core/resident.d.ts.map +0 -1
- package/dist/core/resident.js +0 -44
- package/dist/core/resident.js.map +0 -1
- package/dist/core/scheduler.d.ts +0 -42
- package/dist/core/scheduler.d.ts.map +0 -1
- package/dist/core/scheduler.js +0 -77
- package/dist/core/scheduler.js.map +0 -1
- package/dist/core/tile-matrix.d.ts +0 -37
- package/dist/core/tile-matrix.d.ts.map +0 -1
- package/dist/core/tile-matrix.js +0 -49
- package/dist/core/tile-matrix.js.map +0 -1
- package/dist/core/tile.d.ts +0 -54
- package/dist/core/tile.d.ts.map +0 -1
- package/dist/core/tile.js +0 -76
- package/dist/core/tile.js.map +0 -1
- package/dist/core/tileset.d.ts +0 -59
- package/dist/core/tileset.d.ts.map +0 -1
- package/dist/core/tileset.js +0 -177
- package/dist/core/tileset.js.map +0 -1
- package/dist/render/adaptive.d.ts +0 -27
- package/dist/render/adaptive.d.ts.map +0 -1
- package/dist/render/adaptive.js +0 -25
- package/dist/render/adaptive.js.map +0 -1
- package/dist/render/compose.d.ts +0 -51
- package/dist/render/compose.d.ts.map +0 -1
- package/dist/render/compose.js +0 -107
- package/dist/render/compose.js.map +0 -1
- package/dist/render/encode.d.ts +0 -42
- package/dist/render/encode.d.ts.map +0 -1
- package/dist/render/encode.js +0 -68
- package/dist/render/encode.js.map +0 -1
package/dist/core/store.js
CHANGED
|
@@ -1,66 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return s.length !== n.length ? n : n.every((d, c) => {
|
|
17
|
-
var r;
|
|
18
|
-
return d.content === ((r = s[c]) == null ? void 0 : r.content);
|
|
19
|
-
}) ? s : n;
|
|
1
|
+
import { domainOf as Y } from "./categories.js";
|
|
2
|
+
import { bindingOf as Q } from "./channels.js";
|
|
3
|
+
import { graphClient as Z, publish as x, filterFor as ee } from "./filter.js";
|
|
4
|
+
import { drawnTables as ne, loadEncoding as te, loadGraph as re, maskOf as U, readKept as oe } from "./load.js";
|
|
5
|
+
const le = (a, r) => JSON.stringify(a, (p, s) => typeof s == "bigint" ? `${s}n` : s) === JSON.stringify(r, (p, s) => typeof s == "bigint" ? `${s}n` : s), se = (a) => typeof (a == null ? void 0 : a.then) == "function";
|
|
6
|
+
function ie(a, r, p) {
|
|
7
|
+
const s = r.domain.map(() => 0);
|
|
8
|
+
let l = 0;
|
|
9
|
+
for (let i = 0; i < a.size; i++) {
|
|
10
|
+
if (p && !p[i] || Number.isNaN(a.positions[i * 2])) continue;
|
|
11
|
+
l++;
|
|
12
|
+
const b = r.ranks[i];
|
|
13
|
+
s[b] = (s[b] ?? 0) + 1;
|
|
14
|
+
}
|
|
15
|
+
return { vertices: l, domain: r.domain, tally: s };
|
|
20
16
|
}
|
|
21
|
-
function
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
load: async (e, t) => {
|
|
31
|
-
if (!r || !v) throw new Error("the graph has no scan to read with");
|
|
32
|
-
const l = (w) => {
|
|
33
|
-
var L;
|
|
34
|
-
return ((L = f == null ? void 0 : f.tileMatrices[w.z]) == null ? void 0 : L.kind) === "cells";
|
|
35
|
-
}, o = await v.read(e, { signal: t }), p = await r.edges({ from: e, direction: "src", signal: t }), a = e.filter((w) => !l(w)), O = a.length > 0 ? await r.edges({ from: a, direction: "dst", signal: t }) : [], te = new Map(a.map((w, L) => [w, O[L]]));
|
|
36
|
-
return e.map((w, L) => {
|
|
37
|
-
const T = p[L], z = te.get(w), ne = [...(T == null ? void 0 : T.batches) ?? [], ...(z == null ? void 0 : z.batches) ?? []], H = [...(T == null ? void 0 : T.declined) ?? [], ...(z == null ? void 0 : z.declined) ?? []], le = l(w) ? H.filter((oe) => oe.direction !== "dst") : H, Q = { rows: o[L], edges: ne, declined: le };
|
|
38
|
-
return { ...Q, byteLength: me(Q) };
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
onTileLoad: (e) => {
|
|
42
|
-
var t;
|
|
43
|
-
for (const l of ((t = e.content) == null ? void 0 : t.declined) ?? [])
|
|
44
|
-
B.some((o) => o.edgeType === l.edgeType && o.direction === l.direction) || (B = [...B, l]);
|
|
45
|
-
u.refresh(), g();
|
|
46
|
-
},
|
|
47
|
-
onTileError: (e) => {
|
|
48
|
-
u.refresh(), M(e), g();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
let i = {
|
|
17
|
+
function de(a) {
|
|
18
|
+
let r = a;
|
|
19
|
+
const p = /* @__PURE__ */ new Set(), s = Z();
|
|
20
|
+
let l = null, i = null, b = !1, _ = !1, g = [], d = Q(a), F, m = null, u = null, f = null, w = null, B = null, k = null, T = [], h = null, N = !1, D = !0, z = null;
|
|
21
|
+
const S = (e) => {
|
|
22
|
+
const n = e instanceof Error ? e.message : String(e);
|
|
23
|
+
D ? z = n : r.onFailure(n);
|
|
24
|
+
};
|
|
25
|
+
let c = {
|
|
52
26
|
status: "none",
|
|
53
|
-
matrix: null,
|
|
54
|
-
typeIndex: 0,
|
|
55
|
-
modeColumn: null,
|
|
56
|
-
binding: W,
|
|
57
|
-
domain: [],
|
|
58
|
-
z: null,
|
|
59
|
-
visible: [],
|
|
60
|
-
cached: [],
|
|
61
|
-
pending: !1,
|
|
62
27
|
total: void 0,
|
|
63
|
-
|
|
28
|
+
drawn: null,
|
|
29
|
+
domain: [],
|
|
64
30
|
selection: null,
|
|
65
31
|
focus: null,
|
|
66
32
|
hovered: null,
|
|
@@ -68,176 +34,195 @@ function Te(s) {
|
|
|
68
34
|
tool: null,
|
|
69
35
|
motion: "settled",
|
|
70
36
|
progress: 1,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
let C = { key: [], value: [] };
|
|
84
|
-
function x() {
|
|
85
|
-
const e = [r, A, m.category, n.categories];
|
|
86
|
-
return e.some((t, l) => t !== C.key[l]) && (C = { key: e, value: se(r, A, m, n.categories) }), C.value;
|
|
37
|
+
options: r,
|
|
38
|
+
corpus: null,
|
|
39
|
+
binding: d,
|
|
40
|
+
geometry: null,
|
|
41
|
+
encoding: null,
|
|
42
|
+
mask: null
|
|
43
|
+
}, $ = { key: [], value: [] };
|
|
44
|
+
function K() {
|
|
45
|
+
const e = [g, d.byTable, d.category, r.categories];
|
|
46
|
+
return e.some((n, t) => n !== $.key[t]) && ($ = { key: e, value: Y(g, d, r.categories) }), $.value;
|
|
87
47
|
}
|
|
88
|
-
|
|
89
|
-
|
|
48
|
+
let C = { key: [], value: null };
|
|
49
|
+
function V() {
|
|
50
|
+
const e = [f, w, k];
|
|
51
|
+
return e.some((n, t) => n !== C.key[t]) && (C = { key: e, value: f && w ? ie(f, w, k) : null }), C.value;
|
|
90
52
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
53
|
+
function W() {
|
|
54
|
+
if (b || _) return "failed";
|
|
55
|
+
if (i) return "opening";
|
|
56
|
+
if (!l) return "none";
|
|
57
|
+
const n = f !== null && [f, w, k].every((t, o) => t === T[o]);
|
|
58
|
+
return m || u || !n ? "loading" : "idle";
|
|
59
|
+
}
|
|
60
|
+
function y(e = {}) {
|
|
61
|
+
c = {
|
|
62
|
+
...c,
|
|
63
|
+
total: l ? g.reduce((n, t) => n + t.record_count, 0) : void 0,
|
|
64
|
+
drawn: V(),
|
|
65
|
+
domain: K(),
|
|
66
|
+
options: r,
|
|
67
|
+
corpus: l,
|
|
68
|
+
binding: d,
|
|
69
|
+
geometry: f,
|
|
70
|
+
encoding: w,
|
|
71
|
+
mask: k,
|
|
110
72
|
...e
|
|
111
|
-
},
|
|
73
|
+
}, c = { ...c, status: W() }, R();
|
|
112
74
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
75
|
+
function v(e) {
|
|
76
|
+
c = { ...c, ...e }, R();
|
|
115
77
|
}
|
|
116
|
-
function
|
|
117
|
-
for (const e of
|
|
78
|
+
function R() {
|
|
79
|
+
for (const e of p) e();
|
|
118
80
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
81
|
+
function G(e, n, t, o, L) {
|
|
82
|
+
var E;
|
|
83
|
+
(E = e()) == null || E.abort();
|
|
84
|
+
const O = new AbortController();
|
|
85
|
+
n(O), o(O.signal).then(
|
|
86
|
+
(A) => {
|
|
87
|
+
e() === O && (n(null), L(A), y());
|
|
88
|
+
},
|
|
89
|
+
(A) => {
|
|
90
|
+
e() === O && (n(null), b || (b = t), S(A), y());
|
|
126
91
|
}
|
|
127
|
-
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
const j = [() => m, (e) => m = e, !0], X = [() => u, (e) => u = e, !1];
|
|
95
|
+
function q() {
|
|
96
|
+
const e = l;
|
|
97
|
+
if (!e) return;
|
|
98
|
+
const n = K(), t = f;
|
|
99
|
+
if (t)
|
|
100
|
+
return G(...j, (o) => te(e, t, d, n, o), (o) => {
|
|
101
|
+
w = o;
|
|
102
|
+
});
|
|
103
|
+
G(...j, (o) => re(e, d, n, o), (o) => {
|
|
104
|
+
f = o.geometry, w = o.encoding, k = f && B ? U(f, B) : null;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function H() {
|
|
108
|
+
u == null || u.abort(), u = null;
|
|
109
|
+
const e = l;
|
|
110
|
+
if (!e || g.length === 0) return;
|
|
111
|
+
if (F === void 0) {
|
|
112
|
+
B = null, k = null;
|
|
113
|
+
return;
|
|
128
114
|
}
|
|
115
|
+
const n = F;
|
|
116
|
+
G(...X, (t) => oe(e, g, n, t), (t) => {
|
|
117
|
+
B = t, k = f ? U(f, t) : null;
|
|
118
|
+
});
|
|
129
119
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (!r) return g(e);
|
|
135
|
-
const t = r.types.vertices, l = n.type ?? ((o = t.find((O) => O.geometry)) == null ? void 0 : o.type) ?? ((p = t[0]) == null ? void 0 : p.type);
|
|
136
|
-
A = Math.max(0, t.findIndex((O) => O.type === l));
|
|
120
|
+
function J() {
|
|
121
|
+
m == null || m.abort(), u == null || u.abort(), m = u = null, b = !1, f = w = k = B = null, T = [], g = [];
|
|
122
|
+
const e = { selection: null, focus: null, hovered: null, pinned: [] };
|
|
123
|
+
if (!l) return y(e);
|
|
137
124
|
try {
|
|
138
|
-
if (l
|
|
139
|
-
|
|
140
|
-
} catch (
|
|
141
|
-
|
|
125
|
+
if (l.manifest.format !== "fossil/1") throw new Error(`the graph reads fossil/1, and this corpus is ${l.manifest.format}`);
|
|
126
|
+
if (g = ne(l), g.length === 0) throw new Error("the corpus has no vertex type with a position to draw");
|
|
127
|
+
} catch (n) {
|
|
128
|
+
return b = !0, S(n), y(e);
|
|
142
129
|
}
|
|
143
|
-
|
|
130
|
+
q(), H(), y(e);
|
|
144
131
|
}
|
|
145
|
-
function
|
|
146
|
-
if (
|
|
147
|
-
return
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
(
|
|
151
|
-
|
|
132
|
+
function I(e) {
|
|
133
|
+
if (l = null, i = se(e) ? e : null, !i)
|
|
134
|
+
return l = e, J();
|
|
135
|
+
const n = i;
|
|
136
|
+
J(), n.then(
|
|
137
|
+
(t) => {
|
|
138
|
+
i === n && (i = null, l = t, J());
|
|
152
139
|
},
|
|
153
|
-
(
|
|
154
|
-
|
|
140
|
+
(t) => {
|
|
141
|
+
i === n && (i = null, b = !0, S(t), y());
|
|
155
142
|
}
|
|
156
143
|
);
|
|
157
144
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
const e =
|
|
161
|
-
let
|
|
145
|
+
function P() {
|
|
146
|
+
h == null || h(), h = null;
|
|
147
|
+
const e = r.filterBy, n = () => {
|
|
148
|
+
let t;
|
|
162
149
|
try {
|
|
163
|
-
|
|
150
|
+
t = e ? ee(e, s) : void 0;
|
|
164
151
|
} catch (o) {
|
|
165
|
-
|
|
152
|
+
S(o);
|
|
166
153
|
return;
|
|
167
154
|
}
|
|
168
|
-
|
|
155
|
+
le(t, F) || (F = t, H(), y());
|
|
169
156
|
};
|
|
170
|
-
e && (e.addEventListener("value",
|
|
157
|
+
e && (e.addEventListener("value", n), h = () => e.removeEventListener("value", n)), n();
|
|
171
158
|
}
|
|
172
|
-
const
|
|
159
|
+
const M = {
|
|
173
160
|
/**
|
|
174
161
|
* The first subscriber starts listening to the crossfilter and the last one stops it and lets the
|
|
175
|
-
*
|
|
162
|
+
* graph go — `QueryObserver`'s `onSubscribe`/`onUnsubscribe`, which is what survives StrictMode
|
|
176
163
|
* mounting everything twice.
|
|
177
164
|
*/
|
|
178
165
|
subscribe(e) {
|
|
179
|
-
if (
|
|
180
|
-
const
|
|
181
|
-
|
|
166
|
+
if (p.add(e), !N && (N = !0, P(), z !== null)) {
|
|
167
|
+
const n = z;
|
|
168
|
+
z = null, r.onFailure(n);
|
|
182
169
|
}
|
|
183
170
|
return () => {
|
|
184
|
-
|
|
171
|
+
p.delete(e), p.size === 0 && M.destroy();
|
|
185
172
|
};
|
|
186
173
|
},
|
|
187
|
-
getSnapshot: () =>
|
|
188
|
-
getOptions: () =>
|
|
174
|
+
getSnapshot: () => c,
|
|
175
|
+
getOptions: () => r,
|
|
189
176
|
setOptions(e) {
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
|
|
177
|
+
const n = r;
|
|
178
|
+
r = e;
|
|
179
|
+
const t = Q(e), o = t.category !== d.category || t.byTable !== d.byTable || t.size !== d.size || e.categories !== n.categories;
|
|
180
|
+
if (d = t, e.corpus !== n.corpus) {
|
|
181
|
+
I(e.corpus), N && e.filterBy !== n.filterBy && P();
|
|
195
182
|
return;
|
|
196
183
|
}
|
|
197
|
-
|
|
198
|
-
e.limit !== t.limit && E && u.update(E, e.limit ?? Y), g();
|
|
184
|
+
N && e.filterBy !== n.filterBy && P(), o && q(), y();
|
|
199
185
|
},
|
|
200
186
|
destroy() {
|
|
201
|
-
|
|
202
|
-
},
|
|
203
|
-
setViewport(e) {
|
|
204
|
-
E = e, u.update(e, n.limit ?? Y) !== V && g();
|
|
187
|
+
N = !1, h == null || h(), h = null, m == null || m.abort(), u == null || u.abort(), p.clear();
|
|
205
188
|
},
|
|
206
|
-
select(e,
|
|
207
|
-
var
|
|
208
|
-
const o = e && e.length > 0 ? { vertices: [...e], source:
|
|
209
|
-
|
|
189
|
+
select(e, n = "node", t = "") {
|
|
190
|
+
var O, E;
|
|
191
|
+
const o = e && e.length > 0 ? { vertices: [...e], source: n, label: t } : null;
|
|
192
|
+
v({ selection: o }), (O = r.onSelect) == null || O.call(r, o);
|
|
193
|
+
const L = (E = g[0]) == null ? void 0 : E.key;
|
|
194
|
+
r.filterBy && L && x(r.filterBy, s, L, o ? o.vertices : null);
|
|
210
195
|
},
|
|
211
196
|
focus(e) {
|
|
212
|
-
var
|
|
213
|
-
e !==
|
|
197
|
+
var n;
|
|
198
|
+
e !== c.focus && (v({ focus: e }), (n = r.onFocus) == null || n.call(r, e));
|
|
214
199
|
},
|
|
215
200
|
hover(e) {
|
|
216
|
-
e !==
|
|
201
|
+
e !== c.hovered && v({ hovered: e });
|
|
217
202
|
},
|
|
218
203
|
pin(e) {
|
|
219
|
-
|
|
204
|
+
v({ pinned: [...e] });
|
|
220
205
|
},
|
|
221
206
|
setTool(e) {
|
|
222
|
-
e !==
|
|
207
|
+
e !== c.tool && v({ tool: e });
|
|
223
208
|
},
|
|
224
209
|
report(e) {
|
|
225
|
-
e !==
|
|
210
|
+
e !== c.motion && v({ motion: e });
|
|
226
211
|
},
|
|
227
212
|
reportProgress(e) {
|
|
228
|
-
e !==
|
|
213
|
+
e !== c.progress && v({ progress: e });
|
|
229
214
|
},
|
|
230
215
|
setRenderable(e) {
|
|
231
|
-
|
|
216
|
+
_ !== !e && (_ = !e, y());
|
|
232
217
|
},
|
|
233
|
-
reportDrawn(e
|
|
234
|
-
|
|
218
|
+
reportDrawn(e) {
|
|
219
|
+
const n = [e.geometry, e.encoding, e.mask];
|
|
220
|
+
n.every((t, o) => t === T[o]) || (T = n, y());
|
|
235
221
|
}
|
|
236
222
|
};
|
|
237
|
-
return
|
|
223
|
+
return I(a.corpus), D = !1, M;
|
|
238
224
|
}
|
|
239
225
|
export {
|
|
240
|
-
|
|
241
|
-
Te as createGraph
|
|
226
|
+
de as createGraph
|
|
242
227
|
};
|
|
243
228
|
//# sourceMappingURL=store.js.map
|
package/dist/core/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sources":["../../src/core/store.ts"],"sourcesContent":["import {\n PAYLOAD_ADDRESS,\n PAYLOAD_COORDINATES,\n type Batch,\n type Corpus,\n type Filter,\n type Gap,\n type Scan,\n type TileAddress,\n type TileMatrixSet,\n} from \"@fossil-lang/corpus\";\nimport type { MosaicClient } from \"@kanzo-tech/mosaic\";\nimport { domainOf } from \"./categories\";\nimport { bindingOf, projectionOf, type Binding } from \"./channels\";\nimport { filterFor, graphClient, publish } from \"./filter\";\nimport { denseOf } from \"./resident\";\nimport type { GraphOptions, GraphSnapshot, GraphStatus, GraphStore, TileView } from \"./state\";\nimport type { TileContent } from \"./tile\";\nimport type { Viewport } from \"./tile-matrix\";\nimport { Tileset2D } from \"./tileset\";\n\nexport type { Drawn, GraphOptions, GraphSnapshot, GraphState, GraphStatus, GraphStore, TileView } from \"./state\";\n\n/** Twenty thousand marks: what a canvas draws at once before a coarser zoom is chosen. */\nexport const DEFAULT_LIMIT = 20_000;\n\nconst NO_BINDING: Binding = bindingOf({});\nconst KEY = PAYLOAD_ADDRESS[0] as string;\n\nfunction bytesOf(content: Omit<TileContent, \"byteLength\">): number {\n let bytes = 0;\n for (const edge of content.edges) bytes += edge.src.byteLength + edge.dst.byteLength + (edge.weight?.byteLength ?? 0);\n return bytes + content.rows.numRows * 8 * 4;\n}\n\nconst sameFilter = (a: Filter | undefined, b: Filter | undefined) =>\n JSON.stringify(a, (_, v: unknown) => (typeof v === \"bigint\" ? `${v}n` : v)) ===\n JSON.stringify(b, (_, v: unknown) => (typeof v === \"bigint\" ? `${v}n` : v));\n\nconst isPromise = (value: unknown): value is PromiseLike<Corpus> =>\n typeof (value as PromiseLike<Corpus> | null)?.then === \"function\";\n\n/** The same array while the set of tiles in it is the same, so a reader can compare by identity. */\nfunction keep(previous: readonly TileView[], next: TileView[]): readonly TileView[] {\n if (previous.length !== next.length) return next;\n return next.every((view, i) => view.content === previous[i]?.content) ? previous : next;\n}\n\nexport function createGraph(initial: GraphOptions): GraphStore {\n let options = initial;\n const listeners = new Set<() => void>();\n const self: MosaicClient = graphClient();\n\n let corpus: Corpus | null = null;\n let opening: PromiseLike<Corpus> | null = null;\n let failed = false;\n let unrenderable = false;\n let matrix: TileMatrixSet | null = null;\n let typeIndex = 0;\n let modeColumn: string | null = null;\n let scan: Scan | null = null;\n let binding = NO_BINDING;\n let filter: Filter | undefined;\n let viewport: Viewport | null = null;\n let declined: Gap[] = [];\n let composed: readonly TileView[] | null = null;\n let unlisten: (() => void) | null = null;\n let active = false;\n let lastFrame = -1;\n\n // A failure found while the store is being built is found while React is still rendering —\n // `useGraph` builds it in `useState` — and a host's `onFailure` is usually a `setState`. It is held\n // and reported to the first subscriber, which arrives in the commit phase. Anything later is\n // asynchronous or effect-driven and is reported as it happens.\n let building = true;\n let held: string | null = null;\n const fail = (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n if (building) held = message;\n else options.onFailure(message);\n };\n\n const tileset = new Tileset2D({\n debounceTime: 60,\n load: async (addresses, signal) => {\n if (!corpus || !scan) throw new Error(\"the graph has no scan to read with\");\n const isCells = (address: TileAddress) => matrix?.tileMatrices[address.z]?.kind === \"cells\";\n const rows = await scan.read(addresses, { signal });\n const src = await corpus.edges({ from: addresses, direction: \"src\", signal });\n const payload = addresses.filter((address) => !isCells(address));\n const dst = payload.length > 0 ? await corpus.edges({ from: payload, direction: \"dst\", signal }) : [];\n const dstOf = new Map(payload.map((address, i) => [address, dst[i]]));\n return addresses.map((address, i) => {\n const out = src[i];\n const back = dstOf.get(address);\n const edges = [...(out?.batches ?? []), ...(back?.batches ?? [])];\n const gaps = [...(out?.declined ?? []), ...(back?.declined ?? [])];\n const declined = isCells(address) ? gaps.filter((gap) => gap.direction !== \"dst\") : gaps;\n const content = { rows: rows[i] as Batch, edges, declined };\n return { ...content, byteLength: bytesOf(content) };\n });\n },\n onTileLoad: (tile) => {\n for (const gap of tile.content?.declined ?? []) {\n if (!declined.some((d) => d.edgeType === gap.edgeType && d.direction === gap.direction)) {\n declined = [...declined, gap];\n }\n }\n tileset.refresh();\n notify();\n },\n onTileError: (error) => {\n tileset.refresh();\n fail(error);\n notify();\n },\n });\n\n let snapshot: GraphSnapshot = {\n status: \"none\",\n matrix: null,\n typeIndex: 0,\n modeColumn: null,\n binding: NO_BINDING,\n domain: [],\n z: null,\n visible: [],\n cached: [],\n pending: false,\n total: undefined,\n declined: [],\n selection: null,\n focus: null,\n hovered: null,\n pinned: [],\n tool: null,\n motion: \"settled\",\n progress: 1,\n drawn: null,\n options,\n corpus: null,\n };\n\n const viewOf = (tile: { address: TileAddress; content: TileContent | null }): TileView => ({\n address: tile.address,\n kind: matrix?.tileMatrices[tile.address.z]?.kind ?? \"rows\",\n content: tile.content as TileContent,\n });\n\n let domain: { key: unknown[]; value: readonly unknown[] } = { key: [], value: [] };\n function domainNow(): readonly unknown[] {\n const key = [corpus, typeIndex, binding.category, options.categories];\n if (key.some((part, i) => part !== domain.key[i])) domain = { key, value: domainOf(corpus, typeIndex, binding, options.categories) };\n return domain.value;\n }\n\n function statusOf(pending: boolean, visible: readonly TileView[]): GraphStatus {\n if (failed || unrenderable) return \"failed\";\n if (opening) return \"opening\";\n if (!corpus) return \"none\";\n return pending || composed !== visible || snapshot.drawn === null ? \"reading\" : \"idle\";\n }\n\n function notify(fields: Partial<GraphSnapshot> = {}): void {\n lastFrame = tileset.frame;\n const tiles = tileset.tiles.filter((tile) => tile.content !== null);\n const visible = keep(snapshot.visible, tiles.filter((tile) => tile.isVisible).map(viewOf));\n const pending = tileset.selectedTiles.some((tile) => tile.isLoading);\n snapshot = {\n ...snapshot,\n matrix,\n typeIndex,\n modeColumn,\n binding,\n domain: domainNow(),\n z: tileset.z,\n visible,\n cached: keep(snapshot.cached, tiles.map(viewOf)),\n pending,\n total: matrix ? Number(matrix.tileMatrices[matrix.tileMatrices.length - 1]?.count ?? 0) : undefined,\n declined,\n options,\n corpus,\n ...fields,\n };\n snapshot = { ...snapshot, status: statusOf(pending, snapshot.visible) };\n emit();\n }\n\n /** A change of state only — hover, focus, selection, tool, motion — rebuilds no tile view. */\n function patch(fields: Partial<GraphSnapshot>): void {\n snapshot = { ...snapshot, ...fields };\n emit();\n }\n\n function emit(): void {\n for (const listener of listeners) listener();\n }\n\n /** A binding or a filter is a new scan, planned once and never per camera move. */\n function rescan(): void {\n if (!corpus || !matrix) return;\n try {\n const fixed = [KEY, ...PAYLOAD_COORDINATES];\n scan = corpus.scan({ type: matrix.type, filter, select: projectionOf(binding, fixed) });\n tileset.setPlan(scan.plan());\n } catch (error) {\n scan = null;\n tileset.setPlan([]);\n fail(error);\n }\n tileset.reloadAll();\n if (viewport) tileset.update(viewport, options.limit ?? DEFAULT_LIMIT);\n notify();\n }\n\n function reopen(): void {\n failed = false;\n matrix = null;\n scan = null;\n declined = [];\n composed = null;\n tileset.finalize();\n const cleared = { selection: null, focus: null, hovered: null, pinned: [], drawn: null };\n if (!corpus) return notify(cleared);\n const types = corpus.types.vertices;\n const type = options.type ?? types.find((t) => t.geometry)?.type ?? types[0]?.type;\n typeIndex = Math.max(0, types.findIndex((t) => t.type === type));\n try {\n if (type === undefined) throw new Error(\"the corpus has no vertex type to draw\");\n matrix = corpus.tileMatrix(type);\n modeColumn = matrix.mode?.column ?? null;\n tileset.setMatrix(matrix);\n } catch (error) {\n failed = true;\n fail(error);\n }\n snapshot = { ...snapshot, ...cleared };\n rescan();\n }\n\n /** A promise is adopted when it settles, and only if it is still the corpus the host means. */\n function adopt(given: GraphOptions[\"corpus\"]): void {\n corpus = null;\n opening = isPromise(given) ? given : null;\n if (!opening) {\n corpus = given as Corpus | null;\n return reopen();\n }\n const promised = opening;\n reopen();\n promised.then(\n (opened) => {\n if (opening !== promised) return;\n opening = null;\n corpus = opened;\n reopen();\n },\n (error: unknown) => {\n if (opening !== promised) return;\n opening = null;\n failed = true;\n fail(error);\n notify();\n },\n );\n }\n\n function listen(): void {\n unlisten?.();\n unlisten = null;\n const crossfilter = options.filterBy;\n const refilter = () => {\n let next: Filter | undefined;\n try {\n next = crossfilter ? filterFor(crossfilter, self) : undefined;\n } catch (error) {\n fail(error);\n return;\n }\n if (sameFilter(next, filter)) return;\n filter = next;\n rescan();\n };\n if (crossfilter) {\n crossfilter.addEventListener(\"value\", refilter);\n unlisten = () => crossfilter.removeEventListener(\"value\", refilter);\n }\n refilter();\n }\n\n const store: GraphStore = {\n /**\n * The first subscriber starts listening to the crossfilter and the last one stops it and lets the\n * tiles go — `QueryObserver`'s `onSubscribe`/`onUnsubscribe`, which is what survives StrictMode\n * mounting everything twice.\n */\n subscribe(listener) {\n listeners.add(listener);\n if (!active) {\n active = true;\n listen();\n if (held !== null) {\n const message = held;\n held = null;\n options.onFailure(message);\n }\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0) store.destroy();\n };\n },\n getSnapshot: () => snapshot,\n getOptions: () => options,\n setOptions(next) {\n const previous = options;\n options = next;\n const nextBinding = bindingOf(next);\n const rebound =\n nextBinding.category !== binding.category ||\n nextBinding.size !== binding.size ||\n nextBinding.title !== binding.title;\n binding = nextBinding;\n if (next.corpus !== previous.corpus || next.type !== previous.type) {\n if (next.corpus !== previous.corpus) adopt(next.corpus);\n else reopen();\n if (active && next.filterBy !== previous.filterBy) listen();\n return;\n }\n if (active && next.filterBy !== previous.filterBy) listen();\n if (rebound) return rescan();\n if (next.limit !== previous.limit && viewport) tileset.update(viewport, next.limit ?? DEFAULT_LIMIT);\n notify();\n },\n destroy() {\n active = false;\n unlisten?.();\n unlisten = null;\n tileset.finalize();\n listeners.clear();\n },\n setViewport(next) {\n viewport = next;\n if (tileset.update(next, options.limit ?? DEFAULT_LIMIT) !== lastFrame) notify();\n },\n select(vertices, source = \"node\", label = \"\") {\n const selection = vertices && vertices.length > 0 ? { vertices: [...vertices], source, label } : null;\n patch({ selection });\n options.onSelect?.(selection);\n if (options.filterBy) publish(options.filterBy, self, KEY, selection ? selection.vertices.map(denseOf) : null);\n },\n focus(vertex) {\n if (vertex === snapshot.focus) return;\n patch({ focus: vertex });\n options.onFocus?.(vertex);\n },\n hover(vertex) {\n if (vertex !== snapshot.hovered) patch({ hovered: vertex });\n },\n pin(vertices) {\n patch({ pinned: [...vertices] });\n },\n setTool(tool) {\n if (tool !== snapshot.tool) patch({ tool });\n },\n report(motion) {\n if (motion !== snapshot.motion) patch({ motion });\n },\n reportProgress(value) {\n if (value !== snapshot.progress) patch({ progress: value });\n },\n setRenderable(renderable) {\n if (unrenderable === !renderable) return;\n unrenderable = !renderable;\n notify();\n },\n reportDrawn(visible, drawn) {\n if (composed === visible && drawn === null) return;\n composed = visible;\n notify(drawn ? { drawn } : {});\n },\n };\n\n binding = bindingOf(initial);\n adopt(initial.corpus);\n building = false;\n return store;\n}\n"],"names":["DEFAULT_LIMIT","NO_BINDING","bindingOf","KEY","PAYLOAD_ADDRESS","bytesOf","content","bytes","edge","_a","sameFilter","a","b","_","v","isPromise","value","keep","previous","next","view","i","createGraph","initial","options","listeners","self","graphClient","corpus","opening","failed","unrenderable","matrix","typeIndex","modeColumn","scan","binding","filter","viewport","declined","composed","unlisten","active","lastFrame","building","held","fail","error","message","tileset","Tileset2D","addresses","signal","isCells","address","rows","src","payload","dst","dstOf","out","back","edges","gaps","gap","tile","d","notify","snapshot","viewOf","domain","domainNow","key","part","domainOf","statusOf","pending","visible","fields","tiles","emit","patch","listener","rescan","fixed","PAYLOAD_COORDINATES","projectionOf","reopen","cleared","types","type","t","_b","_c","adopt","given","promised","opened","listen","crossfilter","refilter","filterFor","store","nextBinding","rebound","vertices","source","label","selection","publish","denseOf","vertex","tool","motion","renderable","drawn"],"mappings":";;;;;;AAwBO,MAAMA,IAAgB,KAEvBC,IAAsBC,EAAU,EAAE,GAClCC,IAAMC,GAAgB,CAAC;AAE7B,SAASC,GAAQC,GAAkD;;AACjE,MAAIC,IAAQ;AACZ,aAAWC,KAAQF,EAAQ,MAAO,CAAAC,KAASC,EAAK,IAAI,aAAaA,EAAK,IAAI,gBAAcC,IAAAD,EAAK,WAAL,gBAAAC,EAAa,eAAc;AACnH,SAAOF,IAAQD,EAAQ,KAAK,UAAU,IAAI;AAC5C;AAEA,MAAMI,KAAa,CAACC,GAAuBC,MACzC,KAAK,UAAUD,GAAG,CAACE,GAAGC,MAAgB,OAAOA,KAAM,WAAW,GAAGA,CAAC,MAAMA,CAAE,MAC1E,KAAK,UAAUF,GAAG,CAACC,GAAGC,MAAgB,OAAOA,KAAM,WAAW,GAAGA,CAAC,MAAMA,CAAE,GAEtEC,KAAY,CAACC,MACjB,QAAQA,KAAA,gBAAAA,EAAsC,SAAS;AAGzD,SAASC,EAAKC,GAA+BC,GAAuC;AAClF,SAAID,EAAS,WAAWC,EAAK,SAAeA,IACrCA,EAAK,MAAM,CAACC,GAAMC,MAAA;;AAAM,WAAAD,EAAK,cAAYX,IAAAS,EAASG,CAAC,MAAV,gBAAAZ,EAAa;AAAA,GAAO,IAAIS,IAAWC;AACrF;AAEO,SAASG,GAAYC,GAAmC;AAC7D,MAAIC,IAAUD;AACd,QAAME,wBAAgB,IAAA,GAChBC,IAAqBC,GAAA;AAE3B,MAAIC,IAAwB,MACxBC,IAAsC,MACtCC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AM,EAAE,MAAA+B,GAAM;AAAA,IAC5C;AAAA,IACA,OAAOC,GAAQ;AACb,MAAIA,MAAW7C,EAAS,UAAQa,EAAM,EAAE,QAAAgC,GAAQ;AAAA,IAClD;AAAA,IACA,eAAejG,GAAO;AACpB,MAAIA,MAAUoD,EAAS,cAAgB,EAAE,UAAUpD,GAAO;AAAA,IAC5D;AAAA,IACA,cAAckG,GAAY;AACxB,MAAInF,MAAiB,CAACmF,MACtBnF,IAAe,CAACmF,GAChB/C,EAAA;AAAA,IACF;AAAA,IACA,YAAYU,GAASsC,GAAO;AAC1B,MAAI3E,MAAaqC,KAAWsC,MAAU,SACtC3E,IAAWqC,GACXV,EAAOgD,IAAQ,EAAE,OAAAA,EAAA,IAAU,CAAA,CAAE;AAAA,IAC/B;AAAA,EAAA;AAGF,SAAA/E,IAAUlC,EAAUqB,CAAO,GAC3BuE,EAAMvE,EAAQ,MAAM,GACpBqB,IAAW,IACJ0D;AACT;"}
|
|
1
|
+
{"version":3,"file":"store.js","sources":["../../src/core/store.ts"],"sourcesContent":["import type { MosaicClient } from \"@kanzo-tech/mosaic\";\nimport { domainOf } from \"./categories\";\nimport { bindingOf } from \"./channels\";\nimport type { Corpus, Filter, VertexTable } from \"@fossil-lang/corpus\";\nimport { filterFor, graphClient, publish } from \"./filter\";\nimport { drawnTables, loadEncoding, loadGraph, maskOf, readKept, type Encoding, type Geometry, type Kept } from \"./load\";\nimport type { Drawn, GraphOptions, GraphSnapshot, GraphStatus, GraphStore } from \"./state\";\n\nexport type { Drawn, GraphOptions, GraphSnapshot, GraphState, GraphStatus, GraphStore } from \"./state\";\n\nconst sameFilter = (a: Filter | undefined, b: Filter | undefined) =>\n JSON.stringify(a, (_, v: unknown) => (typeof v === \"bigint\" ? `${v}n` : v)) ===\n JSON.stringify(b, (_, v: unknown) => (typeof v === \"bigint\" ? `${v}n` : v));\n\nconst isPromise = (value: unknown): value is PromiseLike<Corpus> =>\n typeof (value as PromiseLike<Corpus> | null)?.then === \"function\";\n\nfunction drawnOf(geometry: Geometry, encoding: Encoding, mask: Uint8Array | null): Drawn {\n const tally = encoding.domain.map(() => 0);\n let vertices = 0;\n for (let id = 0; id < geometry.size; id++) {\n if ((mask && !mask[id]) || Number.isNaN(geometry.positions[id * 2])) continue;\n vertices++;\n const rank = encoding.ranks[id] as number;\n tally[rank] = (tally[rank] ?? 0) + 1;\n }\n return { vertices, domain: encoding.domain, tally };\n}\n\nexport function createGraph(initial: GraphOptions): GraphStore {\n let options = initial;\n const listeners = new Set<() => void>();\n const self: MosaicClient = graphClient();\n\n let corpus: Corpus | null = null;\n let opening: PromiseLike<Corpus> | null = null;\n let failed = false;\n let unrenderable = false;\n let tables: readonly VertexTable[] = [];\n let binding = bindingOf(initial);\n let filter: Filter | undefined;\n let loading: AbortController | null = null;\n let filtering: AbortController | null = null;\n let geometry: Geometry | null = null;\n let encoding: Encoding | null = null;\n let kept: Kept | null = null;\n let mask: Uint8Array | null = null;\n let uploaded: readonly unknown[] = [];\n let unlisten: (() => void) | null = null;\n let active = false;\n\n // A failure found while the store is being built is found while React is still rendering —\n // `useGraph` builds it in `useState` — and a host's `onFailure` is usually a `setState`. It is held\n // and reported to the first subscriber, which arrives in the commit phase.\n let building = true;\n let held: string | null = null;\n const fail = (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n if (building) held = message;\n else options.onFailure(message);\n };\n\n let snapshot: GraphSnapshot = {\n status: \"none\",\n total: undefined,\n drawn: null,\n domain: [],\n selection: null,\n focus: null,\n hovered: null,\n pinned: [],\n tool: null,\n motion: \"settled\",\n progress: 1,\n options,\n corpus: null,\n binding,\n geometry: null,\n encoding: null,\n mask: null,\n };\n\n let domain: { key: unknown[]; value: readonly unknown[] } = { key: [], value: [] };\n function domainNow(): readonly unknown[] {\n const key = [tables, binding.byTable, binding.category, options.categories];\n if (key.some((part, i) => part !== domain.key[i])) domain = { key, value: domainOf(tables, binding, options.categories) };\n return domain.value;\n }\n\n let drawn: { key: unknown[]; value: Drawn | null } = { key: [], value: null };\n function drawnNow(): Drawn | null {\n const key = [geometry, encoding, mask];\n if (key.some((part, i) => part !== drawn.key[i])) {\n drawn = { key, value: geometry && encoding ? drawnOf(geometry, encoding, mask) : null };\n }\n return drawn.value;\n }\n\n function statusOf(): GraphStatus {\n if (failed || unrenderable) return \"failed\";\n if (opening) return \"opening\";\n if (!corpus) return \"none\";\n const current = [geometry, encoding, mask];\n const shown = geometry !== null && current.every((part, i) => part === uploaded[i]);\n return loading || filtering || !shown ? \"loading\" : \"idle\";\n }\n\n function notify(fields: Partial<GraphSnapshot> = {}): void {\n snapshot = {\n ...snapshot,\n total: corpus ? tables.reduce((sum, table) => sum + table.record_count, 0) : undefined,\n drawn: drawnNow(),\n domain: domainNow(),\n options,\n corpus,\n binding,\n geometry,\n encoding,\n mask,\n ...fields,\n };\n snapshot = { ...snapshot, status: statusOf() };\n emit();\n }\n\n /** A change of state only — hover, focus, selection, tool, motion — derives nothing. */\n function patch(fields: Partial<GraphSnapshot>): void {\n snapshot = { ...snapshot, ...fields };\n emit();\n }\n\n function emit(): void {\n for (const listener of listeners) listener();\n }\n\n /**\n * One read in flight per kind, and a newer ask aborts the older one's statements. A load that\n * fails leaves nothing to draw; a filter that fails leaves the last picture.\n */\n function run<T>(\n current: () => AbortController | null,\n set: (aborter: AbortController | null) => void,\n fatal: boolean,\n read: (signal: AbortSignal) => Promise<T>,\n done: (value: T) => void,\n ): void {\n current()?.abort();\n const aborter = new AbortController();\n set(aborter);\n read(aborter.signal).then(\n (value) => {\n if (current() !== aborter) return;\n set(null);\n done(value);\n notify();\n },\n (error: unknown) => {\n if (current() !== aborter) return;\n set(null);\n failed ||= fatal;\n fail(error);\n notify();\n },\n );\n }\n\n const asLoad = [() => loading, (a: AbortController | null) => (loading = a), true] as const;\n const asFilter = [() => filtering, (a: AbortController | null) => (filtering = a), false] as const;\n\n function load(): void {\n const open = corpus;\n if (!open) return;\n const seed = domainNow();\n const given = geometry;\n if (given) {\n return run(...asLoad, (signal) => loadEncoding(open, given, binding, seed, signal), (next) => {\n encoding = next;\n });\n }\n run(...asLoad, (signal) => loadGraph(open, binding, seed, signal), (next) => {\n geometry = next.geometry;\n encoding = next.encoding;\n mask = geometry && kept ? maskOf(geometry, kept) : null;\n });\n }\n\n function refilter(): void {\n filtering?.abort();\n filtering = null;\n const open = corpus;\n if (!open || tables.length === 0) return;\n if (filter === undefined) {\n kept = null;\n mask = null;\n return;\n }\n const given = filter;\n run(...asFilter, (signal) => readKept(open, tables, given, signal), (next) => {\n kept = next;\n mask = geometry ? maskOf(geometry, next) : null;\n });\n }\n\n function reopen(): void {\n loading?.abort();\n filtering?.abort();\n loading = filtering = null;\n failed = false;\n geometry = encoding = mask = kept = null;\n uploaded = [];\n tables = [];\n const cleared = { selection: null, focus: null, hovered: null, pinned: [] };\n if (!corpus) return notify(cleared);\n try {\n if (corpus.manifest.format !== \"fossil/1\") throw new Error(`the graph reads fossil/1, and this corpus is ${corpus.manifest.format}`);\n tables = drawnTables(corpus);\n if (tables.length === 0) throw new Error(\"the corpus has no vertex type with a position to draw\");\n } catch (error) {\n failed = true;\n fail(error);\n return notify(cleared);\n }\n load();\n refilter();\n notify(cleared);\n }\n\n /** A promise is adopted when it settles, and only if it is still the corpus the host means. */\n function adopt(given: GraphOptions[\"corpus\"]): void {\n corpus = null;\n opening = isPromise(given) ? given : null;\n if (!opening) {\n corpus = given as Corpus | null;\n return reopen();\n }\n const promised = opening;\n reopen();\n promised.then(\n (opened) => {\n if (opening !== promised) return;\n opening = null;\n corpus = opened;\n reopen();\n },\n (error: unknown) => {\n if (opening !== promised) return;\n opening = null;\n failed = true;\n fail(error);\n notify();\n },\n );\n }\n\n function listen(): void {\n unlisten?.();\n unlisten = null;\n const crossfilter = options.filterBy;\n const changed = () => {\n let next: Filter | undefined;\n try {\n next = crossfilter ? filterFor(crossfilter, self) : undefined;\n } catch (error) {\n fail(error);\n return;\n }\n if (sameFilter(next, filter)) return;\n filter = next;\n refilter();\n notify();\n };\n if (crossfilter) {\n crossfilter.addEventListener(\"value\", changed);\n unlisten = () => crossfilter.removeEventListener(\"value\", changed);\n }\n changed();\n }\n\n const store: GraphStore = {\n /**\n * The first subscriber starts listening to the crossfilter and the last one stops it and lets the\n * graph go — `QueryObserver`'s `onSubscribe`/`onUnsubscribe`, which is what survives StrictMode\n * mounting everything twice.\n */\n subscribe(listener) {\n listeners.add(listener);\n if (!active) {\n active = true;\n listen();\n if (held !== null) {\n const message = held;\n held = null;\n options.onFailure(message);\n }\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0) store.destroy();\n };\n },\n getSnapshot: () => snapshot,\n getOptions: () => options,\n setOptions(next) {\n const previous = options;\n options = next;\n const nextBinding = bindingOf(next);\n const rebound =\n nextBinding.category !== binding.category ||\n nextBinding.byTable !== binding.byTable ||\n nextBinding.size !== binding.size ||\n next.categories !== previous.categories;\n binding = nextBinding;\n if (next.corpus !== previous.corpus) {\n adopt(next.corpus);\n if (active && next.filterBy !== previous.filterBy) listen();\n return;\n }\n if (active && next.filterBy !== previous.filterBy) listen();\n if (rebound) load();\n notify();\n },\n destroy() {\n active = false;\n unlisten?.();\n unlisten = null;\n loading?.abort();\n filtering?.abort();\n listeners.clear();\n },\n select(vertices, source = \"node\", label = \"\") {\n const selection = vertices && vertices.length > 0 ? { vertices: [...vertices], source, label } : null;\n patch({ selection });\n options.onSelect?.(selection);\n const key = tables[0]?.key;\n if (options.filterBy && key) publish(options.filterBy, self, key, selection ? selection.vertices : null);\n },\n focus(vertex) {\n if (vertex === snapshot.focus) return;\n patch({ focus: vertex });\n options.onFocus?.(vertex);\n },\n hover(vertex) {\n if (vertex !== snapshot.hovered) patch({ hovered: vertex });\n },\n pin(vertices) {\n patch({ pinned: [...vertices] });\n },\n setTool(tool) {\n if (tool !== snapshot.tool) patch({ tool });\n },\n report(motion) {\n if (motion !== snapshot.motion) patch({ motion });\n },\n reportProgress(value) {\n if (value !== snapshot.progress) patch({ progress: value });\n },\n setRenderable(renderable) {\n if (unrenderable === !renderable) return;\n unrenderable = !renderable;\n notify();\n },\n reportDrawn(drawnSnapshot) {\n const next = [drawnSnapshot.geometry, drawnSnapshot.encoding, drawnSnapshot.mask];\n if (next.every((part, i) => part === uploaded[i])) return;\n uploaded = next;\n notify();\n },\n };\n\n adopt(initial.corpus);\n building = false;\n return store;\n}\n"],"names":["sameFilter","b","_","v","isPromise","value","drawnOf","geometry","encoding","mask","tally","vertices","id","rank","createGraph","initial","options","listeners","self","graphClient","corpus","opening","failed","unrenderable","tables","binding","bindingOf","filter","loading","filtering","kept","uploaded","unlisten","active","building","held","fail","error","message","snapshot","domain","domainNow","key","part","i","domainOf","drawn","drawnNow","statusOf","shown","notify","fields","sum","table","emit","patch","listener","run","current","set","fatal","read","done","_a","aborter","asLoad","a","asFilter","load","open","seed","given","signal","loadEncoding","next","loadGraph","maskOf","refilter","readKept","reopen","cleared","drawnTables","adopt","promised","opened","listen","crossfilter","changed","filterFor","store","previous","nextBinding","rebound","source","label","selection","_b","publish","vertex","tool","motion","renderable","drawnSnapshot"],"mappings":";;;;AAUA,MAAMA,KAAa,CAAC,GAAuBC,MACzC,KAAK,UAAU,GAAG,CAACC,GAAGC,MAAgB,OAAOA,KAAM,WAAW,GAAGA,CAAC,MAAMA,CAAE,MAC1E,KAAK,UAAUF,GAAG,CAACC,GAAGC,MAAgB,OAAOA,KAAM,WAAW,GAAGA,CAAC,MAAMA,CAAE,GAEtEC,KAAY,CAACC,MACjB,QAAQA,KAAA,gBAAAA,EAAsC,SAAS;AAEzD,SAASC,GAAQC,GAAoBC,GAAoBC,GAAgC;AACvF,QAAMC,IAAQF,EAAS,OAAO,IAAI,MAAM,CAAC;AACzC,MAAIG,IAAW;AACf,WAASC,IAAK,GAAGA,IAAKL,EAAS,MAAMK,KAAM;AACzC,QAAKH,KAAQ,CAACA,EAAKG,CAAE,KAAM,OAAO,MAAML,EAAS,UAAUK,IAAK,CAAC,CAAC,EAAG;AACrE,IAAAD;AACA,UAAME,IA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MAAMA,GAAQ;AACZ,MAAIA,MAAW3D,EAAS,aAAe,EAAE,SAAS2D,GAAQ;AAAA,IAC5D;AAAA,IACA,IAAIvF,GAAU;AACZ,MAAA4C,EAAM,EAAE,QAAQ,CAAC,GAAG5C,CAAQ,GAAG;AAAA,IACjC;AAAA,IACA,QAAQwF,GAAM;AACZ,MAAIA,MAAS5D,EAAS,QAAMgB,EAAM,EAAE,MAAA4C,GAAM;AAAA,IAC5C;AAAA,IACA,OAAOC,GAAQ;AACb,MAAIA,MAAW7D,EAAS,UAAQgB,EAAM,EAAE,QAAA6C,GAAQ;AAAA,IAClD;AAAA,IACA,eAAe/F,GAAO;AACpB,MAAIA,MAAUkC,EAAS,cAAgB,EAAE,UAAUlC,GAAO;AAAA,IAC5D;AAAA,IACA,cAAcgG,GAAY;AACxB,MAAI9E,MAAiB,CAAC8E,MACtB9E,IAAe,CAAC8E,GAChBnD,EAAA;AAAA,IACF;AAAA,IACA,YAAYoD,GAAe;AACzB,YAAM5B,IAAO,CAAC4B,EAAc,UAAUA,EAAc,UAAUA,EAAc,IAAI;AAChF,MAAI5B,EAAK,MAAM,CAAC/B,GAAMC,MAAMD,MAASZ,EAASa,CAAC,CAAC,MAChDb,IAAW2C,GACXxB,EAAA;AAAA,IACF;AAAA,EAAA;AAGF,SAAAgC,EAAMnE,EAAQ,MAAM,GACpBmB,IAAW,IACJuD;AACT;"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary a graph view is described in — what to draw, how hard the forces pull, what is
|
|
3
|
+
* selected and what the layout is doing.
|
|
4
|
+
*
|
|
5
|
+
* These lived beside a React context in the workspace showcase, which made them look like that
|
|
6
|
+
* app's state. They are not: `Selection` is the shape every panel hands the canvas, and the rest is
|
|
7
|
+
* what a canvas is doing. The provider that holds them is an arrangement and stays where
|
|
8
|
+
* arrangements live; the shapes themselves belong to the renderer.
|
|
9
|
+
*
|
|
10
|
+
* **`Display` and `Sim` have left this file**, and in opposite directions. `Display` was a second
|
|
11
|
+
* vocabulary for the picture — two multipliers over numbers `lookFrom` already computes, plus three
|
|
12
|
+
* toggles — so what survived of it is `link.render` and `grid` on the `Look`. `Sim` went to
|
|
13
|
+
* `graph-sim.ts` with a builder of its own, because it is what `graph-looks.ts` is for forces: a
|
|
14
|
+
* type, one function that reads the declared values, and a default that is the function called with
|
|
15
|
+
* nothing.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* A vertex: its `dense_id`, which fossil numbers `0 … V − 1` across every vertex table of the corpus.
|
|
19
|
+
* The drawn types take the first ids, so a drawn vertex's id is also its index in cosmos.gl's buffers.
|
|
20
|
+
*/
|
|
21
|
+
export type VertexId = number;
|
|
3
22
|
/**
|
|
4
23
|
* The selection tools, and the gesture that reaches them without a mode.
|
|
5
24
|
*
|
|
@@ -28,13 +47,6 @@ export type SelectionSource = "marquee" | "lasso" | "node" | "order" | "ask";
|
|
|
28
47
|
* points at part of it.
|
|
29
48
|
*/
|
|
30
49
|
export interface Selection {
|
|
31
|
-
/**
|
|
32
|
-
* Identities, never buffer indices.
|
|
33
|
-
*
|
|
34
|
-
* A selection is the one thing on this canvas guaranteed to outlive the answer that made it: a
|
|
35
|
-
* reader selects, pans, and expects to come back to it. An index would have been reused by then,
|
|
36
|
-
* and by a different vertex.
|
|
37
|
-
*/
|
|
38
50
|
vertices: VertexId[];
|
|
39
51
|
source: SelectionSource;
|
|
40
52
|
/** What the corner calls it. */
|
|
@@ -53,14 +65,6 @@ export interface GraphCommands {
|
|
|
53
65
|
reveal(vertex: VertexId): void;
|
|
54
66
|
/** Frame whatever the canvas currently has selected. */
|
|
55
67
|
frameSelection(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Frame a box in the corpus's coordinates — a tile's `bbox`, the extent, a window a host chose.
|
|
58
|
-
* The camera's only door: nothing outside the package reaches the renderer to move it.
|
|
59
|
-
*/
|
|
60
|
-
frameBox(box: Box, options?: {
|
|
61
|
-
duration?: number;
|
|
62
|
-
padding?: number;
|
|
63
|
-
}): void;
|
|
64
68
|
clear(): void;
|
|
65
69
|
}
|
|
66
70
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAE3C,mEAAmE;AACnE,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yFAAyF;AACzF,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAAG,IAAI,IAAI,CAAC;IACZ,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,iFAAiF;IACjF,KAAK,IAAI,IAAI,CAAC;IACd,oCAAoC;IACpC,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC/B,wDAAwD;IACxD,cAAc,IAAI,IAAI,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The graph view over a fossil corpus. fossil reads and this package draws, and nothing crosses
|
|
3
3
|
* between them but the corpus contract: the host opens the corpus with fossil's `open` on the page's
|
|
4
|
-
* `engine()`, and `GraphRoot` draws it.
|
|
4
|
+
* `engine()`, and `GraphRoot` draws the whole of it.
|
|
5
5
|
*
|
|
6
6
|
* Four layers, each the shape of a named reference — `/docs/design/graph`:
|
|
7
7
|
*
|
|
8
|
-
* - `core/` —
|
|
8
|
+
* - `core/` — the loader, one `scan` per table read whole into arrays indexed by `dense_id`, and a
|
|
9
9
|
* store in TanStack Query's observer shape. No React, no cosmos.gl, no SQL.
|
|
10
|
-
* - `render/` —
|
|
11
|
-
* frame.
|
|
10
|
+
* - `render/` — those arrays to cosmos.gl: uploaded once per corpus, repainted by kind, rendered once
|
|
11
|
+
* a frame.
|
|
12
12
|
* - `react/` — `useGraph`, `GraphRoot`, `GraphRootProvider`, `useGraphContext`: Ark's four; and
|
|
13
13
|
* `useGraphState`, TanStack Store's selector, because the api is commands and the state moves at
|
|
14
14
|
* frame rate.
|
|
@@ -30,11 +30,9 @@ export { GraphInspector, type GraphInspectorProps } from './parts/graph-inspecto
|
|
|
30
30
|
export { ShapeGlyph, type ShapeGlyphProps } from './parts/shape-glyph';
|
|
31
31
|
export { lookFrom, type Look, type LookPatch, type Shape } from './render/graph-looks';
|
|
32
32
|
export { simFrom, type Sim } from './render/graph-sim';
|
|
33
|
-
export { adaptive } from './render/adaptive';
|
|
34
33
|
export { scaleOf } from './render/graph-model';
|
|
35
34
|
export type { Channels } from './core/channels';
|
|
36
|
-
export {
|
|
37
|
-
export type { GraphCommands, Motion, Selection, SelectionSource, Tool } from './core/types';
|
|
35
|
+
export type { GraphCommands, Motion, Selection, SelectionSource, Tool, VertexId } from './core/types';
|
|
38
36
|
export type { Drawn, GraphState, GraphStatus } from './core/state';
|
|
39
37
|
export type { VertexDetail } from './core/detail';
|
|
40
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAIvE,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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