Expand description
Fewer points with the same picture: thinning of unsorted lines, one marker per screen cell for dense scatter, and Ramer–Douglas–Peucker simplification of the screen polylines. The tolerances are below what a display can show.
Constants§
- LINE_
SPACING - Points of an unsorted line closer than this to the last drawn point are skipped.
- MARKER_
SPACING - Scatter markers keep one per square cell this fraction of their radius wide: a marker in an occupied cell overlaps the first one almost entirely, and the outline of a dense band of markers moves by at most 7 % of the radius.
- SIMPLIFY_
TOLERANCE - Vertices of a line closer than this (in points) to the straight path between their neighbors are dropped: invisible, and a smooth curve of thousands of samples tessellates as a few hundred vertices.
Functions§
- one_
per_ cell - One marker per
cell-sized square of the frame: the first point that lands in it. Unlikethin, a curve that retraces itself (the cycles of a voltammogram) draws its markers once. Points outside the frame (plus a cell) are skipped. - simplify
- Ramer–Douglas–Peucker on screen positions: keep the ends and every vertex farther
than
tolerancefrom the chord of the stretch it lies in. - thin
- Every point at least
spacingpoints (on screen) from the last one kept, plus the last point. Non-finite points are kept, so they still break the line.