# new Stipple(x, y, densityopt, radiusopt)
Creates a new stipple point
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
number
|
X coordinate |
||
y |
number
|
Y coordinate |
||
density |
number
|
<optional> |
0.5 | Initial density value |
radius |
number
|
<optional> |
0.5 | Initial radius |
Classes
Members
# maxIterations
Maximum number of iterations for stipple placement
# stippleDebugDiv
Debug information display element
# static maxIterations
Maximum number of iterations for stipple placement
# static stippleDebugDiv
Debug information display element
Methods
# setPosition(x, y)
Updates the position of the stipple
Parameters:
Name | Type | Description |
---|---|---|
x |
number
|
New X coordinate |
y |
number
|
New Y coordinate |
# static createRandomStipples(numStipples, maxX, maxY, sampleropt) → {Array.<Stipple>}
Creates an array of randomly positioned stipples
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
numStipples |
number
|
Number of stipples to create |
||
maxX |
number
|
Maximum X coordinate |
||
maxY |
number
|
Maximum Y coordinate |
||
sampler |
function
|
<optional> |
d3.randomUniform | Random number generator |
Array of randomly positioned stipples
Array.<Stipple>
# async static stippleDensityFunctionWithWorker(densityFunction, initialStippleRadiusopt, initialErrorThresholdopt, thresholdConvergenceRateopt, max_iteropt, bufferHandleropt) → {Promise.<{stipples: Array.<Stipple>, voronoi: Voronoi.<number>}>}
Processes density function with a web worker for stipple placement
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
densityFunction |
DensityFunction2D
|
Density function to process |
||
initialStippleRadius |
number
|
<optional> |
2.0 | Initial radius for stipples |
initialErrorThreshold |
number
|
<optional> |
0.0 | Initial error threshold |
thresholdConvergenceRate |
number
|
<optional> |
0.01 | Rate of convergence |
max_iter |
number
|
<optional> |
100 | Maximum iterations |
bufferHandler |
BufferHandler
|
<optional> |
null | Optional buffer handler for updates |
Final stipple positions and Voronoi diagram
Promise.<{stipples: Array.<Stipple>, voronoi: Voronoi.<number>}>