Skip to content

Neural Network API

NeuralNetwork

Extends Effect.

Factory Function

typescript
createNeuralNetwork(config?: NeuralNetworkConfig)

Methods

See Effect for the full method reference: mount(), start(), pause(), resume(), configure(), withFade(), and destroy().


NeuralNetworkConfig

typescript
interface NeuralNetworkConfig {
    speed?: number;
    neurons?: number;
    color?: string;
    pulseColor?: string;
    connectionDistance?: number;
    scale?: number;
}
PropertyTypeDefaultDescription
speednumber1Animation speed multiplier, affects firing rate and pulse speed.
neuronsnumber16Number of neuron cells in the network.
colorstring'#4488ff'Color of dendrite arms and inter-cell connection threads.
pulseColorstring'#88ccff'Color of the glowing synaptic pulse particles.
connectionDistancenumber0Maximum distance in pixels for drawing connections between neurons. 0 auto-derives from canvas size.
scalenumber1Global scale factor for soma radii and arm thicknesses.