组件存在的问题 #4603
Aarebecca posted onGitHub
现有问题
- 非
color
通道scale
创建的组件没有颜色信息(填充颜色、透明度等) 例如 moviesPointBin、housePricePointShapes 中通过size
通道的比例尺创建的图例没有颜色,期望图例颜色和节点颜色保持一致 对于这类情况,应当是需要创建一个常数比例尺 (Constant) 来映射到color
通道,并结合size
通道的比例尺合并为单一连续图例组件进行展示。<img width="300" alt="image" src="https://user-images.githubusercontent.com/25787943/215530797-efa7976e-432f-46f0-9c3f-a7b0bebc1496.png"> <img width="400" alt="image" src="https://user-images.githubusercontent.com/25787943/215538549-f3194a77-e286-4ae2-940d-d320b8bd2b90.png"> 同理的还有:
- temperaturesPointSequential ,需要创建
opacity
通道的比例尺。<img width="600" alt="image" src="https://user-images.githubusercontent.com/25787943/215532154-25174391-ba0e-479c-9a7d-7496c485e71c.png">
非
shape
通道scale
创建的组件没有形状信息,例如 athletesRectBin 中节点上矩形的,但图例并不能获取到相关信息。 同样是期望有一个常数比例尺来映射到shape
通道。<img width="600" alt="image" src="https://user-images.githubusercontent.com/25787943/215535409-74c6ffba-5793-40ba-ab9d-58b5172b4545.png">
多通道
scale
需要合并为一个组件表达 例如 irisPointShapes,其category
同时映射到了shape
和color
通道,在当前逻辑下,分别生成了两个图例,而实际期望是将这两个通道合并为一个图例进行表达。<img width="800" alt="image" src="https://user-images.githubusercontent.com/25787943/215539322-b5a85fd3-bae4-41b4-8d24-a04ab90cba13.png">
思考
但做多通道 scale
合并之前,需要思考清楚,组件推断需要从过去 scales
、coordinates
到 多个组件类型
的多对多映射转变为多对一的映射关系。
至于更具体的细节,例如同一编码字段的哪些可视化通道可以合并,是否支持不同编码字段进行合并等问题,主要取决于组件本身的表达能力,在当前的组件组织结构中,其实是很难表达和维护的。