@naniteninja/trait-visual 1.0.4 → 1.0.7
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 +42 -183
- package/fesm2022/naniteninja-trait-visual.mjs +2620 -3365
- package/fesm2022/naniteninja-trait-visual.mjs.map +1 -1
- package/lib/data/bundled-textures.generated.d.ts +3 -0
- package/lib/data/nodes.data.d.ts +3 -8
- package/lib/data/shader.d.ts +2 -0
- package/lib/data/shaders/customPaths.glsl.d.ts +1 -0
- package/lib/data/shaders/dyingStarPhase.glsl.d.ts +1 -0
- package/lib/data/shaders/galaxyPhase.glsl.d.ts +1 -0
- package/lib/data/shaders/nebulaPhase.glsl.d.ts +1 -0
- package/lib/objects/Blackhole.d.ts +3 -3
- package/lib/objects/Cluster.d.ts +8 -1
- package/lib/objects/GalaxyStars.d.ts +1 -0
- package/lib/services/black-hole-particle-field.d.ts +26 -2
- package/lib/services/galaxyPointCloud.d.ts +10 -0
- package/lib/services/node-actions.d.ts +2 -1
- package/lib/trait-visual-canvas/trait-visual-canvas.component.d.ts +220 -0
- package/lib/{app.types.d.ts → types/app.types.d.ts} +101 -1
- package/lib/types/canvas-config.d.ts +181 -0
- package/lib/types/node-info.type.d.ts +17 -0
- package/lib/types/particle-field.types.d.ts +2 -0
- package/lib/utils/createShaderMaterial.d.ts +8 -0
- package/lib/utils/createUniforms.d.ts +2 -0
- package/lib/utils/debug-ingest.constants.d.ts +2 -0
- package/lib/utils/debug-ingest.d.ts +12 -0
- package/lib/utils/galaxyGeometryForPhase.d.ts +1 -0
- package/lib/utils/window.util.d.ts +2 -2
- package/package.json +7 -24
- package/public-api.d.ts +9 -11
- package/lib/config-sidenav/config-sidenav.component.d.ts +0 -30
- package/lib/trait-visual.component.d.ts +0 -85
- package/lib/utils/on-right-click.util.d.ts +0 -4
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { INodeData } from './app.types';
|
|
2
|
+
import type { ISimulationConfigs } from './app.types';
|
|
3
|
+
/**
|
|
4
|
+
* Payload for a declarative command sent to the canvas.
|
|
5
|
+
* This is the discriminated union of all possible actions; `CanvasCommand` adds the `seq` field.
|
|
6
|
+
*/
|
|
7
|
+
export type CanvasCommandPayload = {
|
|
8
|
+
action: 'rotateLeft';
|
|
9
|
+
} | {
|
|
10
|
+
action: 'rotateRight';
|
|
11
|
+
} | {
|
|
12
|
+
action: 'panUp';
|
|
13
|
+
} | {
|
|
14
|
+
action: 'panDown';
|
|
15
|
+
} | {
|
|
16
|
+
action: 'panLeft';
|
|
17
|
+
} | {
|
|
18
|
+
action: 'panRight';
|
|
19
|
+
} | {
|
|
20
|
+
action: 'zoomIn';
|
|
21
|
+
} | {
|
|
22
|
+
action: 'zoomOut';
|
|
23
|
+
} | {
|
|
24
|
+
action: 'toggleCameraLock';
|
|
25
|
+
} | {
|
|
26
|
+
action: 'addNode';
|
|
27
|
+
} | {
|
|
28
|
+
action: 'removeNode';
|
|
29
|
+
nodeId: number;
|
|
30
|
+
} | {
|
|
31
|
+
action: 'setCentral';
|
|
32
|
+
nodeId: number;
|
|
33
|
+
} | {
|
|
34
|
+
action: 'setNodeColor';
|
|
35
|
+
nodeId: number;
|
|
36
|
+
color: string;
|
|
37
|
+
} | {
|
|
38
|
+
action: 'updateAttribute';
|
|
39
|
+
nodeId: number;
|
|
40
|
+
attrIndex: number;
|
|
41
|
+
value: number;
|
|
42
|
+
} | {
|
|
43
|
+
action: 'updatePreference';
|
|
44
|
+
nodeId: number;
|
|
45
|
+
prefIndex: number;
|
|
46
|
+
value: number;
|
|
47
|
+
} | {
|
|
48
|
+
action: 'setTraitCount';
|
|
49
|
+
count: number;
|
|
50
|
+
} | {
|
|
51
|
+
action: 'setNodeData';
|
|
52
|
+
nodeData: INodeData[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Declarative command sent to the canvas via the `command` input.
|
|
56
|
+
* Bump `seq` each time to trigger Angular change detection, even for repeated identical actions.
|
|
57
|
+
*/
|
|
58
|
+
export type CanvasCommand = CanvasCommandPayload & {
|
|
59
|
+
seq: number;
|
|
60
|
+
};
|
|
61
|
+
/** Default values used when config or a property is missing. Single source of truth for canvas and sidenav display fallbacks. */
|
|
62
|
+
export declare const TRAIT_VISUAL_CANVAS_DEFAULTS: {
|
|
63
|
+
readonly selectedPreset: "Maximum Diversity";
|
|
64
|
+
readonly galaxyParticleSize: 1.5;
|
|
65
|
+
readonly particleFieldCloudSize: 0.35;
|
|
66
|
+
readonly nodeSizeScale: 1.05;
|
|
67
|
+
readonly particleSizeScale: 1;
|
|
68
|
+
readonly particleDepth: 1.06;
|
|
69
|
+
readonly lightBlueParticleSizeScale: 1.5;
|
|
70
|
+
readonly lightBlueParticleDepth: 1.11;
|
|
71
|
+
readonly nodeHaloParticleSizeScale: 1.1;
|
|
72
|
+
readonly nodeHaloInfluenceScale: 1.55;
|
|
73
|
+
readonly particleMovementSmoothing: 1;
|
|
74
|
+
readonly glowIntensity: 0;
|
|
75
|
+
readonly interactionCap: 4;
|
|
76
|
+
readonly galaxyParticleCount: 8192;
|
|
77
|
+
readonly auraParticleCount: 60;
|
|
78
|
+
readonly sphereSegments: 16;
|
|
79
|
+
readonly pixelRatioCap: 1.5;
|
|
80
|
+
readonly defaultZoomLevel: 1.75;
|
|
81
|
+
readonly smbhAttraction: 3.7;
|
|
82
|
+
readonly simulationSpeed: 3.25;
|
|
83
|
+
readonly blackholeRepulsion: 1;
|
|
84
|
+
readonly pairwiseRepulsionMain: 20;
|
|
85
|
+
readonly pairwiseRepulsionSecondary: 55;
|
|
86
|
+
readonly pairwiseRepulsionMultiplier: 2.7;
|
|
87
|
+
readonly dissimilarityRepulsionExponent: 2.25;
|
|
88
|
+
readonly collisionDamping: 0.3;
|
|
89
|
+
readonly minDistanceWidths: 0.65;
|
|
90
|
+
readonly maxDistanceWidths: 5;
|
|
91
|
+
};
|
|
92
|
+
/** Configuration passed into TraitVisualCanvasComponent. All canvas behavior is driven by this. */
|
|
93
|
+
export interface ITraitVisualCanvasConfig {
|
|
94
|
+
/** Node data for the cluster. If not provided, library default is used. */
|
|
95
|
+
nodeData?: INodeData[];
|
|
96
|
+
attributeWeights?: number[];
|
|
97
|
+
preferenceWeights?: number[];
|
|
98
|
+
simulation?: Partial<ISimulationConfigs>;
|
|
99
|
+
/** Background color (hex). */
|
|
100
|
+
backgroundColor?: string;
|
|
101
|
+
primaryColor?: string;
|
|
102
|
+
secondaryColor?: string;
|
|
103
|
+
defaultZoomLevel?: number;
|
|
104
|
+
/** Simulation/repulsion params (mirror of simulation.blackhole etc.). */
|
|
105
|
+
smbhAttraction?: number;
|
|
106
|
+
blackholeRepulsion?: number;
|
|
107
|
+
pairwiseRepulsionMain?: number;
|
|
108
|
+
pairwiseRepulsionSecondary?: number;
|
|
109
|
+
pairwiseRepulsionMultiplier?: number;
|
|
110
|
+
dissimilarityRepulsionExponent?: number;
|
|
111
|
+
/** Velocity retention after collision (0 = fully absorb, 1 = elastic bounce). Default 0.3. */
|
|
112
|
+
collisionDamping?: number;
|
|
113
|
+
minDistanceWidths?: number;
|
|
114
|
+
maxDistanceWidths?: number;
|
|
115
|
+
simulationSpeed?: number;
|
|
116
|
+
particleSizeScale?: number;
|
|
117
|
+
particleDepth?: number;
|
|
118
|
+
/** Light blue (central/SMBH) particle aura size scale; default 1. */
|
|
119
|
+
lightBlueParticleSizeScale?: number;
|
|
120
|
+
/** Light blue (central/SMBH) particle depth (0.3–1.05, 1 = surface). */
|
|
121
|
+
lightBlueParticleDepth?: number;
|
|
122
|
+
/** Galaxy/background particle field point size (shader uniform; default 2.6). */
|
|
123
|
+
galaxyParticleSize?: number;
|
|
124
|
+
/** Scale for entire particle field cloud (default 1, typical range 0.25–3). */
|
|
125
|
+
particleFieldCloudSize?: number;
|
|
126
|
+
/** Scale factor for all node spheres (BHs and SMBH); default 1, range typically 0.5–2. */
|
|
127
|
+
nodeSizeScale?: number;
|
|
128
|
+
/** Size scale for galaxy (field) particles when pulled onto nodes (halo); default 2, range 0.2–5. */
|
|
129
|
+
nodeHaloParticleSizeScale?: number;
|
|
130
|
+
/** Influence radius scale for node halo (how far from node the field particles are pulled); default 1, range 0.3–2. */
|
|
131
|
+
nodeHaloInfluenceScale?: number;
|
|
132
|
+
/** Particle movement smoothing (0.05–1): anchor lerp per frame; lower = smoother. Default 0.2. */
|
|
133
|
+
particleMovementSmoothing?: number;
|
|
134
|
+
/** Galaxy glow intensity (superScale for glow pass); 0 = off, 2 = default bloom. Range 0–5. */
|
|
135
|
+
glowIntensity?: number;
|
|
136
|
+
/** Max galaxy-particle interactions in shader loop; fewer = less GPU work. Range 1–30, default 8. */
|
|
137
|
+
interactionCap?: number;
|
|
138
|
+
/** Galaxy point cloud particle count; higher = richer field, more GPU cost. 8192 | 16384 | 32768. */
|
|
139
|
+
galaxyParticleCount?: number;
|
|
140
|
+
/** Particles per node aura; fewer = less GPU work per node. Range 20–400, default 200. */
|
|
141
|
+
auraParticleCount?: number;
|
|
142
|
+
/** Sphere geometry segments for node meshes; lower = cheaper. Range 8–48, default 24. */
|
|
143
|
+
sphereSegments?: number;
|
|
144
|
+
/** Device-pixel-ratio cap for the renderer; lower = smaller render target. Range 0.5–3, default 2. */
|
|
145
|
+
pixelRatioCap?: number;
|
|
146
|
+
/** Base URL for textures (scale-texture.png, color-tiles.png, ani-tiles.exr). */
|
|
147
|
+
assetsBaseUrl?: string;
|
|
148
|
+
}
|
|
149
|
+
/** GPU performance stats emitted by the canvas component for monitoring. */
|
|
150
|
+
export interface IPerfStats {
|
|
151
|
+
/** Frames per second (averaged over emission interval). */
|
|
152
|
+
fps: number;
|
|
153
|
+
/** Last frame time in milliseconds. */
|
|
154
|
+
frameTimeMs: number;
|
|
155
|
+
/** Draw calls in the last frame. */
|
|
156
|
+
drawCalls: number;
|
|
157
|
+
/** Points rendered in the last frame. */
|
|
158
|
+
points: number;
|
|
159
|
+
/** Triangles rendered in the last frame. */
|
|
160
|
+
triangles: number;
|
|
161
|
+
/** Geometries currently in GPU memory. */
|
|
162
|
+
geometries: number;
|
|
163
|
+
/** Textures currently in GPU memory. */
|
|
164
|
+
textures: number;
|
|
165
|
+
}
|
|
166
|
+
/** Payload emitted on frameRendered for snapshot recording. */
|
|
167
|
+
export interface ISnapshotPayload {
|
|
168
|
+
cluster: {
|
|
169
|
+
blackholes: Array<{
|
|
170
|
+
position: {
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
z: number;
|
|
174
|
+
};
|
|
175
|
+
userData: Record<string, unknown>;
|
|
176
|
+
isSupermassiveBlackhole: boolean;
|
|
177
|
+
}>;
|
|
178
|
+
} | null;
|
|
179
|
+
attributeWeights: number[];
|
|
180
|
+
simulationSpeed?: number;
|
|
181
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plain-data representation of a node, emitted via component outputs.
|
|
3
|
+
* Consumers should use this instead of internal Blackhole/Cluster classes.
|
|
4
|
+
*/
|
|
5
|
+
export interface INodeInfo {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
isSupermassiveBlackhole: boolean;
|
|
9
|
+
color: string;
|
|
10
|
+
position: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
z: number;
|
|
14
|
+
};
|
|
15
|
+
attributes: number[];
|
|
16
|
+
preferences: number[];
|
|
17
|
+
}
|
|
@@ -10,6 +10,8 @@ export interface IParticleFieldOptions {
|
|
|
10
10
|
surfaceRadiusMin?: number;
|
|
11
11
|
surfaceRadiusMax?: number;
|
|
12
12
|
rimMinShellFactor?: number;
|
|
13
|
+
/** Anchor smoothing (0–1): lerp factor per frame toward node position; lower = smoother. Default 0.2. */
|
|
14
|
+
anchorSmooth?: number;
|
|
13
15
|
}
|
|
14
16
|
export interface IFlowParticle {
|
|
15
17
|
type: 'topCurve' | 'bottomCurve' | 'orbit' | 'topCap' | 'bottomCap' | 'surface';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
interface CreateMaterialOptions {
|
|
3
|
+
vertexShader: string;
|
|
4
|
+
fragmentShader: string;
|
|
5
|
+
uniforms: Record<string, THREE.IUniform>;
|
|
6
|
+
}
|
|
7
|
+
export declare function createShaderMaterial({ vertexShader, fragmentShader, uniforms }: CreateMaterialOptions): THREE.RawShaderMaterial;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IDebugIngestPayload {
|
|
2
|
+
hypothesisId: string;
|
|
3
|
+
location: string;
|
|
4
|
+
message: string;
|
|
5
|
+
data: Record<string, unknown>;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Sends a payload to the debug ingest endpoint when ?debug=1 is in the URL.
|
|
10
|
+
* Uses RxJS (no Promises). No-op when debug is not enabled.
|
|
11
|
+
*/
|
|
12
|
+
export declare function logDebugIngest(payload: IDebugIngestPayload, searchOverride?: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getGalaxyGeometryForPhase(count: number, extent: number): Float32Array<ArrayBufferLike>;
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Use instead of (window as any)?.location?.search to satisfy strict typing.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getWindowLocationSearch(): string;
|
|
6
|
-
/** True when URL has debug=1 (enables optional ingest logging). */
|
|
7
|
-
export declare function isDebugIngestEnabled(): boolean;
|
|
6
|
+
/** True when URL has debug=1 (enables optional ingest logging). @param searchOverride - for tests only; when set, used instead of window.location.search */
|
|
7
|
+
export declare function isDebugIngestEnabled(searchOverride?: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naniteninja/trait-visual",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Angular
|
|
5
|
-
"keywords": [
|
|
6
|
-
"angular",
|
|
7
|
-
"three.js",
|
|
8
|
-
"visualization",
|
|
9
|
-
"3d",
|
|
10
|
-
"traits",
|
|
11
|
-
"pca",
|
|
12
|
-
"personality",
|
|
13
|
-
"test"
|
|
14
|
-
],
|
|
15
|
-
"author": "naniteninja",
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"publishConfig": {
|
|
18
|
-
"registry": "https://registry.npmjs.org/",
|
|
19
|
-
"access": "restricted"
|
|
20
|
-
},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "https://github.com/naniteninja/trait-visual.git"
|
|
24
|
-
},
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "Angular 3D trait visualization canvas (Three.js)",
|
|
25
5
|
"peerDependencies": {
|
|
26
6
|
"@angular/common": "^20.0.0",
|
|
27
7
|
"@angular/core": "^20.0.0"
|
|
28
8
|
},
|
|
29
9
|
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0",
|
|
30
11
|
"three": "^0.174.0",
|
|
31
|
-
"ml-pca": "^4.1.1"
|
|
32
|
-
"tslib": "^2.3.0"
|
|
12
|
+
"ml-pca": "^4.1.1"
|
|
33
13
|
},
|
|
34
14
|
"sideEffects": false,
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
35
18
|
"module": "fesm2022/naniteninja-trait-visual.mjs",
|
|
36
19
|
"typings": "index.d.ts",
|
|
37
20
|
"exports": {
|
package/public-api.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
1
|
+
export { TraitVisualCanvasComponent } from './lib/trait-visual-canvas/trait-visual-canvas.component';
|
|
2
|
+
export type { ITraitVisualCanvasConfig, ISnapshotPayload, IPerfStats, CanvasCommand, CanvasCommandPayload, } from './lib/types/canvas-config';
|
|
3
|
+
export { TRAIT_VISUAL_CANVAS_DEFAULTS } from './lib/types/canvas-config';
|
|
4
|
+
export type { INodeData, IHumanAttributes, IBlackholeUserData, ITraitVisualConfigState, ConfigChangePayload, IPresetConfig, ISimulationConfigs, } from './lib/types/app.types';
|
|
5
|
+
export type { INodeInfo } from './lib/types/node-info.type';
|
|
6
|
+
/** @deprecated Use INodeInfo for output event types instead of Blackhole instances. */
|
|
5
7
|
export { Blackhole } from './lib/objects/Blackhole';
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export {
|
|
9
|
-
export { BlackHoleParticleField } from './lib/services/black-hole-particle-field';
|
|
10
|
-
export { handleRightClick } from './lib/utils/on-right-click.util';
|
|
11
|
-
export { getWindowLocationSearch } from './lib/utils/window.util';
|
|
12
|
-
export { dynamicCounts, updateCounts, attributeWeights, nodeData } from './lib/data/nodes.data';
|
|
8
|
+
/** @deprecated Use INodeInfo for output event types instead of Cluster/Blackhole instances. */
|
|
9
|
+
export { Cluster } from './lib/objects/Cluster';
|
|
10
|
+
export { nodeData as defaultNodeData, attributeWeights } from './lib/data/nodes.data';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import type { ITraitVisualConfigState, ConfigChangePayload, INodeData } from '../app.types';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ConfigSidenavComponent {
|
|
5
|
-
config: ITraitVisualConfigState;
|
|
6
|
-
open: boolean;
|
|
7
|
-
configChange: EventEmitter<ConfigChangePayload>;
|
|
8
|
-
/** Active tab: 'docs' shows documentation, 'configs' shows configuration UI. */
|
|
9
|
-
activeTab: 'docs' | 'configs';
|
|
10
|
-
setActiveTab(tab: 'docs' | 'configs'): void;
|
|
11
|
-
get centralNode(): INodeData | null;
|
|
12
|
-
get nonSupermassiveBlackholeNodes(): INodeData[];
|
|
13
|
-
traitCount(): number;
|
|
14
|
-
centralPrefsArray(): number[];
|
|
15
|
-
nodeAttrsArray(node: INodeData): number[];
|
|
16
|
-
onPresetChange(value: string): void;
|
|
17
|
-
onWeightChange(index: number, value: number): void;
|
|
18
|
-
onPrefWeightChange(index: number, value: number): void;
|
|
19
|
-
onSimulationSpeedChange(value: number): void;
|
|
20
|
-
onBlackholeRepulsionChange(value: number): void;
|
|
21
|
-
onTraitCountChange(count: number): void;
|
|
22
|
-
onCentralPreferenceChange(index: number, value: number): void;
|
|
23
|
-
onNodeAttributeChange(nodeId: number, attrIndex: number, value: number): void;
|
|
24
|
-
onAddNode(): void;
|
|
25
|
-
onRemoveNode(nodeId: number): void;
|
|
26
|
-
onShowContextMenuChange(value: boolean): void;
|
|
27
|
-
onDefaultZoomLevelChange(value: number): void;
|
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigSidenavComponent, never>;
|
|
29
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigSidenavComponent, "tv-config-sidenav", never, { "config": { "alias": "config"; "required": false; }; "open": { "alias": "open"; "required": false; }; }, { "configChange": "configChange"; }, never, ["[config-appearance]", "[config-simulation-extra]"], true, never>;
|
|
30
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, OnInit, AfterViewInit, OnDestroy, Renderer2, NgZone, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import * as THREE from 'three';
|
|
3
|
-
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
4
|
-
import { INodeData, ISimulationConfigs } from './app.types';
|
|
5
|
-
import { Cluster } from './objects/Cluster';
|
|
6
|
-
import { Blackhole } from './objects/Blackhole';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class TraitVisualComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges {
|
|
9
|
-
private renderer2;
|
|
10
|
-
private ngZone;
|
|
11
|
-
canvasRef: ElementRef;
|
|
12
|
-
nodeData: INodeData[];
|
|
13
|
-
attributeWeights: number[];
|
|
14
|
-
preferenceWeights: number[];
|
|
15
|
-
attributeCount?: number;
|
|
16
|
-
preferenceCount?: number;
|
|
17
|
-
simulationOptions?: Partial<ISimulationConfigs>;
|
|
18
|
-
/** When true, right-click on a node can show the context menu (when implemented). Default false. */
|
|
19
|
-
showContextMenu: boolean;
|
|
20
|
-
/** Default zoom level: multiplier on initial camera distance (1 = normal, > 1 = zoom out more). Default 1.25. */
|
|
21
|
-
defaultZoomLevel: number;
|
|
22
|
-
/** Emits when the user selects a blackhole (e.g. via right-click). Host app can use this for context menu or sidenav. */
|
|
23
|
-
blackholeSelected: EventEmitter<Blackhole | null>;
|
|
24
|
-
scene: THREE.Scene;
|
|
25
|
-
camera: THREE.PerspectiveCamera;
|
|
26
|
-
renderer: THREE.WebGLRenderer;
|
|
27
|
-
controls: OrbitControls;
|
|
28
|
-
raycaster: THREE.Raycaster;
|
|
29
|
-
mouse: THREE.Vector2;
|
|
30
|
-
cluster: Cluster;
|
|
31
|
-
selectedNode: Blackhole | null;
|
|
32
|
-
draggingNode: Blackhole | null;
|
|
33
|
-
dragPlane: THREE.Plane;
|
|
34
|
-
dragOffset: THREE.Vector3;
|
|
35
|
-
newNodeCounter: number;
|
|
36
|
-
isCameraLocked: boolean;
|
|
37
|
-
private nodeAuras;
|
|
38
|
-
private starFieldNear;
|
|
39
|
-
private starFieldFar;
|
|
40
|
-
private starTexture;
|
|
41
|
-
private dustField;
|
|
42
|
-
private readonly pointerPitchAxis;
|
|
43
|
-
private readonly pointerYawAxis;
|
|
44
|
-
private pointerPitchCurrent;
|
|
45
|
-
private pointerPitchTarget;
|
|
46
|
-
private pointerYawCurrent;
|
|
47
|
-
private pointerYawTarget;
|
|
48
|
-
private pointerYawAccumulated;
|
|
49
|
-
private readonly pointerOffset;
|
|
50
|
-
private readonly pointerPitchMax;
|
|
51
|
-
private readonly pointerYawMax;
|
|
52
|
-
private readonly pointerYawSpeed;
|
|
53
|
-
private readonly pointerPitchDamping;
|
|
54
|
-
private readonly pointerYawDamping;
|
|
55
|
-
/** Reused buffer for dust-field attractors (avoids per-frame allocations). */
|
|
56
|
-
private readonly _attractorsBuffer;
|
|
57
|
-
private readonly _centerFallback;
|
|
58
|
-
constructor(renderer2: Renderer2, ngZone: NgZone);
|
|
59
|
-
ngOnInit(): void;
|
|
60
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
61
|
-
/** Apply defaultZoomLevel to camera: same direction from target, scaled distance. */
|
|
62
|
-
private applyDefaultZoomLevel;
|
|
63
|
-
ngAfterViewInit(): void;
|
|
64
|
-
ngOnDestroy(): void;
|
|
65
|
-
currentSupermassiveBlackhole(): Blackhole | null;
|
|
66
|
-
nonSupermassiveBlackholes(): Blackhole[];
|
|
67
|
-
private syncNodeWeightGlobals;
|
|
68
|
-
private initScene;
|
|
69
|
-
private loadNodes;
|
|
70
|
-
private onWindowResize;
|
|
71
|
-
private onRightClick;
|
|
72
|
-
private onMouseMove;
|
|
73
|
-
private onDragStart;
|
|
74
|
-
private onDragMove;
|
|
75
|
-
private onDragEnd;
|
|
76
|
-
private onCanvasLeave;
|
|
77
|
-
private resetPointerPitch;
|
|
78
|
-
private updateCameraOrbitFromPointer;
|
|
79
|
-
private animate;
|
|
80
|
-
private ensureNodeAuras;
|
|
81
|
-
private createStarField;
|
|
82
|
-
private getStarTexture;
|
|
83
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TraitVisualComponent, never>;
|
|
84
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TraitVisualComponent, "tv-trait-visual", never, { "nodeData": { "alias": "nodeData"; "required": false; }; "attributeWeights": { "alias": "attributeWeights"; "required": false; }; "preferenceWeights": { "alias": "preferenceWeights"; "required": false; }; "attributeCount": { "alias": "attributeCount"; "required": false; }; "preferenceCount": { "alias": "preferenceCount"; "required": false; }; "simulationOptions": { "alias": "simulationOptions"; "required": false; }; "showContextMenu": { "alias": "showContextMenu"; "required": false; }; "defaultZoomLevel": { "alias": "defaultZoomLevel"; "required": false; }; }, { "blackholeSelected": "blackholeSelected"; }, never, never, true, never>;
|
|
85
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Blackhole } from '../objects/Blackhole';
|
|
3
|
-
import { ElementRef, Renderer2 } from '@angular/core';
|
|
4
|
-
export declare function handleRightClick(event: MouseEvent, mouse: THREE.Vector2, camera: THREE.Camera, raycaster: THREE.Raycaster, cluster: THREE.Object3D, contextMenuRef: ElementRef, renderer2: Renderer2, setSelectedNode: (blackhole: Blackhole) => void, canvas?: HTMLCanvasElement | null, containerEl?: HTMLElement | null): void;
|