Skip to content
sigma.js sigma.js
v4.0.6 Docs Examples GitHub 12.2K

createDensitySplatProgram

createDensitySplatProgram<N, E, G>(nodes, options, coloring): WebGLLayerProgramType<N, E, G>

Defined in: packages/layer-webgl/src/density-splat-program/index.ts:22

Factory that creates a WebGL layer program class with built-in density splatting.

The splat pass renders each node as a smooth gaussian-like circle into an offscreen R32F texture using additive blending, producing a density field. The coloring pass then reads this density texture and maps it to colors via the provided fragment shader.

Subclasses (contours, heatmap, etc.) only need to provide the coloring strategy: a fragment shader that reads u_densityTexture and the uniforms to set.

N extends Attributes = Attributes

E extends Attributes = Attributes

G extends Attributes = Attributes

string[]

(node) => number

number

(ratio) => number

(programInfo) => void

WebGLLayerDefinition

(params, programInfo) => void

WebGLLayerProgramType<N, E, G>