@antv/g2 4.1.37 → 4.1.41
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 +44 -0
- package/dist/g2.min.js +4 -4
- package/dist/g2.min.js.map +1 -1
- package/esm/chart/controller/annotation.js +35 -21
- package/esm/chart/controller/annotation.js.map +1 -1
- package/esm/chart/controller/scrollbar.js +1 -1
- package/esm/chart/controller/scrollbar.js.map +1 -1
- package/esm/chart/controller/slider.js +1 -1
- package/esm/chart/controller/slider.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/geometry/base.js +16 -10
- package/esm/geometry/base.js.map +1 -1
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -1
- package/esm/interaction/action/component/list-focus.js +31 -6
- package/esm/interaction/action/component/list-focus.js.map +1 -1
- package/esm/interaction/action/component/list-radio.d.ts +18 -0
- package/esm/interaction/action/component/list-radio.js +92 -2
- package/esm/interaction/action/component/list-radio.js.map +1 -1
- package/esm/interface.js.map +1 -1
- package/esm/util/scale.d.ts +4 -0
- package/esm/util/scale.js +15 -1
- package/esm/util/scale.js.map +1 -1
- package/esm/util/tooltip.js +9 -5
- package/esm/util/tooltip.js.map +1 -1
- package/lib/chart/controller/annotation.js +35 -21
- package/lib/chart/controller/annotation.js.map +1 -1
- package/lib/chart/controller/scrollbar.js +1 -1
- package/lib/chart/controller/scrollbar.js.map +1 -1
- package/lib/chart/controller/slider.js +1 -1
- package/lib/chart/controller/slider.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/geometry/base.js +16 -10
- package/lib/geometry/base.js.map +1 -1
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/interaction/action/component/list-focus.js +31 -6
- package/lib/interaction/action/component/list-focus.js.map +1 -1
- package/lib/interaction/action/component/list-radio.d.ts +18 -0
- package/lib/interaction/action/component/list-radio.js +91 -1
- package/lib/interaction/action/component/list-radio.js.map +1 -1
- package/lib/interface.js.map +1 -1
- package/lib/util/scale.d.ts +4 -0
- package/lib/util/scale.js +17 -2
- package/lib/util/scale.js.map +1 -1
- package/lib/util/tooltip.js +7 -3
- package/lib/util/tooltip.js.map +1 -1
- package/package.json +5 -2
- package/src/chart/controller/annotation.ts +31 -18
- package/src/chart/controller/scrollbar.ts +1 -1
- package/src/chart/controller/slider.ts +3 -3
- package/src/core.ts +1 -1
- package/src/geometry/base.ts +18 -8
- package/src/index.ts +8 -0
- package/src/interaction/action/component/list-focus.ts +17 -5
- package/src/interaction/action/component/list-radio.ts +105 -0
- package/src/interface.ts +1 -1
- package/src/util/scale.ts +14 -1
- package/src/util/tooltip.ts +9 -5
package/src/util/tooltip.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
isNumberEqual,
|
|
10
10
|
isObject,
|
|
11
11
|
memoize,
|
|
12
|
-
|
|
12
|
+
get,
|
|
13
13
|
values,
|
|
14
14
|
} from '@antv/util';
|
|
15
15
|
import { View } from '../chart';
|
|
@@ -17,7 +17,7 @@ import { FIELD_ORIGIN, GROUP_ATTRS } from '../constant';
|
|
|
17
17
|
import { Attribute, Scale } from '../dependents';
|
|
18
18
|
import Geometry from '../geometry/base';
|
|
19
19
|
import { Data, Datum, MappingDatum, Point, TooltipCfg, TooltipTitle } from '../interface';
|
|
20
|
-
import { getName } from './scale';
|
|
20
|
+
import { getName, inferScaleType } from './scale';
|
|
21
21
|
|
|
22
22
|
function snapEqual(v1: any, v2: any, scale: Scale) {
|
|
23
23
|
const value1 = scale.translate(v1);
|
|
@@ -111,9 +111,13 @@ function getTooltipValueScale(geometry: Geometry) {
|
|
|
111
111
|
for (const attribute of attributes) {
|
|
112
112
|
const tmpScale = attribute.getScale(attribute.type);
|
|
113
113
|
if (tmpScale && tmpScale.isLinear) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
const tmpScaleDef = get(geometry.scaleDefs, tmpScale.field);
|
|
115
|
+
const inferedScaleType = inferScaleType(tmpScale, tmpScaleDef, attribute.type, geometry.type);
|
|
116
|
+
if (inferedScaleType !== 'cat') {
|
|
117
|
+
// 如果指定字段是非 position 的,同时是连续的
|
|
118
|
+
scale = tmpScale;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
|