scale
scale copied to clipboard
📦 Toolkit for mapping abstract data into visual representation.
### Usage - [x] source - [x] test: coverage 100% - [x] docs ### API ```ts import { Diverging, DivergingOptions } from '@antv/scale'; const scale = new Diverging({ domain: [-10,...
## 添加 useRelation 工具函数 useRelation 主要用于增加所有比例尺的**条件映射能力**。条件映射能力就是在输入满足指定条件的时候返回期望的值,在不满足条件的情况下走比例尺的默认逻辑。比如在下面的热力图的例子中,需要当值为 NaN 的时候为灰色,在值为 0 的时候为白色,其他的时候就走比例尺的默认映射逻辑。也可以看这个 https://github.com/antvis/G2Plot/issues/3329 里面提到的问题。  ## 使用方式 - 在 scale 中的使用方式 ```js import { Sequential, useRelation } from '@antv/scale'; const scale =...
- Split `computeBandState` into `computeBandState` and `computeFlexBandState` for performance. - Use [d3.internMap](https://github.com/d3/d3-array#InternMap) instead of Map to compute flex band state to handle temporal domain.
## Diverging Scale Diverging scale is like sequential scale, which expects it has three elements to describe visual domain by interpolator. Their domain includes three values: two extremes and a...
## 刻度计算精度问题 解决` Math.floow(0.58 * 100)` 结果为 `57` 之类的问题,最终会导致图表少一条刻度线