Module

frontend/Stippling/stippleWorker

Web Worker implementation for stipple generation and distribution

View Source frontend/src/Stippling/stippleWorker.worker.ts, line 2

Classes

WorkerStipple
WorkerStipple

Members

Methods

# inner createRandomStipples(numStipples, maxX, maxY, sampleropt) → {Array.<WorkerStipple>}

Creates random stipples within bounds

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

View Source frontend/src/Stippling/stippleWorker.worker.ts, line 133

Array of randomly positioned stipples

Array.<WorkerStipple>

# inner fillStippleProperties(stipples, densityFunction) → {Array.<WorkerStipple>}

Normalizes stipple properties for visualization

Parameters:
Name Type Description
stipples Array.<WorkerStipple>

Stipples to process

densityFunction DensityFunction2D

Reference density function

View Source frontend/src/Stippling/stippleWorker.worker.ts, line 115

Processed stipples with normalized properties

Array.<WorkerStipple>

# inner handleStippleChange(stipples, voronoi, area, error) → {Object}

Handles stipple changes based on density thresholds

Parameters:
Name Type Description
stipples Array.<WorkerStipple>

Current stipples

voronoi Voronoi.<number>

Current Voronoi diagram

area number

Target area per stipple

error number

Error threshold

View Source frontend/src/Stippling/stippleWorker.worker.ts, line 84

Change status and updated stipples

Object

# inner splitCell(cell)

Splits a Voronoi cell into two points

Parameters:
Name Type Description
cell

View Source frontend/src/Stippling/stippleWorker.worker.ts, line 147

# async inner stippleDensityFunction(densityFunction, initialStippleRadius, initialErrorThreshold, thresholdConvergenceRate, maxIterations)

Main stippling algorithm Iteratively places and adjusts stipples based on density function

Parameters:
Name Type Description
densityFunction DensityFunction2D

Target density function

initialStippleRadius number

Starting radius for stipples

initialErrorThreshold number

Initial error tolerance

thresholdConvergenceRate number

Rate of error threshold increase

maxIterations number

Maximum number of iterations

View Source frontend/src/Stippling/stippleWorker.worker.ts, line 31