-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
tsatsuamable edited this page Apr 10, 2026
·
1 revision
Complete API documentation for Nemosyne v0.2.0.
Global namespace providing framework utilities.
| Method | Returns | Description |
|---|---|---|
quickStart(scene, options) |
Artefact |
Rapid visualization creation |
registerArtefact(name, Constructor) |
void |
Register custom artefact |
registerLayout(name, algorithm) |
void |
Register custom layout |
registerTransform(name, transform) |
void |
Register custom transform |
version |
string |
Framework version |
Nemosyne.config({
debug: false,
defaultColor: '#00d4aa',
animationEnabled: true,
performanceMode: 'auto' // 'auto' | 'high' | 'low'
});interface SceneManager {
init(container: HTMLElement, options?: SceneOptions): Promise<void>;
destroy(): void;
registerArtefact(spec: ArtefactSpec, data: DataPoint[]): Promise<Artefact>;
getArtefact(id: string): Artefact | undefined;
updateData(artefactId: string, newData: DataPoint[]): void;
removeArtefact(id: string): void;
setLayout(artefactId: string, layout: string, options?: LayoutOptions): void;
clear(): void;
exportScene(): SceneExport;
importScene(export: SceneExport): void;
}| Attribute | Type | Default | Description |
|---|---|---|---|
src |
string | '' |
URL to artefact spec JSON |
spec |
JSON | required | Inline specification |
dataset |
JSON | required | Inline dataset |
layout |
string | 'grid' |
Layout algorithm |
layout-options |
JSON | {} |
Layout-specific options |
animate |
boolean | true |
Enable entry animations |
interactive |
boolean | true |
Enable hover/click |
| Attribute | Type | Default | Description |
|---|---|---|---|
from |
selector | required | Source element |
to |
selector | required | Target element |
type |
string | 'line' |
Style: line, curve, tube, beam |
color |
string | '#00d4aa' |
Line color |
thickness |
number | 0.03 |
Line thickness |
animated |
boolean | false |
Flow animation |
Rows and columns with configurable spacing.
Complexity: O(n)
{
layout: 'grid',
'layout-options': JSON.stringify({
columns: 4,
spacing: 3,
offset: { x: 0, y: 0, z: 0 }
})
}Circular arrangement around center point.
Complexity: O(n)
{
layout: 'radial',
'layout-options': JSON.stringify({
radius: 5,
angleOffset: 0,
yOffset: 0
})
}Linear arrangement along X axis.
Complexity: O(n log n)
{
layout: 'timeline',
'layout-options': JSON.stringify({
spacing: 3,
yOffset: 0,
zOffset: 0
})
}Rising spiral pattern.
Complexity: O(n)
{
layout: 'spiral',
'layout-options': JSON.stringify({
radius: 5,
heightStep: 0.5,
rotations: 2
})
}Hierarchical arrangement for parent-child relationships.
Complexity: O(n)
{
layout: 'tree',
'layout-options': JSON.stringify({
levelHeight: 3,
siblingSpacing: 4
})
}Force-directed layout (simplified).
Complexity: O(n²)
{
layout: 'force',
'layout-options': JSON.stringify({
bounds: 10,
charge: -30,
linkDistance: 1
})
}interface ArtefactSpec {
id: string;
type?: string;
geometry: GeometrySpec;
material: MaterialSpec;
transforms?: TransformSpec[];
behaviours?: BehaviourSpec[];
labels?: LabelSpec;
connections?: 'auto' | ConnectionSpec[];
}
interface GeometrySpec {
type: 'sphere' | 'box' | 'cylinder' | 'octahedron' |
'dodecahedron' | 'icosahedron' | 'torus' | string;
radius?: number;
width?: number;
height?: number;
depth?: number;
}
interface MaterialSpec {
properties: {
color?: string;
emissive?: string;
emissiveIntensity?: number;
metalness?: number;
roughness?: number;
opacity?: number;
transparent?: boolean;
};
}
interface TransformSpec {
property: 'position' | 'rotation' | 'scale' | 'color';
$data?: string;
$range?: [number, number];
$domain?: [number, number];
$map?: string;
$calculate?: (value: any) => any;
}
interface BehaviourSpec {
trigger: 'hover' | 'click' | 'idle' | 'data-update' | string;
action: 'glow' | 'scale' | 'drill' | 'pulse' | string;
params?: Record<string, any>;
}| Event | Detail | Description |
|---|---|---|
nemosyne-loaded |
{ count, layout } |
Artefacts rendered |
nemosyne-error |
{ error } |
Loading failed |
point-selected |
{ point } |
Node clicked |
time-navigated |
{ currentTime, direction } |
Temporal navigation |
| Event | Detail | Description |
|---|---|---|
collision |
{ otherBody, contactPoints, impulse } |
Physics collision |
body-sleep |
{ nodeId } |
Body went to sleep |
body-wake |
{ nodeId } |
Body woke up |
{
property: 'scale',
$data: 'value',
$range: [0.5, 2.0],
$domain: [0, 100]
}{
property: 'scale',
$data: 'value',
$map: 'log',
$base: 10
}{
property: 'color',
$data: 'category',
$map: 'category10'
}{
property: 'position.x',
$data: 'timestamp',
$map: 'time',
$range: [0, 10]
}| Trigger | Action | Parameters |
|---|---|---|
hover |
glow |
{ intensity } |
hover |
scale |
{ factor } |
hover-leave |
reset |
{} |
click |
drill |
{ target } |
click |
scale |
{ factor, duration } |
idle |
pulse |
{ speed, min, max } |
idle |
rotate |
{ speed, axis } |
data-update |
flash |
{ color, duration } |
Nemosyne.registerBehaviour('entangled', {
attach: (entity, config, data) => {
// Attach logic
return () => {
// Cleanup function
};
}
});