This PR introduces an option to dynamically pick the point size
Description
What was changed in this pull request?
With this PR the user can set thesizeBy to density (similar to the opacityBy) which tell regl-scatterplot to automatically pick a point size based on the number of points in the view.
To have better control over the point size, this PR also adds the following three properties:
pointSizeMin to set the minimum point size (this property is ignored unless sizeBy is set to density)
pointSizeMax to set the maximum point size (this property is ignored unless sizeBy is set to density)
fillTarget which controls the proportion of how much the canvas should be filled. E.g., 0.33 means that 33% of the canvas should be filled. This fill target determines at which size and opacity points should be drawn.
Why is it necessary?
Picking the right point size can be as hard as picking the right opacity. This PR makes this easier.
Checklist
[ ] Provided a concise title as a semantic commit message (e.g. "fix: correctly handle undefined properties")
[ ] CHANGELOG.md updated
[ ] Tests added or updated
[ ] Documentation in README.md added or updated
[ ] Example(s) added or updated
[ ] Screenshot, gif, or video attached for visual changes
This PR introduces an option to dynamically pick the point size
Description
With this PR the user can set the
sizeBy
todensity
(similar to theopacityBy
) which tell regl-scatterplot to automatically pick a point size based on the number of points in the view.To have better control over the point size, this PR also adds the following three properties:
pointSizeMin
to set the minimum point size (this property is ignored unlesssizeBy
is set todensity
)pointSizeMax
to set the maximum point size (this property is ignored unlesssizeBy
is set todensity
)fillTarget
which controls the proportion of how much the canvas should be filled. E.g.,0.33
means that 33% of the canvas should be filled. This fill target determines at which size and opacity points should be drawn.Picking the right point size can be as hard as picking the right opacity. This PR makes this easier.
Checklist
CHANGELOG.md
updatedREADME.md
added or updated