[FEATURE]: Please allow for the sizes of clusters within scattermaps to be based on their underlying values
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
I am currently working on a scattermap that has thousands of individual circles. The sizes of these circles are based on their underlying population, rather than a fixed value.
When the map is zoomed out quite a bit, these circles end up overlapping--thus making it harder to identify areas with particularly large populations. Therefore, I tried using the cluster feature to group circles together. However, it appears that the sizes of all circles within a given cluster can only be based on the numbers of circles in each cluster.
What I would love to see is the ability to set cluster sizes on an underlying variable (e.g. population). That way, a 5-region cluster with a population of 2 million would be twice as large as that of another 5-region cluster of 1 million. Since it's already possible to base single-marker sizes on a specified variable, I like to think that this wouldn't be too challenging to implement (though I could be wrong).
Here's a Codepen that shows a simplified version of my actual code. (It's based on Plotly's US-city dataset.) Note that all green circles (clusters) are the same size, whereas blue circles (markers) are based on cities' populations. I'd like for the green clusters' sizes to be based on the sum of the populations of all cities in their cluster.
(Note that, in this case, basing cluster sizes on the number of cities that they contain would not be ideal, since city sizes can vary widely.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodePen and the scattermap clustering behavior it demonstrates. Trace how marker sizes and cluster sizes are currently determined, then define how an underlying variable should be aggregated for each cluster; done means clusters can scale from that aggregate while existing marker and clustering behavior continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100