@kanzo-tech/graph 0.13.1 → 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 +31 -56
- 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 +162 -172
- 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 +26 -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 +128 -106
- 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/graph-toolbar.d.ts +1 -1
- package/dist/parts/graph-toolbar.d.ts.map +1 -1
- package/dist/parts/graph-toolbar.js +40 -40
- package/dist/parts/graph-toolbar.js.map +1 -1
- package/dist/parts/overlays.d.ts +6 -5
- package/dist/parts/overlays.d.ts.map +1 -1
- package/dist/parts/overlays.js +70 -68
- 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 +10 -10
- package/dist/render/renderer.d.ts.map +1 -1
- package/dist/render/renderer.js +121 -177
- 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 +29 -10
- 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/render/when-ready.d.ts +0 -35
- package/dist/render/when-ready.d.ts.map +0 -1
- package/dist/render/when-ready.js +0 -17
- package/dist/render/when-ready.js.map +0 -1
package/dist/render/encode.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Binding } from '../core/channels';
|
|
2
|
-
import { TileView } from '../core/store';
|
|
3
|
-
/**
|
|
4
|
-
* Values to codes, in the order first seen — stable for the life of a binding. **The seed ranks
|
|
5
|
-
* first, in its own order**: the manifest's ordinals or the host's named values, so a colour is
|
|
6
|
-
* decided before a tile arrives. Only a value outside it is ranked by value, after the seed.
|
|
7
|
-
*/
|
|
8
|
-
export declare class Dictionary {
|
|
9
|
-
#private;
|
|
10
|
-
readonly values: unknown[];
|
|
11
|
-
constructor(seed?: readonly unknown[]);
|
|
12
|
-
code(value: unknown): number;
|
|
13
|
-
/** Each code's rank: the seed's own order, then every other value seen, numbers before strings. */
|
|
14
|
-
ranks(): Uint32Array;
|
|
15
|
-
}
|
|
16
|
-
/** One tile's rows and edges as the arrays a composition concatenates. */
|
|
17
|
-
export interface Encoded {
|
|
18
|
-
readonly n: number;
|
|
19
|
-
readonly cells: boolean;
|
|
20
|
-
/** `[x0, y0, x1, y1, …]`. */
|
|
21
|
-
readonly positions: Float32Array;
|
|
22
|
-
/** `dense_id` at the payload, `cell_id` on a rung — what an edge's ends name. */
|
|
23
|
-
readonly keys: Float64Array;
|
|
24
|
-
/** Dictionary codes of the categorical column, or `null` when nothing is bound. */
|
|
25
|
-
readonly codes: Uint32Array | null;
|
|
26
|
-
/** The ramp: `r`'s column at the payload, a cell's `count` on a rung. */
|
|
27
|
-
readonly sizes: Float32Array | null;
|
|
28
|
-
/** Vertices each row stands for: one at the payload, a cell's `count` on a rung. */
|
|
29
|
-
readonly counts: Float64Array;
|
|
30
|
-
readonly titles: readonly string[] | null;
|
|
31
|
-
/** `[src, dst, …]` in `keys`' space, every relation read from this tile, both directions. */
|
|
32
|
-
readonly links: Float64Array;
|
|
33
|
-
/** How many edges each link stands for: one at the payload, the quotient's `weight` on a rung. */
|
|
34
|
-
readonly weights: Float32Array | null;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* **A tile is encoded once per binding**: the arrays are made when it arrives, and a composition is a
|
|
38
|
-
* concatenation of arrays already made. A cell summarises one channel, so its colour is `mode` when
|
|
39
|
-
* `fill` binds the column the tree's mode is of, its size can only be `count`, and it has no title.
|
|
40
|
-
*/
|
|
41
|
-
export declare function encode(view: TileView, binding: Binding, dictionary: Dictionary, modeColumn: string | null): Encoded;
|
|
42
|
-
//# sourceMappingURL=encode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/render/encode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,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-
};
|
|
5
|
-
var x = (e, t, o) => t in e ? q(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
6
|
-
var P = (e, t, o) => x(e, typeof t != "symbol" ? t + "" : t, o), T = (e, t, o) => t.has(e) || M("Cannot " + o);
|
|
7
|
-
var u = (e, t, o) => (T(e, t, "read from private field"), o ? o.call(e) : t.get(e)), C = (e, t, o) => t.has(e) ? M("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, o), U = (e, t, o, r) => (T(e, t, "write to private field"), r ? r.call(e, o) : t.set(e, o), o);
|
|
8
|
-
import { PAYLOAD_COORDINATES as B, PAYLOAD_ADDRESS as G } from "@fossil-lang/corpus";
|
|
9
|
-
const H = "cell_id", J = "count", Q = "mode", V = G[0], [W, Z] = B;
|
|
10
|
-
var f, l;
|
|
11
|
-
class ot {
|
|
12
|
-
constructor(t = []) {
|
|
13
|
-
P(this, "values", []);
|
|
14
|
-
C(this, f, /* @__PURE__ */ new Map());
|
|
15
|
-
C(this, l);
|
|
16
|
-
for (const o of t) this.code(o);
|
|
17
|
-
U(this, l, this.values.length);
|
|
18
|
-
}
|
|
19
|
-
code(t) {
|
|
20
|
-
const o = typeof t == "bigint" ? Number(t) : t;
|
|
21
|
-
let r = u(this, f).get(o);
|
|
22
|
-
return r === void 0 && (r = this.values.length, this.values.push(o), u(this, f).set(o, r)), r;
|
|
23
|
-
}
|
|
24
|
-
/** Each code's rank: the seed's own order, then every other value seen, numbers before strings. */
|
|
25
|
-
ranks() {
|
|
26
|
-
const t = new Uint32Array(this.values.length);
|
|
27
|
-
for (let r = 0; r < u(this, l); r++) t[r] = r;
|
|
28
|
-
const o = this.values.slice(u(this, l)).map((r, n) => ({ value: r, code: u(this, l) + n }));
|
|
29
|
-
return o.sort((r, n) => $(r.value, n.value)), o.forEach(({ code: r }, n) => {
|
|
30
|
-
t[r] = u(this, l) + n;
|
|
31
|
-
}), t;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
f = new WeakMap(), l = new WeakMap();
|
|
35
|
-
function $(e, t) {
|
|
36
|
-
return typeof e == "number" && typeof t == "number" ? e - t : typeof e == "number" ? -1 : typeof t == "number" ? 1 : String(e ?? "").localeCompare(String(t ?? ""));
|
|
37
|
-
}
|
|
38
|
-
const w = (e, t) => {
|
|
39
|
-
const o = new Float64Array(t);
|
|
40
|
-
if (e) for (let r = 0; r < t; r++) o[r] = Number(e[r] ?? Number.NaN);
|
|
41
|
-
return o;
|
|
42
|
-
};
|
|
43
|
-
function rt(e, t, o, r) {
|
|
44
|
-
var k, F, S, Y, O, z, R, K;
|
|
45
|
-
const { rows: n, edges: L } = e.content, i = e.kind === "cells", c = n.numRows, y = (k = n.getChild(W)) == null ? void 0 : k.toArray(), m = (F = n.getChild(Z)) == null ? void 0 : F.toArray(), g = new Float32Array(c * 2);
|
|
46
|
-
for (let s = 0; s < c; s++)
|
|
47
|
-
g[s * 2] = Number((y == null ? void 0 : y[s]) ?? Number.NaN), g[s * 2 + 1] = Number((m == null ? void 0 : m[s]) ?? Number.NaN);
|
|
48
|
-
const I = w((S = n.getChild(i ? H : V)) == null ? void 0 : S.toArray(), c), E = i ? t.category === r ? Q : void 0 : t.category, b = E === void 0 || (Y = n.getChild(E)) == null ? void 0 : Y.toArray();
|
|
49
|
-
let A = null;
|
|
50
|
-
if (b) {
|
|
51
|
-
A = new Uint32Array(c);
|
|
52
|
-
for (let s = 0; s < c; s++) A[s] = o.code(b[s] ?? null);
|
|
53
|
-
}
|
|
54
|
-
const D = i ? w((O = n.getChild(J)) == null ? void 0 : O.toArray(), c) : new Float64Array(c).fill(1), d = i ? t.size !== void 0 ? D : void 0 : t.size, X = d === void 0 ? null : Float32Array.from(typeof d == "string" ? w((z = n.getChild(d)) == null ? void 0 : z.toArray(), c) : d), _ = !i && t.title !== void 0 ? (R = n.getChild(t.title)) == null ? void 0 : R.toArray() : void 0, j = _ ? Array.from({ length: c }, (s, a) => String(_[a] ?? "")) : null;
|
|
55
|
-
let N = 0;
|
|
56
|
-
for (const s of L) N += s.src.length;
|
|
57
|
-
const p = new Float64Array(N * 2), v = i ? new Float32Array(N) : null;
|
|
58
|
-
let h = 0;
|
|
59
|
-
for (const s of L)
|
|
60
|
-
for (let a = 0; a < s.src.length; a++, h++)
|
|
61
|
-
p[h * 2] = Number(s.src[a]), p[h * 2 + 1] = Number(s.dst[a]), v && (v[h] = Number(((K = s.weight) == null ? void 0 : K[a]) ?? 1));
|
|
62
|
-
return { n: c, cells: i, positions: g, keys: I, codes: A, sizes: X, counts: D, titles: j, links: p, weights: v };
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
ot as Dictionary,
|
|
66
|
-
rt as encode
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=encode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encode.js","sources":["../../src/render/encode.ts"],"sourcesContent":["import { PAYLOAD_ADDRESS, PAYLOAD_COORDINATES } from \"@fossil-lang/corpus\";\nimport type { Binding } from \"../core/channels\";\nimport type { TileView } from \"../core/store\";\n\n/**\n * The cell columns a view reads. fossil's barrel publishes the payload's role table and not the\n * cells', so these two are spelled here; `/docs/design/graph` lists it as open on fossil's side.\n */\nconst CELL_KEY = \"cell_id\";\nconst CELL_TALLY = \"count\";\nconst CELL_MODE = \"mode\";\nconst KEY = PAYLOAD_ADDRESS[0] as string;\nconst [X, Y] = PAYLOAD_COORDINATES as [string, string];\n\n/**\n * Values to codes, in the order first seen — stable for the life of a binding. **The seed ranks\n * first, in its own order**: the manifest's ordinals or the host's named values, so a colour is\n * decided before a tile arrives. Only a value outside it is ranked by value, after the seed.\n */\nexport class Dictionary {\n readonly values: unknown[] = [];\n readonly #codes = new Map<unknown, number>();\n readonly #seeded: number;\n\n constructor(seed: readonly unknown[] = []) {\n for (const value of seed) this.code(value);\n this.#seeded = this.values.length;\n }\n\n code(value: unknown): number {\n const key = typeof value === \"bigint\" ? Number(value) : value;\n let code = this.#codes.get(key);\n if (code === undefined) {\n code = this.values.length;\n this.values.push(key);\n this.#codes.set(key, code);\n }\n return code;\n }\n\n /** Each code's rank: the seed's own order, then every other value seen, numbers before strings. */\n ranks(): Uint32Array {\n const ranks = new Uint32Array(this.values.length);\n for (let code = 0; code < this.#seeded; code++) ranks[code] = code;\n const rest = this.values.slice(this.#seeded).map((value, i) => ({ value, code: this.#seeded + i }));\n rest.sort((a, b) => compare(a.value, b.value));\n rest.forEach(({ code }, i) => {\n ranks[code] = this.#seeded + i;\n });\n return ranks;\n }\n}\n\nfunction compare(a: unknown, b: unknown): number {\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n if (typeof a === \"number\") return -1;\n if (typeof b === \"number\") return 1;\n return String(a ?? \"\").localeCompare(String(b ?? \"\"));\n}\n\n/** One tile's rows and edges as the arrays a composition concatenates. */\nexport interface Encoded {\n readonly n: number;\n readonly cells: boolean;\n /** `[x0, y0, x1, y1, …]`. */\n readonly positions: Float32Array;\n /** `dense_id` at the payload, `cell_id` on a rung — what an edge's ends name. */\n readonly keys: Float64Array;\n /** Dictionary codes of the categorical column, or `null` when nothing is bound. */\n readonly codes: Uint32Array | null;\n /** The ramp: `r`'s column at the payload, a cell's `count` on a rung. */\n readonly sizes: Float32Array | null;\n /** Vertices each row stands for: one at the payload, a cell's `count` on a rung. */\n readonly counts: Float64Array;\n readonly titles: readonly string[] | null;\n /** `[src, dst, …]` in `keys`' space, every relation read from this tile, both directions. */\n readonly links: Float64Array;\n /** How many edges each link stands for: one at the payload, the quotient's `weight` on a rung. */\n readonly weights: Float32Array | null;\n}\n\nconst numbers = (values: ArrayLike<unknown> | undefined, n: number): Float64Array => {\n const out = new Float64Array(n);\n if (values) for (let i = 0; i < n; i++) out[i] = Number(values[i] ?? Number.NaN);\n return out;\n};\n\n/**\n * **A tile is encoded once per binding**: the arrays are made when it arrives, and a composition is a\n * concatenation of arrays already made. A cell summarises one channel, so its colour is `mode` when\n * `fill` binds the column the tree's mode is of, its size can only be `count`, and it has no title.\n */\nexport function encode(\n view: TileView,\n binding: Binding,\n dictionary: Dictionary,\n modeColumn: string | null,\n): Encoded {\n const { rows, edges } = view.content;\n const cells = view.kind === \"cells\";\n const n = rows.numRows;\n const xs = rows.getChild(X)?.toArray();\n const ys = rows.getChild(Y)?.toArray();\n const positions = new Float32Array(n * 2);\n for (let i = 0; i < n; i++) {\n positions[i * 2] = Number(xs?.[i] ?? Number.NaN);\n positions[i * 2 + 1] = Number(ys?.[i] ?? Number.NaN);\n }\n const keys = numbers(rows.getChild(cells ? CELL_KEY : KEY)?.toArray(), n);\n\n const categorical = cells ? (binding.category === modeColumn ? CELL_MODE : undefined) : binding.category;\n const category = categorical === undefined ? undefined : rows.getChild(categorical)?.toArray();\n let codes: Uint32Array | null = null;\n if (category) {\n codes = new Uint32Array(n);\n for (let i = 0; i < n; i++) codes[i] = dictionary.code(category[i] ?? null);\n }\n\n const counts = cells ? numbers(rows.getChild(CELL_TALLY)?.toArray(), n) : new Float64Array(n).fill(1);\n const ramp = cells ? (binding.size !== undefined ? counts : undefined) : binding.size;\n const sizes =\n ramp === undefined ? null : Float32Array.from(typeof ramp === \"string\" ? numbers(rows.getChild(ramp)?.toArray(), n) : ramp);\n\n const named = !cells && binding.title !== undefined ? rows.getChild(binding.title)?.toArray() : undefined;\n const titles = named ? Array.from({ length: n }, (_, i) => String(named[i] ?? \"\")) : null;\n\n let total = 0;\n for (const edge of edges) total += edge.src.length;\n const links = new Float64Array(total * 2);\n const weights = cells ? new Float32Array(total) : null;\n let at = 0;\n for (const edge of edges) {\n for (let e = 0; e < edge.src.length; e++, at++) {\n links[at * 2] = Number(edge.src[e]);\n links[at * 2 + 1] = Number(edge.dst[e]);\n if (weights) weights[at] = Number(edge.weight?.[e] ?? 1);\n }\n }\n\n return { n, cells, positions, keys, codes, sizes, counts, titles, links, weights };\n}\n"],"names":["CELL_KEY","CELL_TALLY","CELL_MODE","KEY","PAYLOAD_ADDRESS","X","Y","PAYLOAD_COORDINATES","Dictionary","seed","__publicField","__privateAdd","_codes","_seeded","value","__privateSet","key","code","__privateGet","ranks","rest","i","a","b","compare","numbers","values","n","out","encode","view","binding","dictionary","modeColumn","rows","edges","cells","xs","_a","ys","_b","positions","keys","_c","categorical","category","_d","codes","counts","_e","ramp","sizes","_f","named","_g","titles","_","total","edge","links","weights","at","e","_h"],"mappings":";;;;;;;;AAQA,MAAMA,IAAW,WACXC,IAAa,SACbC,IAAY,QACZC,IAAMC,EAAgB,CAAC,GACvB,CAACC,GAAGC,CAAC,IAAIC;;AAOR,MAAMC,GAAW;AAAA,EAKtB,YAAYC,IAA2B,IAAI;AAJlC,IAAAC,EAAA,gBAAoB,CAAA;AACpB,IAAAC,EAAA,MAAAC,uBAAa,IAAA;AACb,IAAAD,EAAA,MAAAE;AAGP,eAAWC,KAASL,EAAM,MAAK,KAAKK,CAAK;AACzC,IAAAC,EAAA,MAAKF,GAAU,KAAK,OAAO;AAAA,EAC7B;AAAA,EAEA,KAAKC,GAAwB;AAC3B,UAAME,IAAM,OAAOF,KAAU,WAAW,OAAOA,CAAK,IAAIA;AACxD,QAAIG,IAAOC,EAAA,MAAKN,GAAO,IAAII,CAAG;AAC9B,WAAIC,MAAS,WACXA,IAAO,KAAK,OAAO,QACnB,KAAK,OAAO,KAAKD,CAAG,GACpBE,EAAA,MAAKN,GAAO,IAAII,GAAKC,CAAI,IAEpBA;AAAA,EACT;AAAA;AAAA,EAGA,QAAqB;AACnB,UAAME,IAAQ,IAAI,YAAY,KAAK,OAAO,MAAM;AAChD,aAASF,IAAO,GAAGA,IAAOC,EAAA,MAAKL,IAASI,IAAQ,CAAAE,EAAMF,CAAI,IAAIA;AAC9D,UAAMG,IAAO,KAAK,OAAO,MAAMF,EAAA,MAAKL,EAAO,EAAE,IAAI,CAACC,GAAOO,OAAO,EAAE,OAAAP,GAAO,MAAMI,EAAA,MAAKL,KAAUQ,IAAI;AAClG,WAAAD,EAAK,KAAK,CAACE,GAAGC,MAAMC,EAAQ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,IAAK;AACT,aAAWH,KAAQvB;AACjB,aAAS2B,IAAI,GAAGA,IAAIJ,EAAK,IAAI,QAAQI,KAAKD;AACxC,MAAAF,EAAME,IAAK,CAAC,IAAI,OAAOH,EAAK,IAAII,CAAC,CAAC,GAClCH,EAAME,IAAK,IAAI,CAAC,IAAI,OAAOH,EAAK,IAAII,CAAC,CAAC,GAClCF,QAAiBC,CAAE,IAAI,SAAOE,IAAAL,EAAK,WAAL,gBAAAK,EAAcD,OAAM,CAAC;AAI3D,SAAO,EAAE,GAAAnC,GAAG,OAAAS,GAAO,WAAAK,GAAW,MAAAC,GAAM,OAAAK,GAAO,OAAAI,GAAO,QAAAH,GAAQ,QAAAO,GAAQ,OAAAI,GAAO,SAAAC,EAAA;AAC3E;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Graph } from '@cosmos.gl/graph';
|
|
2
|
-
/**
|
|
3
|
-
* **Every write into cosmos.gl goes through here, because a non-null instance is not a usable one.**
|
|
4
|
-
*
|
|
5
|
-
* cosmos.gl 3.x builds its device asynchronously. The constructor returns immediately and
|
|
6
|
-
* `graphRef.current` is set, but for tens of milliseconds — longer when several graphs mount on one
|
|
7
|
-
* page — the instance has no points, no links and no config to change. What happens then is not one
|
|
8
|
-
* failure mode but two, and the quiet one is worse:
|
|
9
|
-
*
|
|
10
|
-
* - `setPointPositions` **throws** `Cannot set properties of undefined (setting 'shouldSkipRescale')`.
|
|
11
|
-
* React swallows it into the effect boundary, so it reaches the console and nothing else.
|
|
12
|
-
* - `setPointColors`, `setPointSizes`, `setConfigPartial` and `fitViewByPointPositions` **do not**.
|
|
13
|
-
* They raise a dirty flag on something that is not there and return, so the picture is simply
|
|
14
|
-
* never uploaded: a blank canvas beside a badge reporting a full slice, with `onFailure` silent
|
|
15
|
-
* and nothing in the console at all.
|
|
16
|
-
*
|
|
17
|
-
* Measured on `/docs/graph`, where three graphs mount together and none of them drew a single point.
|
|
18
|
-
* Upstream states the contract in its own `.d.ts` for `findPointsInRect` and `findPointsInPolygon`
|
|
19
|
-
* — *must only be called when the graph is ready* — and it holds for every setter too.
|
|
20
|
-
*
|
|
21
|
-
* **The rule is a helper rather than five `await`s** because it was broken at five call sites in
|
|
22
|
-
* four modules, which is what `CONVENTIONS.md` means by a rule that has to become a test.
|
|
23
|
-
* `when-ready.test.ts` is that test, and it reads the source rather than the behaviour.
|
|
24
|
-
*
|
|
25
|
-
* **`ready` has no failure path.** When the device cannot be made, cosmos.gl does not reject — the
|
|
26
|
-
* promise simply never settles, so `apply` never runs and the canvas stays empty. That is the state
|
|
27
|
-
* `hasWebGL()` in `use-renderer.ts` probes for before any of this, and it is why this returns a
|
|
28
|
-
* cancel rather than being awaited: nothing here may hold a caller open.
|
|
29
|
-
*
|
|
30
|
-
* @returns a cancel. Call it from an effect's cleanup — during a pan the slices arrive faster than
|
|
31
|
-
* a frame, and every one but the last is superseded before it could have been drawn.
|
|
32
|
-
*/
|
|
33
|
-
export declare function whenReady(graph: Graph, apply: (graph: Graph) => void): () => void;
|
|
34
|
-
export declare function isReady(graph: Graph): boolean;
|
|
35
|
-
//# sourceMappingURL=when-ready.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when-ready.d.ts","sourceRoot":"","sources":["../../src/render/when-ready.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,MAAM,IAAI,CAQjF;AAeD,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAI7C"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
function d(e, r) {
|
|
2
|
-
let t = !0;
|
|
3
|
-
return e.ready.then(() => {
|
|
4
|
-
t && r(e);
|
|
5
|
-
}), () => {
|
|
6
|
-
t = !1;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
const n = /* @__PURE__ */ new WeakSet();
|
|
10
|
-
function i(e) {
|
|
11
|
-
return n.has(e) ? !0 : (e.ready.then(() => n.add(e)), !1);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
i as isReady,
|
|
15
|
-
d as whenReady
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=when-ready.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when-ready.js","sources":["../../src/render/when-ready.ts"],"sourcesContent":["import type { Graph } from \"@cosmos.gl/graph\";\n\n/**\n * **Every write into cosmos.gl goes through here, because a non-null instance is not a usable one.**\n *\n * cosmos.gl 3.x builds its device asynchronously. The constructor returns immediately and\n * `graphRef.current` is set, but for tens of milliseconds — longer when several graphs mount on one\n * page — the instance has no points, no links and no config to change. What happens then is not one\n * failure mode but two, and the quiet one is worse:\n *\n * - `setPointPositions` **throws** `Cannot set properties of undefined (setting 'shouldSkipRescale')`.\n * React swallows it into the effect boundary, so it reaches the console and nothing else.\n * - `setPointColors`, `setPointSizes`, `setConfigPartial` and `fitViewByPointPositions` **do not**.\n * They raise a dirty flag on something that is not there and return, so the picture is simply\n * never uploaded: a blank canvas beside a badge reporting a full slice, with `onFailure` silent\n * and nothing in the console at all.\n *\n * Measured on `/docs/graph`, where three graphs mount together and none of them drew a single point.\n * Upstream states the contract in its own `.d.ts` for `findPointsInRect` and `findPointsInPolygon`\n * — *must only be called when the graph is ready* — and it holds for every setter too.\n *\n * **The rule is a helper rather than five `await`s** because it was broken at five call sites in\n * four modules, which is what `CONVENTIONS.md` means by a rule that has to become a test.\n * `when-ready.test.ts` is that test, and it reads the source rather than the behaviour.\n *\n * **`ready` has no failure path.** When the device cannot be made, cosmos.gl does not reject — the\n * promise simply never settles, so `apply` never runs and the canvas stays empty. That is the state\n * `hasWebGL()` in `use-renderer.ts` probes for before any of this, and it is why this returns a\n * cancel rather than being awaited: nothing here may hold a caller open.\n *\n * @returns a cancel. Call it from an effect's cleanup — during a pan the slices arrive faster than\n * a frame, and every one but the last is superseded before it could have been drawn.\n */\nexport function whenReady(graph: Graph, apply: (graph: Graph) => void): () => void {\n let live = true;\n void graph.ready.then(() => {\n if (live) apply(graph);\n });\n return () => {\n live = false;\n };\n}\n\n/**\n * Whether this instance's device has arrived, answered **synchronously**.\n *\n * For the two call sites that cannot wait: `findPointsInRect` and `findPointsInPolygon` run inside a\n * pointer handler and have to return a number, and upstream marks exactly those two — and nothing\n * else in its `.d.ts` — *must only be called when the graph is ready*.\n *\n * The flag is kept beside the instance rather than on it, in a `WeakSet`, because the promise is the\n * only thing cosmos.gl exposes and a promise cannot be asked whether it has settled. A graph that is\n * never asked about is never added, which costs one `false` and one hit test that selects nothing.\n */\nconst arrived = new WeakSet<Graph>();\n\nexport function isReady(graph: Graph): boolean {\n if (arrived.has(graph)) return true;\n void graph.ready.then(() => arrived.add(graph));\n return false;\n}\n"],"names":["whenReady","graph","apply","live","arrived","isReady"],"mappings":"AAiCO,SAASA,EAAUC,GAAcC,GAA2C;AACjF,MAAIC,IAAO;AACX,SAAKF,EAAM,MAAM,KAAK,MAAM;AAC1B,IAAIE,OAAYF,CAAK;AAAA,EACvB,CAAC,GACM,MAAM;AACX,IAAAE,IAAO;AAAA,EACT;AACF;AAaA,MAAMC,wBAAc,QAAA;AAEb,SAASC,EAAQJ,GAAuB;AAC7C,SAAIG,EAAQ,IAAIH,CAAK,IAAU,MAC1BA,EAAM,MAAM,KAAK,MAAMG,EAAQ,IAAIH,CAAK,CAAC,GACvC;AACT;"}
|