VisualizerCayleyForceSimulator

VisualizerCayleyForceSimulator

Specialized 3D Force Simulator implementing a physics-based layout algorithm with simulated annealing. It's designed to position nodes and edges of a Cayley graph in 3D space, applying forces like repulsion, spring forces, and cycle-specific planar/convexity forces.

Constructor

new VisualizerCayleyForceSimulator(nodes, constraints, generators, genMeta, config)

Source:
Parameters:
Name Type Description
nodes Array.<object>

An array of node objects, each with 'id', 'x', 'y', 'z', 'vx', 'vy', 'vz' properties.

constraints object

An object containing arrays of 'edges', 'chords', 'cycles', and 'angleTriplets'.

generators Array.<number>

An array of generator IDs.

genMeta Map.<number, object>

A map from generator ID to its metadata (e.g., color, order).

config _CayleyGraphConfig

The physics configuration for the simulator.

Classes

VisualizerCayleyForceSimulator

Methods

getPlotlyFrame() → {Object}

Description:
  • Generates a Plotly-compatible data frame (traces and layout) representing the current state of the Cayley graph. Includes 3D scatter plots for nodes, lines for edges, and cones for directed edges.

Source:
Returns:

An object containing Plotly trace data and layout configuration.

Type
Object

tick(jitterFactoropt)

Description:
  • Executes one step of the physics simulation. Applies forces, integrates velocities, and updates node positions.

Source:
Parameters:
Name Type Attributes Default Description
jitterFactor number <optional>
0

The magnitude of random noise to apply to node positions, used for simulated annealing during warmup.

warmup(iterationsopt)

Description:
  • Runs the simulation for a specified number of iterations with simulated annealing. The jitterFactor decays linearly during the first 90% of iterations, then remains at 0 for the last 10%.

Source:
Parameters:
Name Type Attributes Default Description
iterations number <optional>
2000

The total number of simulation ticks to run during the warmup phase.