plotly / plotly/plotly.js

[FEATURE]: Please allow for the sizes of clusters within scattermaps to be based on their underlying values

未关闭
#7,741 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature
主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

描述

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.)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的 CodePen 以及它演示的 scattermap 聚类行为开始。追踪当前如何确定 marker 大小和 cluster 大小,然后定义如何为每个 cluster 聚合一个底层变量;完成标准是 cluster 可以根据该聚合值进行缩放,同时现有的 marker 和聚类行为仍能正常工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
data-visualization
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。