Skip to content

Function: writeFillGradient() ​

ts
function writeFillGradient(positions, vertexCount, gradient, out?): Float32Array;

Experimental

Per-vertex gradient coordinates (2 floats per vertex) for the fill shader, from the absolute triangulated positions (xyz per vertex). Linear: (t, 0) with t = (c − start) / (stop − start) along the gradient axis. Radial: the position normalized to the bounding box of all vertices ([0, 1]²); the shader measures t from the box center, so the gradient is an ellipse spanning the box (SVG objectBoundingBox semantics, as Plotly draws it). Both are affine in the position, so per-vertex interpolation is exact and zoom/pan never rewrite them.

Parameters ​

ParameterType
positionsFloat64Array
vertexCountnumber
gradientFillGradientGeometry
out?Float32Array<ArrayBufferLike>

Returns ​

Float32Array

Released under the MIT License.