@fnndsc/orrery 0.1.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 -0
- package/dist/controls/cameraRig.d.ts +223 -0
- package/dist/controls/cameraRig.js +353 -0
- package/dist/controls/cameraRig.js.map +1 -0
- package/dist/controls/gestures.d.ts +133 -0
- package/dist/controls/gestures.js +282 -0
- package/dist/controls/gestures.js.map +1 -0
- package/dist/controls/index.d.ts +9 -0
- package/dist/controls/index.js +10 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/controls/picker.d.ts +117 -0
- package/dist/controls/picker.js +167 -0
- package/dist/controls/picker.js.map +1 -0
- package/dist/controls/replay.d.ts +94 -0
- package/dist/controls/replay.js +147 -0
- package/dist/controls/replay.js.map +1 -0
- package/dist/draw/censusField.d.ts +113 -0
- package/dist/draw/censusField.js +241 -0
- package/dist/draw/censusField.js.map +1 -0
- package/dist/draw/constants.d.ts +13 -0
- package/dist/draw/constants.js +14 -0
- package/dist/draw/constants.js.map +1 -0
- package/dist/draw/geometry.d.ts +33 -0
- package/dist/draw/geometry.js +55 -0
- package/dist/draw/geometry.js.map +1 -0
- package/dist/draw/handoff.d.ts +11 -0
- package/dist/draw/handoff.js +12 -0
- package/dist/draw/handoff.js.map +1 -0
- package/dist/draw/handoffField.d.ts +74 -0
- package/dist/draw/handoffField.js +151 -0
- package/dist/draw/handoffField.js.map +1 -0
- package/dist/draw/index.d.ts +20 -0
- package/dist/draw/index.js +21 -0
- package/dist/draw/index.js.map +1 -0
- package/dist/draw/labelField.d.ts +63 -0
- package/dist/draw/labelField.js +149 -0
- package/dist/draw/labelField.js.map +1 -0
- package/dist/draw/lamps.d.ts +16 -0
- package/dist/draw/lamps.js +17 -0
- package/dist/draw/lamps.js.map +1 -0
- package/dist/draw/nebula.d.ts +8 -0
- package/dist/draw/nebula.js +28 -0
- package/dist/draw/nebula.js.map +1 -0
- package/dist/draw/palette.d.ts +41 -0
- package/dist/draw/palette.js +32 -0
- package/dist/draw/palette.js.map +1 -0
- package/dist/draw/sphereField.d.ts +98 -0
- package/dist/draw/sphereField.js +168 -0
- package/dist/draw/sphereField.js.map +1 -0
- package/dist/draw/starField.d.ts +127 -0
- package/dist/draw/starField.js +267 -0
- package/dist/draw/starField.js.map +1 -0
- package/dist/draw/stars.d.ts +65 -0
- package/dist/draw/stars.js +132 -0
- package/dist/draw/stars.js.map +1 -0
- package/dist/draw/timing.d.ts +11 -0
- package/dist/draw/timing.js +12 -0
- package/dist/draw/timing.js.map +1 -0
- package/dist/draw/tubeField.d.ts +131 -0
- package/dist/draw/tubeField.js +352 -0
- package/dist/draw/tubeField.js.map +1 -0
- package/dist/draw/tubes.d.ts +41 -0
- package/dist/draw/tubes.js +116 -0
- package/dist/draw/tubes.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/accretion.d.ts +31 -0
- package/dist/layout/accretion.js +384 -0
- package/dist/layout/accretion.js.map +1 -0
- package/dist/layout/constellations.d.ts +25 -0
- package/dist/layout/constellations.js +197 -0
- package/dist/layout/constellations.js.map +1 -0
- package/dist/layout/galaxy.d.ts +12 -0
- package/dist/layout/galaxy.js +99 -0
- package/dist/layout/galaxy.js.map +1 -0
- package/dist/layout/hierarchy.d.ts +45 -0
- package/dist/layout/hierarchy.js +464 -0
- package/dist/layout/hierarchy.js.map +1 -0
- package/dist/layout/index.d.ts +20 -0
- package/dist/layout/index.js +21 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/layoutInput.d.ts +29 -0
- package/dist/layout/layoutInput.js +45 -0
- package/dist/layout/layoutInput.js.map +1 -0
- package/dist/layout/molecule.d.ts +64 -0
- package/dist/layout/molecule.js +155 -0
- package/dist/layout/molecule.js.map +1 -0
- package/dist/layout/pull.d.ts +94 -0
- package/dist/layout/pull.js +137 -0
- package/dist/layout/pull.js.map +1 -0
- package/dist/layout/ranked.d.ts +75 -0
- package/dist/layout/ranked.js +148 -0
- package/dist/layout/ranked.js.map +1 -0
- package/dist/layout/registry.d.ts +23 -0
- package/dist/layout/registry.js +165 -0
- package/dist/layout/registry.js.map +1 -0
- package/dist/layout/seeded.d.ts +32 -0
- package/dist/layout/seeded.js +48 -0
- package/dist/layout/seeded.js.map +1 -0
- package/dist/layout/types.d.ts +81 -0
- package/dist/layout/types.js +14 -0
- package/dist/layout/types.js.map +1 -0
- package/dist/scene/index.d.ts +6 -0
- package/dist/scene/index.js +7 -0
- package/dist/scene/index.js.map +1 -0
- package/dist/scene/orrery.d.ts +592 -0
- package/dist/scene/orrery.js +1555 -0
- package/dist/scene/orrery.js.map +1 -0
- package/dist/types/encoding.d.ts +43 -0
- package/dist/types/encoding.js +7 -0
- package/dist/types/encoding.js.map +1 -0
- package/dist/types/space.d.ts +12 -0
- package/dist/types/space.js +10 -0
- package/dist/types/space.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The drawing layer's public face: the pieces a scene draws with.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
export * from './constants.js';
|
|
7
|
+
export * from './timing.js';
|
|
8
|
+
export * from './handoff.js';
|
|
9
|
+
export * from './lamps.js';
|
|
10
|
+
export * from './palette.js';
|
|
11
|
+
export * from './geometry.js';
|
|
12
|
+
export * from './stars.js';
|
|
13
|
+
export * from './starField.js';
|
|
14
|
+
export * from './sphereField.js';
|
|
15
|
+
export * from './nebula.js';
|
|
16
|
+
export * from './tubes.js';
|
|
17
|
+
export * from './tubeField.js';
|
|
18
|
+
export * from './handoffField.js';
|
|
19
|
+
export * from './censusField.js';
|
|
20
|
+
export * from './labelField.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The drawing layer's public face: the pieces a scene draws with.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
export * from './constants.js';
|
|
7
|
+
export * from './timing.js';
|
|
8
|
+
export * from './handoff.js';
|
|
9
|
+
export * from './lamps.js';
|
|
10
|
+
export * from './palette.js';
|
|
11
|
+
export * from './geometry.js';
|
|
12
|
+
export * from './stars.js';
|
|
13
|
+
export * from './starField.js';
|
|
14
|
+
export * from './sphereField.js';
|
|
15
|
+
export * from './nebula.js';
|
|
16
|
+
export * from './tubes.js';
|
|
17
|
+
export * from './tubeField.js';
|
|
18
|
+
export * from './handoffField.js';
|
|
19
|
+
export * from './censusField.js';
|
|
20
|
+
export * from './labelField.js';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Captions: words a surface pins to a node, drawn in the space.
|
|
3
|
+
*
|
|
4
|
+
* A hub the operator should read without hovering — "DICOM · 38", "SAG
|
|
5
|
+
* MPRAGE · 12" — carries a caption: its text drawn once on a canvas, shown
|
|
6
|
+
* as a sprite above the node, always facing the camera, one size on screen
|
|
7
|
+
* however far away. A dimmed node's caption dims with it. Where captions
|
|
8
|
+
* meet on screen the bigger node's is read and the smaller's gives way: its
|
|
9
|
+
* words are a hover away, and words drawn over words are read as neither.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import * as THREE from 'three';
|
|
14
|
+
/**
|
|
15
|
+
* A caption's height on screen, as a share of the view's height: the same
|
|
16
|
+
* at any distance, so a hub is read from afar and not shouted at up close.
|
|
17
|
+
* Sized in the space instead, a caption three units tall was under three
|
|
18
|
+
* pixels across a space of several hundred.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CAPTION_SCREEN_HEIGHT: number;
|
|
21
|
+
/** The captions of one scene. */
|
|
22
|
+
export declare class LabelField {
|
|
23
|
+
private readonly parent;
|
|
24
|
+
private captions;
|
|
25
|
+
/** Whether captions are shown at all: the operator may want the picture bare. */
|
|
26
|
+
private shown;
|
|
27
|
+
/**
|
|
28
|
+
* @param parent - Where the captions are drawn.
|
|
29
|
+
*/
|
|
30
|
+
constructor(parent: THREE.Object3D);
|
|
31
|
+
/** @returns How many captions are drawn. */
|
|
32
|
+
count(): number;
|
|
33
|
+
/**
|
|
34
|
+
* Pins a caption above a node.
|
|
35
|
+
*
|
|
36
|
+
* @param id - The node.
|
|
37
|
+
* @param text - The words.
|
|
38
|
+
* @param position - Where the node stands.
|
|
39
|
+
* @param radius - How far it reaches: the caption stands just above it.
|
|
40
|
+
* @param color - The words' colour.
|
|
41
|
+
* @param dim - Drawn faint, with its node.
|
|
42
|
+
* @param rank - Which caption wins where two meet on screen: the greater.
|
|
43
|
+
*/
|
|
44
|
+
caption_add(id: string, text: string, position: THREE.Vector3, radius: number, color: THREE.Color, dim: boolean, rank?: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* Shows each caption that meets no greater one on screen, and hides the
|
|
47
|
+
* rest. Cheap enough for every frame: captions are few.
|
|
48
|
+
*
|
|
49
|
+
* @param camera - The camera the space is seen through.
|
|
50
|
+
* @returns How many captions are shown.
|
|
51
|
+
*/
|
|
52
|
+
declutter(camera: THREE.PerspectiveCamera): number;
|
|
53
|
+
/**
|
|
54
|
+
* Shows or hides every caption; each keeps its place and words.
|
|
55
|
+
*
|
|
56
|
+
* @param on - Shown.
|
|
57
|
+
*/
|
|
58
|
+
shown_set(on: boolean): void;
|
|
59
|
+
/** @returns Whether captions are shown. */
|
|
60
|
+
shown_get(): boolean;
|
|
61
|
+
/** Forgets every caption: the scene is being redrawn (its parent already cleared). */
|
|
62
|
+
clear(): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Captions: words a surface pins to a node, drawn in the space.
|
|
3
|
+
*
|
|
4
|
+
* A hub the operator should read without hovering — "DICOM · 38", "SAG
|
|
5
|
+
* MPRAGE · 12" — carries a caption: its text drawn once on a canvas, shown
|
|
6
|
+
* as a sprite above the node, always facing the camera, one size on screen
|
|
7
|
+
* however far away. A dimmed node's caption dims with it. Where captions
|
|
8
|
+
* meet on screen the bigger node's is read and the smaller's gives way: its
|
|
9
|
+
* words are a hover away, and words drawn over words are read as neither.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import * as THREE from 'three';
|
|
14
|
+
/**
|
|
15
|
+
* A caption's height on screen, as a share of the view's height: the same
|
|
16
|
+
* at any distance, so a hub is read from afar and not shouted at up close.
|
|
17
|
+
* Sized in the space instead, a caption three units tall was under three
|
|
18
|
+
* pixels across a space of several hundred.
|
|
19
|
+
*/
|
|
20
|
+
export const CAPTION_SCREEN_HEIGHT = 0.028;
|
|
21
|
+
/** The opacity of a caption on a dimmed node. */
|
|
22
|
+
const CAPTION_DIM = 0.25;
|
|
23
|
+
/**
|
|
24
|
+
* The plate behind a caption's words: dark, mostly opaque, so the words
|
|
25
|
+
* read over the brightest cloud. Bare words were lost on a phone over a
|
|
26
|
+
* nebula of four hundred feeds.
|
|
27
|
+
*/
|
|
28
|
+
const CAPTION_PLATE = 'rgba(0, 0, 0, 0.7)';
|
|
29
|
+
/** Pixels of text height on the canvas a caption is drawn on. */
|
|
30
|
+
const CANVAS_TEXT_PX = 48;
|
|
31
|
+
/** The captions of one scene. */
|
|
32
|
+
export class LabelField {
|
|
33
|
+
parent;
|
|
34
|
+
captions = new Map();
|
|
35
|
+
/** Whether captions are shown at all: the operator may want the picture bare. */
|
|
36
|
+
shown = true;
|
|
37
|
+
/**
|
|
38
|
+
* @param parent - Where the captions are drawn.
|
|
39
|
+
*/
|
|
40
|
+
constructor(parent) {
|
|
41
|
+
this.parent = parent;
|
|
42
|
+
}
|
|
43
|
+
/** @returns How many captions are drawn. */
|
|
44
|
+
count() {
|
|
45
|
+
return this.captions.size;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Pins a caption above a node.
|
|
49
|
+
*
|
|
50
|
+
* @param id - The node.
|
|
51
|
+
* @param text - The words.
|
|
52
|
+
* @param position - Where the node stands.
|
|
53
|
+
* @param radius - How far it reaches: the caption stands just above it.
|
|
54
|
+
* @param color - The words' colour.
|
|
55
|
+
* @param dim - Drawn faint, with its node.
|
|
56
|
+
* @param rank - Which caption wins where two meet on screen: the greater.
|
|
57
|
+
*/
|
|
58
|
+
caption_add(id, text, position, radius, color, dim, rank = 0) {
|
|
59
|
+
const canvas = document.createElement('canvas');
|
|
60
|
+
const context = canvas.getContext('2d');
|
|
61
|
+
const font = `600 ${CANVAS_TEXT_PX}px sans-serif`;
|
|
62
|
+
let width = text.length * CANVAS_TEXT_PX * 0.6;
|
|
63
|
+
if (context !== null) {
|
|
64
|
+
context.font = font;
|
|
65
|
+
width = Math.ceil(context.measureText(text).width);
|
|
66
|
+
}
|
|
67
|
+
canvas.width = Math.max(1, width + CANVAS_TEXT_PX);
|
|
68
|
+
canvas.height = Math.round(CANVAS_TEXT_PX * 1.5);
|
|
69
|
+
if (context !== null) {
|
|
70
|
+
// A resized canvas forgets its font.
|
|
71
|
+
context.font = font;
|
|
72
|
+
context.textBaseline = 'middle';
|
|
73
|
+
const radius = canvas.height / 4;
|
|
74
|
+
context.fillStyle = CAPTION_PLATE;
|
|
75
|
+
context.beginPath();
|
|
76
|
+
context.roundRect(0, 0, canvas.width, canvas.height, radius);
|
|
77
|
+
context.fill();
|
|
78
|
+
context.fillStyle = `#${color.getHexString()}`;
|
|
79
|
+
context.fillText(text, CANVAS_TEXT_PX / 2, canvas.height / 2);
|
|
80
|
+
}
|
|
81
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
82
|
+
const material = new THREE.SpriteMaterial({ map: texture, transparent: true, depthWrite: false, depthTest: false, sizeAttenuation: false, opacity: dim ? CAPTION_DIM : 0.9 });
|
|
83
|
+
const sprite = new THREE.Sprite(material);
|
|
84
|
+
sprite.scale.set(CAPTION_SCREEN_HEIGHT * (canvas.width / canvas.height), CAPTION_SCREEN_HEIGHT, 1);
|
|
85
|
+
// Anchored at its lower edge, just above the node's reach.
|
|
86
|
+
sprite.center.set(0.5, 0);
|
|
87
|
+
sprite.position.set(position.x, position.y + radius, position.z);
|
|
88
|
+
// Over the stars and the nebulae: words are read, not glowed through.
|
|
89
|
+
sprite.renderOrder = 4;
|
|
90
|
+
// Drawn while captions are off, it stays hidden until they are on.
|
|
91
|
+
sprite.visible = this.shown;
|
|
92
|
+
this.parent.add(sprite);
|
|
93
|
+
this.captions.get(id)?.texture.dispose();
|
|
94
|
+
this.captions.set(id, { sprite, texture, rank });
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Shows each caption that meets no greater one on screen, and hides the
|
|
98
|
+
* rest. Cheap enough for every frame: captions are few.
|
|
99
|
+
*
|
|
100
|
+
* @param camera - The camera the space is seen through.
|
|
101
|
+
* @returns How many captions are shown.
|
|
102
|
+
*/
|
|
103
|
+
declutter(camera) {
|
|
104
|
+
if (!this.shown)
|
|
105
|
+
return 0;
|
|
106
|
+
const ordered = [...this.captions.values()].sort((a, b) => b.rank - a.rank);
|
|
107
|
+
const kept = [];
|
|
108
|
+
const at = new THREE.Vector3();
|
|
109
|
+
// A sprite not sized by distance spans its scale times the projection's.
|
|
110
|
+
const across = camera.projectionMatrix.elements[0] ?? 1;
|
|
111
|
+
const up = camera.projectionMatrix.elements[5] ?? 1;
|
|
112
|
+
for (const caption of ordered) {
|
|
113
|
+
caption.sprite.getWorldPosition(at).project(camera);
|
|
114
|
+
if (at.z > 1) {
|
|
115
|
+
caption.sprite.visible = false;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const halfWidth = (caption.sprite.scale.x * across) / 2;
|
|
119
|
+
const box = { left: at.x - halfWidth, right: at.x + halfWidth, bottom: at.y, top: at.y + caption.sprite.scale.y * up };
|
|
120
|
+
const meets = kept.some((other) => box.left < other.right && other.left < box.right && box.bottom < other.top && other.bottom < box.top);
|
|
121
|
+
caption.sprite.visible = !meets;
|
|
122
|
+
if (!meets)
|
|
123
|
+
kept.push(box);
|
|
124
|
+
}
|
|
125
|
+
return kept.length;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Shows or hides every caption; each keeps its place and words.
|
|
129
|
+
*
|
|
130
|
+
* @param on - Shown.
|
|
131
|
+
*/
|
|
132
|
+
shown_set(on) {
|
|
133
|
+
this.shown = on;
|
|
134
|
+
if (!on)
|
|
135
|
+
for (const caption of this.captions.values())
|
|
136
|
+
caption.sprite.visible = false;
|
|
137
|
+
}
|
|
138
|
+
/** @returns Whether captions are shown. */
|
|
139
|
+
shown_get() {
|
|
140
|
+
return this.shown;
|
|
141
|
+
}
|
|
142
|
+
/** Forgets every caption: the scene is being redrawn (its parent already cleared). */
|
|
143
|
+
clear() {
|
|
144
|
+
for (const caption of this.captions.values())
|
|
145
|
+
caption.texture.dispose();
|
|
146
|
+
this.captions = new Map();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=labelField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelField.js","sourceRoot":"","sources":["../../src/draw/labelField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;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,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;gBAAE,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;IACxF,CAAC;IAED,2CAA2C;IACpC,SAAS;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,sFAAsF;IAC/E,KAAK;QACV,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACxE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The lamps a replayed or running stage wears: how dark it rests, how its glow blooms, how the lot dims before the run replays.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import * as THREE from 'three';
|
|
7
|
+
/** A replayed stage before its pulse lands: this share of its colour. */
|
|
8
|
+
export declare const LAMP_DIM: number;
|
|
9
|
+
/** How long a stage's glow blooms out and settles as its pulse lands. */
|
|
10
|
+
export declare const LAMP_BLOOM_MS: number;
|
|
11
|
+
/** How far the bloom reaches, in the stage's radii. */
|
|
12
|
+
export declare const LAMP_BLOOM_REACH: number;
|
|
13
|
+
/** How long the lit stages take to dim before the run replays. */
|
|
14
|
+
export declare const LAMP_FADE_MS: number;
|
|
15
|
+
/** What a lit stage brightens toward. */
|
|
16
|
+
export declare const LAMP_WHITE: THREE.Color;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The lamps a replayed or running stage wears: how dark it rests, how its glow blooms, how the lot dims before the run replays.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import * as THREE from 'three';
|
|
7
|
+
/** A replayed stage before its pulse lands: this share of its colour. */
|
|
8
|
+
export const LAMP_DIM = 0.18;
|
|
9
|
+
/** How long a stage's glow blooms out and settles as its pulse lands. */
|
|
10
|
+
export const LAMP_BLOOM_MS = 1000;
|
|
11
|
+
/** How far the bloom reaches, in the stage's radii. */
|
|
12
|
+
export const LAMP_BLOOM_REACH = 9;
|
|
13
|
+
/** How long the lit stages take to dim before the run replays. */
|
|
14
|
+
export const LAMP_FADE_MS = 500;
|
|
15
|
+
/** What a lit stage brightens toward. */
|
|
16
|
+
export const LAMP_WHITE = new THREE.Color('#ffffff');
|
|
17
|
+
//# sourceMappingURL=lamps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lamps.js","sourceRoot":"","sources":["../../src/draw/lamps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,yEAAyE;AACzE,MAAM,CAAC,MAAM,QAAQ,GAAW,IAAI,CAAC;AAErC,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAW,IAAI,CAAC;AAE1C,uDAAuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAW,CAAC,CAAC;AAE1C,kEAAkE;AAClE,MAAM,CAAC,MAAM,YAAY,GAAW,GAAG,CAAC;AAExC,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAgB,IAAI,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Nebulae: the soft glow a cluster wears while the scene draws stars.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import * as THREE from 'three';
|
|
7
|
+
/** A soft radial glow, shared by every nebula. */
|
|
8
|
+
let nebulaTexture = null;
|
|
9
|
+
/** Draws (once) the nebula's radial glow. */
|
|
10
|
+
export function nebulaTexture_get() {
|
|
11
|
+
if (nebulaTexture !== null)
|
|
12
|
+
return nebulaTexture;
|
|
13
|
+
const canvas = document.createElement('canvas');
|
|
14
|
+
canvas.width = 128;
|
|
15
|
+
canvas.height = 128;
|
|
16
|
+
const context = canvas.getContext('2d');
|
|
17
|
+
if (context !== null) {
|
|
18
|
+
const gradient = context.createRadialGradient(64, 64, 0, 64, 64, 64);
|
|
19
|
+
gradient.addColorStop(0, 'rgba(255,255,255,1)');
|
|
20
|
+
gradient.addColorStop(0.35, 'rgba(255,255,255,0.45)');
|
|
21
|
+
gradient.addColorStop(1, 'rgba(255,255,255,0)');
|
|
22
|
+
context.fillStyle = gradient;
|
|
23
|
+
context.fillRect(0, 0, 128, 128);
|
|
24
|
+
}
|
|
25
|
+
nebulaTexture = new THREE.CanvasTexture(canvas);
|
|
26
|
+
return nebulaTexture;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=nebula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nebula.js","sourceRoot":"","sources":["../../src/draw/nebula.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,kDAAkD;AAClD,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C,6CAA6C;AAC7C,MAAM,UAAU,iBAAiB;IAC/B,IAAI,aAAa,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC;IACjD,MAAM,MAAM,GAAsB,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC;IACnB,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,MAAM,OAAO,GAAoC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACzE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,QAAQ,GAAmB,OAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACrF,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;QAChD,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAC;QACtD,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;QAChD,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC7B,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC;IACD,aAAa,GAAG,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The colours a drawer is handed. orrery never reads a stylesheet:
|
|
3
|
+
* a surface reads its theme and passes the colours in.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import * as THREE from 'three';
|
|
8
|
+
import type { Paint } from '../types/encoding.js';
|
|
9
|
+
/**
|
|
10
|
+
* The colours of a drawing.
|
|
11
|
+
*
|
|
12
|
+
* @property running - A stage at work.
|
|
13
|
+
* @property done - A stage finished well.
|
|
14
|
+
* @property error - A stage that failed; always visible.
|
|
15
|
+
* @property template - A stage not yet run.
|
|
16
|
+
* @property unknown - A state no other colour names.
|
|
17
|
+
* @property edge - An edge between stages.
|
|
18
|
+
* @property join - An edge that joins two branches.
|
|
19
|
+
* @property root - A graph's origin.
|
|
20
|
+
* @property pulse - The wave's flare.
|
|
21
|
+
*/
|
|
22
|
+
export interface Palette {
|
|
23
|
+
running: THREE.Color;
|
|
24
|
+
done: THREE.Color;
|
|
25
|
+
error: THREE.Color;
|
|
26
|
+
template: THREE.Color;
|
|
27
|
+
unknown: THREE.Color;
|
|
28
|
+
edge: THREE.Color;
|
|
29
|
+
join: THREE.Color;
|
|
30
|
+
root: THREE.Color;
|
|
31
|
+
pulse: THREE.Color;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The colour a paint names, in a palette.
|
|
35
|
+
*
|
|
36
|
+
* @param paint - The paint.
|
|
37
|
+
* @param palette - The colours of the drawing.
|
|
38
|
+
* @returns The colour — shared for a token or a hue, fresh for a blend;
|
|
39
|
+
* never mutate it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function paint_resolve(paint: Paint, palette: Palette): THREE.Color;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The colours a drawer is handed. orrery never reads a stylesheet:
|
|
3
|
+
* a surface reads its theme and passes the colours in.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import * as THREE from 'three';
|
|
8
|
+
/** Hues parsed once per distinct value: a space of thousands shares a few. */
|
|
9
|
+
const hueCache = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* The colour a paint names, in a palette.
|
|
12
|
+
*
|
|
13
|
+
* @param paint - The paint.
|
|
14
|
+
* @param palette - The colours of the drawing.
|
|
15
|
+
* @returns The colour — shared for a token or a hue, fresh for a blend;
|
|
16
|
+
* never mutate it.
|
|
17
|
+
*/
|
|
18
|
+
export function paint_resolve(paint, palette) {
|
|
19
|
+
if ('token' in paint)
|
|
20
|
+
return palette[paint.token];
|
|
21
|
+
if ('hue' in paint) {
|
|
22
|
+
let color = hueCache.get(paint.hue);
|
|
23
|
+
if (color === undefined) {
|
|
24
|
+
color = new THREE.Color(paint.hue);
|
|
25
|
+
hueCache.set(paint.hue, color);
|
|
26
|
+
}
|
|
27
|
+
return color;
|
|
28
|
+
}
|
|
29
|
+
const [from, to] = paint.blend;
|
|
30
|
+
return palette[from].clone().lerp(palette[to], Math.max(0, Math.min(1, paint.share)));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","sourceRoot":"","sources":["../../src/draw/palette.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4B/B,8EAA8E;AAC9E,MAAM,QAAQ,GAA6B,IAAI,GAAG,EAAE,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAY,EAAE,OAAgB;IAC1D,IAAI,OAAO,IAAI,KAAK;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;QACnB,IAAI,KAAK,GAA4B,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/B,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The solid spheres of a scene, the halos that mark a cluster, and
|
|
3
|
+
* the plain lines between spheres that do not wear tubes.
|
|
4
|
+
*
|
|
5
|
+
* A sphere is lit, coloured as it is handed; a dimmed one is faint scenery
|
|
6
|
+
* and takes no pointer; a selected one glows; flat, it is a disc facing the
|
|
7
|
+
* camera. Every sphere is found by its node's id.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import * as THREE from 'three';
|
|
12
|
+
/**
|
|
13
|
+
* How a sphere looks.
|
|
14
|
+
*
|
|
15
|
+
* @property color - Its hue.
|
|
16
|
+
* @property dim - Faint scenery that takes no pointer.
|
|
17
|
+
* @property selected - Lit from within: the node in hand.
|
|
18
|
+
* @property flat - A disc, not a sphere (a 2D projection).
|
|
19
|
+
* @property fade - Drawn at this opacity (a molecule fading in).
|
|
20
|
+
*/
|
|
21
|
+
export interface SphereLook {
|
|
22
|
+
color: THREE.Color;
|
|
23
|
+
dim?: boolean;
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
flat?: boolean;
|
|
26
|
+
fade?: number;
|
|
27
|
+
}
|
|
28
|
+
/** The solid spheres, halos and plain edges of one scene. */
|
|
29
|
+
export declare class SphereField {
|
|
30
|
+
private readonly parent;
|
|
31
|
+
private readonly geometries;
|
|
32
|
+
private byId;
|
|
33
|
+
private edges;
|
|
34
|
+
/**
|
|
35
|
+
* @param parent - Where the spheres are drawn.
|
|
36
|
+
*/
|
|
37
|
+
constructor(parent: THREE.Object3D);
|
|
38
|
+
/** Every drawn sphere and halo, by its node's id. */
|
|
39
|
+
get map(): Map<string, THREE.Mesh>;
|
|
40
|
+
/**
|
|
41
|
+
* Draws one sphere.
|
|
42
|
+
*
|
|
43
|
+
* @param id - Its node.
|
|
44
|
+
* @param position - Where it stands.
|
|
45
|
+
* @param radius - Its radius.
|
|
46
|
+
* @param look - How it looks.
|
|
47
|
+
* @returns The mesh.
|
|
48
|
+
*/
|
|
49
|
+
sphere_add(id: string, position: THREE.Vector3, radius: number, look: SphereLook): THREE.Mesh;
|
|
50
|
+
/**
|
|
51
|
+
* Draws a cluster's halo: translucent, unlit, written last so the spheres
|
|
52
|
+
* inside it show through; picked only when nothing solid is.
|
|
53
|
+
*
|
|
54
|
+
* @param id - The cluster's anchor.
|
|
55
|
+
* @param position - Where it stands.
|
|
56
|
+
* @param radius - How far it reaches.
|
|
57
|
+
* @param color - Its hue.
|
|
58
|
+
* @param dim - Faint scenery that takes no pointer.
|
|
59
|
+
*/
|
|
60
|
+
halo_add(id: string, position: THREE.Vector3, radius: number, color: THREE.Color, dim: boolean): void;
|
|
61
|
+
/**
|
|
62
|
+
* Draws a plain line between two spheres; a join is dashed.
|
|
63
|
+
*
|
|
64
|
+
* @param fromId - The parent.
|
|
65
|
+
* @param toId - The child.
|
|
66
|
+
* @param from - Where the parent stands.
|
|
67
|
+
* @param to - Where the child stands.
|
|
68
|
+
* @param color - Its hue.
|
|
69
|
+
* @param dashed - A join across branches.
|
|
70
|
+
* @param dim - Faint scenery.
|
|
71
|
+
*/
|
|
72
|
+
edge_add(fromId: string, toId: string, from: THREE.Vector3, to: THREE.Vector3, color: THREE.Color, dashed: boolean, dim?: boolean): void;
|
|
73
|
+
/** Brings every plain edge to its spheres, where they stand now. */
|
|
74
|
+
edges_follow(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Gives a sphere a new hue (its state changed); a lamp re-reads it.
|
|
77
|
+
*
|
|
78
|
+
* @param id - The node.
|
|
79
|
+
* @param color - Its hue now.
|
|
80
|
+
*/
|
|
81
|
+
recolor(id: string, color: THREE.Color): void;
|
|
82
|
+
/**
|
|
83
|
+
* Lights the node in hand from within and every other not at all.
|
|
84
|
+
*
|
|
85
|
+
* @param selectedId - The node in hand, or null.
|
|
86
|
+
*/
|
|
87
|
+
select(selectedId: string | null): void;
|
|
88
|
+
/**
|
|
89
|
+
* Lets one sphere go: its molecule is stars again.
|
|
90
|
+
*
|
|
91
|
+
* @param mesh - The sphere.
|
|
92
|
+
*/
|
|
93
|
+
remove(mesh: THREE.Mesh): void;
|
|
94
|
+
/** Forgets everything: the scene is being redrawn (its parent already cleared). */
|
|
95
|
+
clear(): void;
|
|
96
|
+
/** Lets the shared geometries go: the scene is done. */
|
|
97
|
+
dispose(): void;
|
|
98
|
+
}
|