@newtone-dev/ui-react-web 0.64.0 → 0.65.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/dist/beside/beside.css +2 -2
- package/dist/nav-list/nav-list.css +10 -0
- package/dist/node-map/beads-gl.d.ts +62 -0
- package/dist/node-map/beads-gl.d.ts.map +1 -0
- package/dist/node-map/beads-gl.js +330 -0
- package/dist/node-map/beads-gl.js.map +1 -0
- package/dist/node-map/node-map-3d.d.ts +1 -1
- package/dist/node-map/node-map-3d.d.ts.map +1 -1
- package/dist/node-map/node-map-3d.js +295 -22
- package/dist/node-map/node-map-3d.js.map +1 -1
- package/dist/node-map/node-map.css +111 -14
- package/dist/node-map/node-map.d.ts +10 -2
- package/dist/node-map/node-map.d.ts.map +1 -1
- package/dist/node-map/node-map.js +6 -3
- package/dist/node-map/node-map.js.map +1 -1
- package/dist/node-map/over.d.ts +18 -2
- package/dist/node-map/over.d.ts.map +1 -1
- package/dist/node-map/over.js +14 -4
- package/dist/node-map/over.js.map +1 -1
- package/dist/node-map/space.d.ts +6 -0
- package/dist/node-map/space.d.ts.map +1 -1
- package/dist/node-map/space.js +22 -8
- package/dist/node-map/space.js.map +1 -1
- package/package.json +1 -1
package/dist/beside/beside.css
CHANGED
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
> .newtone-beside-main {
|
|
116
116
|
padding-block-start: 40px;
|
|
117
117
|
}
|
|
118
|
-
/* A canvas takes no such room (Joshua 2026-11-08, Slides): it starts where the list starts, the same height, and the
|
|
118
|
+
/* A canvas, and a NodeMap (2026-12-04, Truths' graph), takes no such room (Joshua 2026-11-08, Slides): it starts where the list starts, the same height, and the
|
|
119
119
|
* menu button floats over its corner as its zoom buttons do. */
|
|
120
120
|
.newtone-split[data-newtone-split-docked]
|
|
121
121
|
.newtone-split-body
|
|
122
122
|
> .newtone-beside
|
|
123
|
-
> .newtone-beside-main:has(> .newtone-canvas) {
|
|
123
|
+
> .newtone-beside-main:has(> :is(.newtone-canvas, .newtone-node-map, .newtone-node-map-loading)) {
|
|
124
124
|
padding-block-start: 0;
|
|
125
125
|
}
|
|
126
126
|
/* Narrower than 64rem (48rem for a narrow panel, which leaves the main content more room), the panel goes over it. */
|
|
@@ -38,6 +38,16 @@
|
|
|
38
38
|
.newtone-nav-list-group-title {
|
|
39
39
|
padding-inline: var(--newtone-space-3);
|
|
40
40
|
}
|
|
41
|
+
/* A group's title is a row (2026-12-04, Joshua): as tall as a place (40px), its words in its middle, and 4px from the
|
|
42
|
+
row above as places are, so the list reads as one run of rows with the title only skipping a place. */
|
|
43
|
+
.newtone-nav-list-group:not(:first-child):has(> .newtone-nav-list-group-title) {
|
|
44
|
+
margin-block-start: calc(var(--newtone-space-1) - (var(--newtone-space-1) * 2 + 1px));
|
|
45
|
+
}
|
|
46
|
+
.newtone-nav-list-group > .newtone-nav-list-group-title {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
min-block-size: 40px;
|
|
50
|
+
}
|
|
41
51
|
.newtone-nav-list-rows {
|
|
42
52
|
display: flex;
|
|
43
53
|
flex-direction: column;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type Tier = 'high' | 'mid' | 'low';
|
|
2
|
+
export interface Bead {
|
|
3
|
+
/** Where its middle falls, in CSS pixels; its radius there; its depth from the camera, in the map's units. */
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
r: number;
|
|
7
|
+
depth: number;
|
|
8
|
+
/** Its middle in view space (x right, y down, z toward the camera), in the map's units, and its radius in them. */
|
|
9
|
+
vx: number;
|
|
10
|
+
vy: number;
|
|
11
|
+
vz: number;
|
|
12
|
+
R: number;
|
|
13
|
+
/** Its colour, linear 0..1, and how opaque it is. */
|
|
14
|
+
color: readonly [number, number, number];
|
|
15
|
+
alpha: number;
|
|
16
|
+
/** How deep in the map's ground it sits, 0..1. */
|
|
17
|
+
fog: number;
|
|
18
|
+
/** The sphere that throws its shadow on it, in view space, or none. */
|
|
19
|
+
occluder?: {
|
|
20
|
+
vx: number;
|
|
21
|
+
vy: number;
|
|
22
|
+
vz: number;
|
|
23
|
+
R: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface Tie {
|
|
27
|
+
ax: number;
|
|
28
|
+
ay: number;
|
|
29
|
+
ad: number;
|
|
30
|
+
bx: number;
|
|
31
|
+
by: number;
|
|
32
|
+
bd: number;
|
|
33
|
+
width: number;
|
|
34
|
+
color: readonly [number, number, number];
|
|
35
|
+
alpha: number;
|
|
36
|
+
}
|
|
37
|
+
export interface Scene {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
beads: Bead[];
|
|
41
|
+
ties: Tie[];
|
|
42
|
+
/** Where the light comes from, in view space (x right, y down, z toward the camera), unit length. */
|
|
43
|
+
light: readonly [number, number, number];
|
|
44
|
+
ground: readonly [number, number, number];
|
|
45
|
+
/** The depth in focus, and how far from it the blur is full. */
|
|
46
|
+
focus: number;
|
|
47
|
+
span: number;
|
|
48
|
+
near: number;
|
|
49
|
+
far: number;
|
|
50
|
+
}
|
|
51
|
+
export interface Beads {
|
|
52
|
+
tier: Tier;
|
|
53
|
+
draw: (scene: Scene) => void;
|
|
54
|
+
/** One frame's time while the person turns or flies the map: a slow run steps the tier down. */
|
|
55
|
+
frame: (ms: number) => void;
|
|
56
|
+
dispose: () => void;
|
|
57
|
+
}
|
|
58
|
+
/** The spheres' painter on a canvas, or null where WebGL2 is missing (the SVG beads are drawn instead). */
|
|
59
|
+
export declare function beadsOn(canvas: HTMLCanvasElement, onTier?: (t: Tier) => void): Beads | null;
|
|
60
|
+
/** A CSS colour (any syntax the browser reads, tokens and color-mix included) as linear-ish sRGB 0..1. */
|
|
61
|
+
export declare function rgbOf(css: string, probe: HTMLElement): [number, number, number];
|
|
62
|
+
//# sourceMappingURL=beads-gl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-gl.d.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X,qGAAqG;IACrG,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACzC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACd;AAgID,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAC5B,gGAAgG;IAChG,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,2GAA2G;AAC3G,wBAAgB,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,GAAG,KAAK,GAAG,IAAI,CAuL3F;AAED,0GAA0G;AAC1G,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAa/E"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
// NodeMap in depth, drawn as real spheres (2026-12-04, Joshua: "real spheres with actual volume and a satin finish",
|
|
2
|
+
// a light that stays put while the map turns, shadows from one sphere onto another, a blur with distance, and the
|
|
3
|
+
// graphics card's own speed deciding how much of that is drawn). WebGL2 with no library: every sphere is one quad
|
|
4
|
+
// whose pixels work out the sphere's surface (an impostor), so a sphere costs two triangles at any size, and its depth
|
|
5
|
+
// is written per pixel so spheres and ties cross each other truly. Where WebGL2 is missing, node-map-3d.tsx draws the
|
|
6
|
+
// SVG beads instead.
|
|
7
|
+
//
|
|
8
|
+
// AMOUNTS IT DECIDES:
|
|
9
|
+
// 0.75px the softest an edge is, in focus: just enough to smooth it
|
|
10
|
+
// BLUR 7px how soft an edge grows at the farthest from the focus, on the high tier
|
|
11
|
+
// 24 the satin's breadth: a broad, soft highlight rather than a glossy point
|
|
12
|
+
// 0.55 how dark a shadow one sphere throws on another is, at its middle
|
|
13
|
+
// 24ms a frame slower than this, on average while turning, steps down a tier
|
|
14
|
+
const BEAD_VS = `#version 300 es
|
|
15
|
+
layout(location=0) in vec2 corner;
|
|
16
|
+
layout(location=1) in vec4 place; // x, y, r (CSS px), depth
|
|
17
|
+
layout(location=2) in vec4 view; // vx, vy, vz, R
|
|
18
|
+
layout(location=3) in vec4 paint; // r, g, b, alpha
|
|
19
|
+
layout(location=4) in vec4 occ; // occluder vx, vy, vz, R (R 0: none)
|
|
20
|
+
layout(location=5) in float fog;
|
|
21
|
+
uniform vec2 box;
|
|
22
|
+
uniform float focus, span, blur;
|
|
23
|
+
out vec2 uv;
|
|
24
|
+
out float soft;
|
|
25
|
+
flat out vec4 vView, vPaint, vOcc;
|
|
26
|
+
flat out float vFog, vDepth;
|
|
27
|
+
void main() {
|
|
28
|
+
// The edge grows softer the farther the sphere is from the focus: blur in pixels, as a share of its radius.
|
|
29
|
+
float px = 0.75 + blur * clamp(abs(place.w - focus) / span, 0.0, 1.0);
|
|
30
|
+
float grow = 1.0 + px / max(place.z, 0.5);
|
|
31
|
+
uv = corner * grow;
|
|
32
|
+
soft = px / max(place.z, 0.5);
|
|
33
|
+
vec2 at = place.xy + corner * place.z * grow;
|
|
34
|
+
gl_Position = vec4(at.x / box.x * 2.0 - 1.0, 1.0 - at.y / box.y * 2.0, 0.0, 1.0);
|
|
35
|
+
vView = view; vPaint = paint; vOcc = occ; vFog = fog; vDepth = place.w;
|
|
36
|
+
}`;
|
|
37
|
+
const BEAD_FS = `#version 300 es
|
|
38
|
+
precision highp float;
|
|
39
|
+
in vec2 uv;
|
|
40
|
+
in float soft;
|
|
41
|
+
flat in vec4 vView, vPaint, vOcc;
|
|
42
|
+
flat in float vFog, vDepth;
|
|
43
|
+
uniform vec3 light, ground;
|
|
44
|
+
uniform float near, far, shadows, shine;
|
|
45
|
+
out vec4 color;
|
|
46
|
+
void main() {
|
|
47
|
+
float d2 = dot(uv, uv);
|
|
48
|
+
float d = sqrt(d2);
|
|
49
|
+
float cover = 1.0 - smoothstep(1.0 - soft, 1.0 + soft, d);
|
|
50
|
+
if (cover <= 0.001) discard;
|
|
51
|
+
vec2 q = uv / max(d, 1.0);
|
|
52
|
+
vec3 n = vec3(q, sqrt(max(0.0, 1.0 - dot(q, q))));
|
|
53
|
+
vec3 L = light;
|
|
54
|
+
float lambert = max(dot(n, L), 0.0);
|
|
55
|
+
// Light from the sky above, a little from the ground below: the side away from the light is never black.
|
|
56
|
+
float sky = 0.42 + 0.16 * (-n.y);
|
|
57
|
+
// Satin: a broad, soft highlight toward the light, nothing glossy.
|
|
58
|
+
vec3 h = normalize(L + vec3(0.0, 0.0, 1.0));
|
|
59
|
+
float spec = pow(max(dot(n, h), 0.0), 24.0) * 0.32 * shine;
|
|
60
|
+
// The rim catches a little of the light behind, so a sphere's outline reads against the ground.
|
|
61
|
+
float rim = pow(1.0 - n.z, 3.0) * 0.12 * shine;
|
|
62
|
+
float lit = 1.0;
|
|
63
|
+
if (shadows > 0.5 && vOcc.w > 0.0) {
|
|
64
|
+
vec3 p = vView.xyz + n * vView.w;
|
|
65
|
+
vec3 to = vOcc.xyz - p;
|
|
66
|
+
float t = dot(to, L);
|
|
67
|
+
if (t > 0.0) {
|
|
68
|
+
float miss = length(to - L * t);
|
|
69
|
+
lit = 1.0 - 0.55 * (1.0 - smoothstep(vOcc.w * 0.55, vOcc.w * 1.25, miss));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
vec3 base = vPaint.rgb;
|
|
73
|
+
vec3 c = base * (sky + 0.72 * lambert * lit) + vec3(spec * lit) + vec3(rim);
|
|
74
|
+
c = mix(c, ground, vFog);
|
|
75
|
+
color = vec4(c * vPaint.a * cover, vPaint.a * cover);
|
|
76
|
+
// The depth of the surface under this pixel, so spheres and ties cross each other truly.
|
|
77
|
+
float z = vDepth - n.z * vView.w;
|
|
78
|
+
gl_FragDepth = clamp((z - near) / max(far - near, 1e-3), 0.0, 1.0);
|
|
79
|
+
}`;
|
|
80
|
+
const TIE_VS = `#version 300 es
|
|
81
|
+
layout(location=0) in vec2 corner; // along 0..1, side -1..1
|
|
82
|
+
layout(location=1) in vec3 a; // x, y, depth
|
|
83
|
+
layout(location=2) in vec3 b;
|
|
84
|
+
layout(location=3) in vec4 paint;
|
|
85
|
+
layout(location=4) in float width;
|
|
86
|
+
uniform vec2 box;
|
|
87
|
+
uniform float near, far;
|
|
88
|
+
out vec4 vPaint;
|
|
89
|
+
out float side;
|
|
90
|
+
out float vWidth;
|
|
91
|
+
void main() {
|
|
92
|
+
vec2 dir = b.xy - a.xy;
|
|
93
|
+
float len = max(length(dir), 1e-3);
|
|
94
|
+
vec2 across = vec2(-dir.y, dir.x) / len;
|
|
95
|
+
vec2 at = mix(a.xy, b.xy, corner.x) + across * corner.y * (width * 0.5 + 0.5);
|
|
96
|
+
float z = mix(a.z, b.z, corner.x);
|
|
97
|
+
gl_Position = vec4(at.x / box.x * 2.0 - 1.0, 1.0 - at.y / box.y * 2.0, clamp((z - near) / max(far - near, 1e-3), 0.0, 1.0) * 2.0 - 1.0, 1.0);
|
|
98
|
+
vPaint = paint; side = corner.y * (width * 0.5 + 0.5); vWidth = width;
|
|
99
|
+
}`;
|
|
100
|
+
const TIE_FS = `#version 300 es
|
|
101
|
+
precision highp float;
|
|
102
|
+
in vec4 vPaint;
|
|
103
|
+
in float side;
|
|
104
|
+
in float vWidth;
|
|
105
|
+
out vec4 color;
|
|
106
|
+
void main() {
|
|
107
|
+
// A plain line: full inside its width, half a pixel of smoothing at its sides, nothing more.
|
|
108
|
+
float a = vPaint.a * clamp(vWidth * 0.5 + 0.5 - abs(side), 0.0, 1.0);
|
|
109
|
+
color = vec4(vPaint.rgb * a, a);
|
|
110
|
+
}`;
|
|
111
|
+
function program(gl, vs, fs) {
|
|
112
|
+
const make = (kind, src) => {
|
|
113
|
+
const s = gl.createShader(kind);
|
|
114
|
+
gl.shaderSource(s, src);
|
|
115
|
+
gl.compileShader(s);
|
|
116
|
+
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS))
|
|
117
|
+
throw new Error(gl.getShaderInfoLog(s) ?? 'shader');
|
|
118
|
+
return s;
|
|
119
|
+
};
|
|
120
|
+
const p = gl.createProgram();
|
|
121
|
+
gl.attachShader(p, make(gl.VERTEX_SHADER, vs));
|
|
122
|
+
gl.attachShader(p, make(gl.FRAGMENT_SHADER, fs));
|
|
123
|
+
gl.linkProgram(p);
|
|
124
|
+
if (!gl.getProgramParameter(p, gl.LINK_STATUS))
|
|
125
|
+
throw new Error(gl.getProgramInfoLog(p) ?? 'program');
|
|
126
|
+
return p;
|
|
127
|
+
}
|
|
128
|
+
/** The tier a card starts on: a software renderer starts low, a phone mid, everything else high. */
|
|
129
|
+
function firstTier(gl) {
|
|
130
|
+
const info = gl.getExtension('WEBGL_debug_renderer_info');
|
|
131
|
+
const name = info ? String(gl.getParameter(info.UNMASKED_RENDERER_WEBGL)) : '';
|
|
132
|
+
if (/swiftshader|llvmpipe|software|basic render/i.test(name))
|
|
133
|
+
return 'low';
|
|
134
|
+
if (typeof matchMedia === 'function' && matchMedia('(pointer: coarse)').matches)
|
|
135
|
+
return 'mid';
|
|
136
|
+
return 'high';
|
|
137
|
+
}
|
|
138
|
+
/** The spheres' painter on a canvas, or null where WebGL2 is missing (the SVG beads are drawn instead). */
|
|
139
|
+
export function beadsOn(canvas, onTier) {
|
|
140
|
+
let gl = null;
|
|
141
|
+
try {
|
|
142
|
+
gl = canvas.getContext('webgl2', { premultipliedAlpha: true, antialias: false, alpha: true });
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
gl = null;
|
|
146
|
+
}
|
|
147
|
+
if (!gl)
|
|
148
|
+
return null;
|
|
149
|
+
const g = gl;
|
|
150
|
+
let beadP, tieP;
|
|
151
|
+
try {
|
|
152
|
+
beadP = program(g, BEAD_VS, BEAD_FS);
|
|
153
|
+
tieP = program(g, TIE_VS, TIE_FS);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
const quad = g.createBuffer();
|
|
159
|
+
g.bindBuffer(g.ARRAY_BUFFER, quad);
|
|
160
|
+
g.bufferData(g.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), g.STATIC_DRAW);
|
|
161
|
+
const strip = g.createBuffer();
|
|
162
|
+
g.bindBuffer(g.ARRAY_BUFFER, strip);
|
|
163
|
+
g.bufferData(g.ARRAY_BUFFER, new Float32Array([0, -1, 1, -1, 0, 1, 1, 1]), g.STATIC_DRAW);
|
|
164
|
+
const beadData = g.createBuffer();
|
|
165
|
+
const tieData = g.createBuffer();
|
|
166
|
+
const beadVao = g.createVertexArray();
|
|
167
|
+
g.bindVertexArray(beadVao);
|
|
168
|
+
g.bindBuffer(g.ARRAY_BUFFER, quad);
|
|
169
|
+
g.enableVertexAttribArray(0);
|
|
170
|
+
g.vertexAttribPointer(0, 2, g.FLOAT, false, 0, 0);
|
|
171
|
+
g.bindBuffer(g.ARRAY_BUFFER, beadData);
|
|
172
|
+
const BEAD = 21;
|
|
173
|
+
const beadAttr = [4, 4, 4, 4, 1];
|
|
174
|
+
let off = 0;
|
|
175
|
+
beadAttr.forEach((size, i) => {
|
|
176
|
+
g.enableVertexAttribArray(i + 1);
|
|
177
|
+
g.vertexAttribPointer(i + 1, size, g.FLOAT, false, BEAD * 4, off * 4);
|
|
178
|
+
g.vertexAttribDivisor(i + 1, 1);
|
|
179
|
+
off += size;
|
|
180
|
+
});
|
|
181
|
+
const tieVao = g.createVertexArray();
|
|
182
|
+
g.bindVertexArray(tieVao);
|
|
183
|
+
g.bindBuffer(g.ARRAY_BUFFER, strip);
|
|
184
|
+
g.enableVertexAttribArray(0);
|
|
185
|
+
g.vertexAttribPointer(0, 2, g.FLOAT, false, 0, 0);
|
|
186
|
+
g.bindBuffer(g.ARRAY_BUFFER, tieData);
|
|
187
|
+
const TIE = 11;
|
|
188
|
+
off = 0;
|
|
189
|
+
[3, 3, 4, 1].forEach((size, i) => {
|
|
190
|
+
g.enableVertexAttribArray(i + 1);
|
|
191
|
+
g.vertexAttribPointer(i + 1, size, g.FLOAT, false, TIE * 4, off * 4);
|
|
192
|
+
g.vertexAttribDivisor(i + 1, 1);
|
|
193
|
+
off += size;
|
|
194
|
+
});
|
|
195
|
+
g.bindVertexArray(null);
|
|
196
|
+
const u = (p, name) => g.getUniformLocation(p, name);
|
|
197
|
+
const bu = {
|
|
198
|
+
box: u(beadP, 'box'),
|
|
199
|
+
focus: u(beadP, 'focus'),
|
|
200
|
+
span: u(beadP, 'span'),
|
|
201
|
+
blur: u(beadP, 'blur'),
|
|
202
|
+
light: u(beadP, 'light'),
|
|
203
|
+
ground: u(beadP, 'ground'),
|
|
204
|
+
near: u(beadP, 'near'),
|
|
205
|
+
far: u(beadP, 'far'),
|
|
206
|
+
shadows: u(beadP, 'shadows'),
|
|
207
|
+
shine: u(beadP, 'shine'),
|
|
208
|
+
};
|
|
209
|
+
const tu = { box: u(tieP, 'box'), near: u(tieP, 'near'), far: u(tieP, 'far') };
|
|
210
|
+
let tier = firstTier(g);
|
|
211
|
+
let slow = [];
|
|
212
|
+
let beadBuf = new Float32Array(0);
|
|
213
|
+
let tieBuf = new Float32Array(0);
|
|
214
|
+
let last = null;
|
|
215
|
+
const draw = (s) => {
|
|
216
|
+
last = s;
|
|
217
|
+
const dpr = Math.min(typeof devicePixelRatio === 'number' ? devicePixelRatio : 1, tier === 'high' ? 2 : tier === 'mid' ? 1.5 : 1);
|
|
218
|
+
const w = Math.max(1, Math.round(s.width * dpr));
|
|
219
|
+
const h = Math.max(1, Math.round(s.height * dpr));
|
|
220
|
+
if (canvas.width !== w || canvas.height !== h) {
|
|
221
|
+
canvas.width = w;
|
|
222
|
+
canvas.height = h;
|
|
223
|
+
}
|
|
224
|
+
g.viewport(0, 0, w, h);
|
|
225
|
+
g.clearColor(0, 0, 0, 0);
|
|
226
|
+
g.clearDepth(1);
|
|
227
|
+
g.clear(g.COLOR_BUFFER_BIT | g.DEPTH_BUFFER_BIT);
|
|
228
|
+
g.enable(g.BLEND);
|
|
229
|
+
g.blendFunc(g.ONE, g.ONE_MINUS_SRC_ALPHA);
|
|
230
|
+
g.enable(g.DEPTH_TEST);
|
|
231
|
+
g.depthFunc(g.LEQUAL);
|
|
232
|
+
// Ties first, writing their depth, so a sphere behind one does not cover it.
|
|
233
|
+
if (s.ties.length) {
|
|
234
|
+
if (tieBuf.length < s.ties.length * TIE)
|
|
235
|
+
tieBuf = new Float32Array(s.ties.length * TIE * 2);
|
|
236
|
+
s.ties.forEach((t, i) => {
|
|
237
|
+
tieBuf.set([t.ax, t.ay, t.ad, t.bx, t.by, t.bd, ...t.color, t.alpha, t.width], i * TIE);
|
|
238
|
+
});
|
|
239
|
+
g.useProgram(tieP);
|
|
240
|
+
g.uniform2f(tu.box, s.width, s.height);
|
|
241
|
+
g.uniform1f(tu.near, s.near);
|
|
242
|
+
g.uniform1f(tu.far, s.far);
|
|
243
|
+
g.bindBuffer(g.ARRAY_BUFFER, tieData);
|
|
244
|
+
g.bufferData(g.ARRAY_BUFFER, tieBuf.subarray(0, s.ties.length * TIE), g.DYNAMIC_DRAW);
|
|
245
|
+
g.bindVertexArray(tieVao);
|
|
246
|
+
g.depthMask(true);
|
|
247
|
+
g.drawArraysInstanced(g.TRIANGLE_STRIP, 0, 4, s.ties.length);
|
|
248
|
+
}
|
|
249
|
+
// Spheres farthest first, so a soft edge blends over what is behind it.
|
|
250
|
+
if (s.beads.length) {
|
|
251
|
+
if (beadBuf.length < s.beads.length * BEAD)
|
|
252
|
+
beadBuf = new Float32Array(s.beads.length * BEAD * 2);
|
|
253
|
+
s.beads.forEach((b, i) => {
|
|
254
|
+
const o = b.occluder;
|
|
255
|
+
beadBuf.set([
|
|
256
|
+
b.x, b.y, b.r, b.depth,
|
|
257
|
+
b.vx, b.vy, b.vz, b.R,
|
|
258
|
+
...b.color, b.alpha,
|
|
259
|
+
o?.vx ?? 0, o?.vy ?? 0, o?.vz ?? 0, o?.R ?? 0,
|
|
260
|
+
b.fog,
|
|
261
|
+
], i * BEAD);
|
|
262
|
+
});
|
|
263
|
+
g.useProgram(beadP);
|
|
264
|
+
g.uniform2f(bu.box, s.width, s.height);
|
|
265
|
+
g.uniform1f(bu.focus, s.focus);
|
|
266
|
+
g.uniform1f(bu.span, Math.max(s.span, 1e-3));
|
|
267
|
+
g.uniform1f(bu.blur, tier === 'high' ? 7 : 0);
|
|
268
|
+
g.uniform3f(bu.light, ...s.light);
|
|
269
|
+
g.uniform3f(bu.ground, ...s.ground);
|
|
270
|
+
g.uniform1f(bu.near, s.near);
|
|
271
|
+
g.uniform1f(bu.far, s.far);
|
|
272
|
+
g.uniform1f(bu.shadows, tier === 'high' ? 1 : 0);
|
|
273
|
+
g.uniform1f(bu.shine, tier === 'low' ? 0.5 : 1);
|
|
274
|
+
g.bindBuffer(g.ARRAY_BUFFER, beadData);
|
|
275
|
+
g.bufferData(g.ARRAY_BUFFER, beadBuf.subarray(0, s.beads.length * BEAD), g.DYNAMIC_DRAW);
|
|
276
|
+
g.bindVertexArray(beadVao);
|
|
277
|
+
g.drawArraysInstanced(g.TRIANGLE_STRIP, 0, 4, s.beads.length);
|
|
278
|
+
}
|
|
279
|
+
g.bindVertexArray(null);
|
|
280
|
+
};
|
|
281
|
+
const frame = (ms) => {
|
|
282
|
+
if (tier === 'low')
|
|
283
|
+
return;
|
|
284
|
+
slow.push(ms);
|
|
285
|
+
if (slow.length < 30)
|
|
286
|
+
return;
|
|
287
|
+
const mean = slow.reduce((a, b) => a + b, 0) / slow.length;
|
|
288
|
+
slow = [];
|
|
289
|
+
if (mean > 24) {
|
|
290
|
+
tier = tier === 'high' ? 'mid' : 'low';
|
|
291
|
+
onTier?.(tier);
|
|
292
|
+
if (last)
|
|
293
|
+
draw(last);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
return {
|
|
297
|
+
get tier() {
|
|
298
|
+
return tier;
|
|
299
|
+
},
|
|
300
|
+
draw,
|
|
301
|
+
frame,
|
|
302
|
+
dispose: () => {
|
|
303
|
+
g.deleteBuffer(quad);
|
|
304
|
+
g.deleteBuffer(strip);
|
|
305
|
+
g.deleteBuffer(beadData);
|
|
306
|
+
g.deleteBuffer(tieData);
|
|
307
|
+
g.deleteVertexArray(beadVao);
|
|
308
|
+
g.deleteVertexArray(tieVao);
|
|
309
|
+
g.deleteProgram(beadP);
|
|
310
|
+
g.deleteProgram(tieP);
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/** A CSS colour (any syntax the browser reads, tokens and color-mix included) as linear-ish sRGB 0..1. */
|
|
315
|
+
export function rgbOf(css, probe) {
|
|
316
|
+
probe.style.color = '';
|
|
317
|
+
probe.style.color = css;
|
|
318
|
+
const resolved = getComputedStyle(probe).color;
|
|
319
|
+
const c = document.createElement('canvas');
|
|
320
|
+
c.width = c.height = 1;
|
|
321
|
+
const x = c.getContext('2d', { willReadFrequently: true });
|
|
322
|
+
if (!x)
|
|
323
|
+
return [0.5, 0.5, 0.5];
|
|
324
|
+
x.fillStyle = '#808080';
|
|
325
|
+
x.fillStyle = resolved;
|
|
326
|
+
x.fillRect(0, 0, 1, 1);
|
|
327
|
+
const [r, g, b] = x.getImageData(0, 0, 1, 1).data;
|
|
328
|
+
return [r / 255, g / 255, b / 255];
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=beads-gl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-gl.js","sourceRoot":"","sources":["../../src/node-map/beads-gl.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,kHAAkH;AAClH,kHAAkH;AAClH,uHAAuH;AACvH,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,CAAC,CAAA;IAC1D,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,SAAS,GAAG,SAAS,CAAA;IACvB,CAAC,CAAC,SAAS,GAAG,QAAQ,CAAA;IACtB,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACtB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACjD,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;AACtC,CAAC"}
|
|
@@ -6,5 +6,5 @@ import type { NodeMapProps } from './node-map.js';
|
|
|
6
6
|
* pointed node, its ties, and the nearest `named` nodes, never more than a few at once. Drawn in SVG with the same
|
|
7
7
|
* looks as the flat map; a hidden list of the nodes, in a steady order, is what Tab and assistive tech reach.
|
|
8
8
|
*/
|
|
9
|
-
export declare function NodeMap3D({ nodes, edges, selected, onSelect, head, legend, labels, fresh, }: NodeMapProps): import("react").JSX.Element;
|
|
9
|
+
export declare function NodeMap3D({ nodes, edges, selected, onSelect, head, legend, labels, fresh, light, }: NodeMapProps): import("react").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=node-map-3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-map-3d.d.ts","sourceRoot":"","sources":["../../src/node-map/node-map-3d.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-map-3d.d.ts","sourceRoot":"","sources":["../../src/node-map/node-map-3d.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,eAAe,CAAA;AA8E9D;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAe,GAClB,EAAE,YAAY,+BAotBd"}
|