Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: density-based point size #143

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

flekschas
Copy link
Owner

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:

  1. pointSizeMin to set the minimum point size (this property is ignored unless sizeBy is set to density)
  2. pointSizeMax to set the maximum point size (this property is ignored unless sizeBy is set to density)
  3. 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
Also updated a bunch of third party dependencies including KDBush from v3 to v4
Also fix an issue with `scatter.get('filteredPoints')`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant