Skip to content

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

flekschas added 5 commits May 29, 2023 16:25
Also updated a bunch of third party dependencies including KDBush from v3 to v4
Also fix an issue with `scatter.get('filteredPoints')`
@oskbor
Copy link

oskbor commented Jul 17, 2024

This would be a very helpful feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants