@antv/g2 4.1.41 → 4.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/g2.min.js +2 -2
- package/dist/g2.min.js.map +1 -1
- package/esm/chart/controller/annotation.js +4 -0
- package/esm/chart/controller/annotation.js.map +1 -1
- package/esm/chart/controller/tooltip.js +15 -1
- package/esm/chart/controller/tooltip.js.map +1 -1
- package/esm/core.d.ts +1 -1
- package/esm/core.js +1 -1
- package/esm/core.js.map +1 -1
- package/esm/util/scale.js +2 -1
- package/esm/util/scale.js.map +1 -1
- package/lib/chart/controller/annotation.js +4 -0
- package/lib/chart/controller/annotation.js.map +1 -1
- package/lib/chart/controller/tooltip.js +14 -0
- package/lib/chart/controller/tooltip.js.map +1 -1
- package/lib/core.d.ts +1 -1
- package/lib/core.js +1 -1
- package/lib/core.js.map +1 -1
- package/lib/util/scale.js +2 -1
- package/lib/util/scale.js.map +1 -1
- package/package.json +2 -2
- package/src/chart/controller/annotation.ts +4 -0
- package/src/chart/controller/tooltip.ts +19 -4
- package/src/core.ts +1 -1
- package/src/util/scale.ts +2 -1
package/src/util/scale.ts
CHANGED
|
@@ -28,8 +28,9 @@ function getDefaultType(value: any): string {
|
|
|
28
28
|
*/
|
|
29
29
|
export function inferScaleType(scale: Scale, scaleDef: ScaleOption = {}, attrType: string, geometryType: string): string {
|
|
30
30
|
if (scaleDef.type) return scaleDef.type;
|
|
31
|
+
// identity scale 直接返回
|
|
31
32
|
// geometry 类型有: edge,heatmap,interval,line,path,point,polygon,schema,voilin等;理论上,interval 下,可以用 linear scale 作为分组字段
|
|
32
|
-
if (GROUP_ATTRS.includes(attrType) && ['interval'].includes(geometryType)) {
|
|
33
|
+
if (scale.type !== 'identity' && GROUP_ATTRS.includes(attrType) && ['interval'].includes(geometryType)) {
|
|
33
34
|
return 'cat';
|
|
34
35
|
}
|
|
35
36
|
return scale.type;
|