@antv/g2 4.2.10 → 4.2.11
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 +1460 -0
- package/dist/g2.min.js +2 -2
- package/dist/g2.min.js.map +1 -1
- package/esm/animate/animation/index.d.ts +1 -1
- package/esm/animate/animation/sector-path-update.js +1 -1
- package/esm/animate/animation/sector-path-update.js.map +1 -1
- package/esm/animate/index.js.map +1 -1
- package/esm/chart/controller/axis.d.ts +1 -1
- package/esm/chart/controller/base.d.ts +1 -1
- package/esm/chart/layout/constraint/types.d.ts +2 -2
- package/esm/chart/layout/index.d.ts +1 -1
- package/esm/chart/layout/padding-cal.d.ts +1 -1
- package/esm/component/update-label.d.ts +1 -1
- package/esm/component/update-label.js +2 -2
- package/esm/component/update-label.js.map +1 -1
- package/esm/core.d.ts +1 -1
- package/esm/core.js +1 -3
- package/esm/core.js.map +1 -1
- package/esm/dependents.d.ts +1 -1
- package/esm/geometry/label/base.d.ts +1 -1
- package/esm/geometry/label/index.d.ts +1 -1
- package/esm/geometry/label/interface.d.ts +2 -2
- package/esm/geometry/shape/area/index.js.map +1 -1
- package/esm/geometry/shape/area/line.js.map +1 -1
- package/esm/geometry/shape/area/smooth-line.js.map +1 -1
- package/esm/geometry/shape/area/smooth.js.map +1 -1
- package/esm/geometry/shape/base.js.map +1 -1
- package/esm/geometry/shape/edge/arc.js.map +1 -1
- package/esm/geometry/shape/edge/index.js.map +1 -1
- package/esm/geometry/shape/edge/smooth.js.map +1 -1
- package/esm/geometry/shape/edge/vhv.js.map +1 -1
- package/esm/geometry/shape/interval/funnel.js.map +1 -1
- package/esm/geometry/shape/interval/hollow-rect.js.map +1 -1
- package/esm/geometry/shape/interval/index.js.map +1 -1
- package/esm/geometry/shape/interval/line.js.map +1 -1
- package/esm/geometry/shape/interval/pyramid.js.map +1 -1
- package/esm/geometry/shape/interval/tick.js.map +1 -1
- package/esm/geometry/shape/line/index.js.map +1 -1
- package/esm/geometry/shape/line/step.js.map +1 -1
- package/esm/geometry/shape/point/hollow.js.map +1 -1
- package/esm/geometry/shape/point/image.js.map +1 -1
- package/esm/geometry/shape/point/index.js.map +1 -1
- package/esm/geometry/shape/point/solid.js.map +1 -1
- package/esm/geometry/shape/polygon/index.js.map +1 -1
- package/esm/geometry/shape/polygon/square.js.map +1 -1
- package/esm/geometry/shape/schema/box.js.map +1 -1
- package/esm/geometry/shape/schema/candle.js.map +1 -1
- package/esm/geometry/shape/violin/hollow.js.map +1 -1
- package/esm/geometry/shape/violin/index.js.map +1 -1
- package/esm/geometry/shape/violin/smooth.js.map +1 -1
- package/esm/interaction/action/component/tooltip/ellipsis-text.js +10 -0
- package/esm/interaction/action/component/tooltip/ellipsis-text.js.map +1 -1
- package/esm/interaction/action/element/highlight-util.d.ts +1 -1
- package/esm/interaction/action/element/highlight.d.ts +1 -1
- package/esm/interaction/action/element/link-by-color.d.ts +1 -1
- package/esm/interaction/action/register.d.ts +1 -1
- package/esm/interaction/interaction.d.ts +1 -1
- package/esm/interface.d.ts +59 -59
- package/esm/util/collision-detect.d.ts +1 -1
- package/esm/util/legend.d.ts +1 -1
- package/esm/util/text.d.ts +2 -2
- package/esm/util/types.d.ts +1 -1
- package/lib/animate/animation/index.d.ts +1 -1
- package/lib/animate/animation/sector-path-update.js +1 -1
- package/lib/animate/animation/sector-path-update.js.map +1 -1
- package/lib/animate/index.js.map +1 -1
- package/lib/chart/controller/axis.d.ts +1 -1
- package/lib/chart/controller/base.d.ts +1 -1
- package/lib/chart/layout/constraint/types.d.ts +2 -2
- package/lib/chart/layout/index.d.ts +1 -1
- package/lib/chart/layout/padding-cal.d.ts +1 -1
- package/lib/component/update-label.d.ts +1 -1
- package/lib/component/update-label.js +1 -1
- package/lib/component/update-label.js.map +1 -1
- package/lib/core.d.ts +1 -1
- package/lib/core.js +9 -9
- package/lib/core.js.map +1 -1
- package/lib/dependents.d.ts +1 -1
- package/lib/geometry/label/base.d.ts +1 -1
- package/lib/geometry/label/index.d.ts +1 -1
- package/lib/geometry/label/interface.d.ts +2 -2
- package/lib/geometry/shape/area/index.js.map +1 -1
- package/lib/geometry/shape/area/line.js.map +1 -1
- package/lib/geometry/shape/area/smooth-line.js.map +1 -1
- package/lib/geometry/shape/area/smooth.js.map +1 -1
- package/lib/geometry/shape/base.js.map +1 -1
- package/lib/geometry/shape/edge/arc.js.map +1 -1
- package/lib/geometry/shape/edge/index.js.map +1 -1
- package/lib/geometry/shape/edge/smooth.js.map +1 -1
- package/lib/geometry/shape/edge/vhv.js.map +1 -1
- package/lib/geometry/shape/interval/funnel.js.map +1 -1
- package/lib/geometry/shape/interval/hollow-rect.js.map +1 -1
- package/lib/geometry/shape/interval/index.js.map +1 -1
- package/lib/geometry/shape/interval/line.js.map +1 -1
- package/lib/geometry/shape/interval/pyramid.js.map +1 -1
- package/lib/geometry/shape/interval/tick.js.map +1 -1
- package/lib/geometry/shape/line/index.js.map +1 -1
- package/lib/geometry/shape/line/step.js.map +1 -1
- package/lib/geometry/shape/point/hollow.js.map +1 -1
- package/lib/geometry/shape/point/image.js.map +1 -1
- package/lib/geometry/shape/point/index.js.map +1 -1
- package/lib/geometry/shape/point/solid.js.map +1 -1
- package/lib/geometry/shape/polygon/index.js.map +1 -1
- package/lib/geometry/shape/polygon/square.js.map +1 -1
- package/lib/geometry/shape/schema/box.js.map +1 -1
- package/lib/geometry/shape/schema/candle.js.map +1 -1
- package/lib/geometry/shape/violin/hollow.js.map +1 -1
- package/lib/geometry/shape/violin/index.js.map +1 -1
- package/lib/geometry/shape/violin/smooth.js.map +1 -1
- package/lib/interaction/action/component/tooltip/ellipsis-text.js +10 -0
- package/lib/interaction/action/component/tooltip/ellipsis-text.js.map +1 -1
- package/lib/interaction/action/element/highlight-util.d.ts +1 -1
- package/lib/interaction/action/element/highlight.d.ts +1 -1
- package/lib/interaction/action/element/link-by-color.d.ts +1 -1
- package/lib/interaction/action/register.d.ts +1 -1
- package/lib/interaction/interaction.d.ts +1 -1
- package/lib/interface.d.ts +59 -59
- package/lib/util/collision-detect.d.ts +1 -1
- package/lib/util/legend.d.ts +1 -1
- package/lib/util/text.d.ts +2 -2
- package/lib/util/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/animate/animation/sector-path-update.ts +1 -1
- package/src/component/update-label.ts +2 -2
- package/src/core.ts +1 -1
- package/src/interaction/action/component/tooltip/ellipsis-text.ts +9 -0
package/lib/util/text.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as CSS from 'csstype';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type FontFace = CSS.Properties;
|
|
3
|
+
type Font = Pick<FontFace, 'fontFamily' | 'fontWeight' | 'fontStyle' | 'fontVariant'> & {
|
|
4
4
|
fontSize?: number;
|
|
5
5
|
};
|
|
6
6
|
/**
|
package/lib/util/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g2",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.11",
|
|
4
4
|
"description": "the Grammar of Graphics in Javascript",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build": "run-s clean lib",
|
|
33
33
|
"dist": "webpack --config webpack.config.js --mode production",
|
|
34
34
|
"ci": "run-s build coverage",
|
|
35
|
-
"prepublishOnly": "npm-run-all --parallel
|
|
35
|
+
"prepublishOnly": "npm-run-all --parallel build dist",
|
|
36
36
|
"changelog": "generate-changelog",
|
|
37
37
|
"analyz": "webpack --profile --json > stats.json && webpack-bundle-analyzer ./stats.json"
|
|
38
38
|
},
|
|
@@ -131,7 +131,7 @@ export function sectorPathUpdate(shape: IShape, animateCfg: GAnimateCfg, cfg: An
|
|
|
131
131
|
const diffEndAngle = curEndAngle - preEndAngle;
|
|
132
132
|
// 没有 diff 时直接返回最终 attrs,不需要额外动画
|
|
133
133
|
if (diffStartAngle === 0 && diffEndAngle === 0) {
|
|
134
|
-
shape.attr(
|
|
134
|
+
shape.attr(toAttrs);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
2
|
import { IGroup, IShape } from '@antv/g-base';
|
|
3
|
-
import { each, get } from '@antv/util';
|
|
3
|
+
import { each, get, isArray } from '@antv/util';
|
|
4
4
|
import { doAnimate } from '../animate';
|
|
5
5
|
import { getReplaceAttrs } from '../util/graphics';
|
|
6
6
|
|
|
@@ -60,7 +60,7 @@ export function updateLabel(fromShape: IGroup, toShape: IGroup, cfg: Cfg): void
|
|
|
60
60
|
|
|
61
61
|
// append
|
|
62
62
|
each(toShape.getChildren(), (child, idx) => {
|
|
63
|
-
if (idx >= fromShape.getCount()) {
|
|
63
|
+
if (isArray(fromShape.getChildren()) && idx >= fromShape.getCount()) {
|
|
64
64
|
if (!child.destroyed) {
|
|
65
65
|
fromShape.add(child);
|
|
66
66
|
}
|
package/src/core.ts
CHANGED
|
@@ -56,6 +56,15 @@ export default class EllipsisText extends Action {
|
|
|
56
56
|
if (target && target.get('tip')) {
|
|
57
57
|
if (!this.tooltip) {
|
|
58
58
|
this.renderTooltip(); // 延迟生成
|
|
59
|
+
} else {
|
|
60
|
+
// 更新时需要重新获取 region 赋值,避免画布缩放后 tooltip 位置不对
|
|
61
|
+
const view = context.view;
|
|
62
|
+
const canvas = view.canvas;
|
|
63
|
+
const region = {
|
|
64
|
+
start: { x: 0, y: 0 },
|
|
65
|
+
end: { x: canvas.get('width'), y: canvas.get('height') },
|
|
66
|
+
}
|
|
67
|
+
this.tooltip.set('region', region)
|
|
59
68
|
}
|
|
60
69
|
const tipContent = target.get('tip');
|
|
61
70
|
// 展示 tooltip
|