@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.
Files changed (126) hide show
  1. package/CHANGELOG.md +1460 -0
  2. package/dist/g2.min.js +2 -2
  3. package/dist/g2.min.js.map +1 -1
  4. package/esm/animate/animation/index.d.ts +1 -1
  5. package/esm/animate/animation/sector-path-update.js +1 -1
  6. package/esm/animate/animation/sector-path-update.js.map +1 -1
  7. package/esm/animate/index.js.map +1 -1
  8. package/esm/chart/controller/axis.d.ts +1 -1
  9. package/esm/chart/controller/base.d.ts +1 -1
  10. package/esm/chart/layout/constraint/types.d.ts +2 -2
  11. package/esm/chart/layout/index.d.ts +1 -1
  12. package/esm/chart/layout/padding-cal.d.ts +1 -1
  13. package/esm/component/update-label.d.ts +1 -1
  14. package/esm/component/update-label.js +2 -2
  15. package/esm/component/update-label.js.map +1 -1
  16. package/esm/core.d.ts +1 -1
  17. package/esm/core.js +1 -3
  18. package/esm/core.js.map +1 -1
  19. package/esm/dependents.d.ts +1 -1
  20. package/esm/geometry/label/base.d.ts +1 -1
  21. package/esm/geometry/label/index.d.ts +1 -1
  22. package/esm/geometry/label/interface.d.ts +2 -2
  23. package/esm/geometry/shape/area/index.js.map +1 -1
  24. package/esm/geometry/shape/area/line.js.map +1 -1
  25. package/esm/geometry/shape/area/smooth-line.js.map +1 -1
  26. package/esm/geometry/shape/area/smooth.js.map +1 -1
  27. package/esm/geometry/shape/base.js.map +1 -1
  28. package/esm/geometry/shape/edge/arc.js.map +1 -1
  29. package/esm/geometry/shape/edge/index.js.map +1 -1
  30. package/esm/geometry/shape/edge/smooth.js.map +1 -1
  31. package/esm/geometry/shape/edge/vhv.js.map +1 -1
  32. package/esm/geometry/shape/interval/funnel.js.map +1 -1
  33. package/esm/geometry/shape/interval/hollow-rect.js.map +1 -1
  34. package/esm/geometry/shape/interval/index.js.map +1 -1
  35. package/esm/geometry/shape/interval/line.js.map +1 -1
  36. package/esm/geometry/shape/interval/pyramid.js.map +1 -1
  37. package/esm/geometry/shape/interval/tick.js.map +1 -1
  38. package/esm/geometry/shape/line/index.js.map +1 -1
  39. package/esm/geometry/shape/line/step.js.map +1 -1
  40. package/esm/geometry/shape/point/hollow.js.map +1 -1
  41. package/esm/geometry/shape/point/image.js.map +1 -1
  42. package/esm/geometry/shape/point/index.js.map +1 -1
  43. package/esm/geometry/shape/point/solid.js.map +1 -1
  44. package/esm/geometry/shape/polygon/index.js.map +1 -1
  45. package/esm/geometry/shape/polygon/square.js.map +1 -1
  46. package/esm/geometry/shape/schema/box.js.map +1 -1
  47. package/esm/geometry/shape/schema/candle.js.map +1 -1
  48. package/esm/geometry/shape/violin/hollow.js.map +1 -1
  49. package/esm/geometry/shape/violin/index.js.map +1 -1
  50. package/esm/geometry/shape/violin/smooth.js.map +1 -1
  51. package/esm/interaction/action/component/tooltip/ellipsis-text.js +10 -0
  52. package/esm/interaction/action/component/tooltip/ellipsis-text.js.map +1 -1
  53. package/esm/interaction/action/element/highlight-util.d.ts +1 -1
  54. package/esm/interaction/action/element/highlight.d.ts +1 -1
  55. package/esm/interaction/action/element/link-by-color.d.ts +1 -1
  56. package/esm/interaction/action/register.d.ts +1 -1
  57. package/esm/interaction/interaction.d.ts +1 -1
  58. package/esm/interface.d.ts +59 -59
  59. package/esm/util/collision-detect.d.ts +1 -1
  60. package/esm/util/legend.d.ts +1 -1
  61. package/esm/util/text.d.ts +2 -2
  62. package/esm/util/types.d.ts +1 -1
  63. package/lib/animate/animation/index.d.ts +1 -1
  64. package/lib/animate/animation/sector-path-update.js +1 -1
  65. package/lib/animate/animation/sector-path-update.js.map +1 -1
  66. package/lib/animate/index.js.map +1 -1
  67. package/lib/chart/controller/axis.d.ts +1 -1
  68. package/lib/chart/controller/base.d.ts +1 -1
  69. package/lib/chart/layout/constraint/types.d.ts +2 -2
  70. package/lib/chart/layout/index.d.ts +1 -1
  71. package/lib/chart/layout/padding-cal.d.ts +1 -1
  72. package/lib/component/update-label.d.ts +1 -1
  73. package/lib/component/update-label.js +1 -1
  74. package/lib/component/update-label.js.map +1 -1
  75. package/lib/core.d.ts +1 -1
  76. package/lib/core.js +9 -9
  77. package/lib/core.js.map +1 -1
  78. package/lib/dependents.d.ts +1 -1
  79. package/lib/geometry/label/base.d.ts +1 -1
  80. package/lib/geometry/label/index.d.ts +1 -1
  81. package/lib/geometry/label/interface.d.ts +2 -2
  82. package/lib/geometry/shape/area/index.js.map +1 -1
  83. package/lib/geometry/shape/area/line.js.map +1 -1
  84. package/lib/geometry/shape/area/smooth-line.js.map +1 -1
  85. package/lib/geometry/shape/area/smooth.js.map +1 -1
  86. package/lib/geometry/shape/base.js.map +1 -1
  87. package/lib/geometry/shape/edge/arc.js.map +1 -1
  88. package/lib/geometry/shape/edge/index.js.map +1 -1
  89. package/lib/geometry/shape/edge/smooth.js.map +1 -1
  90. package/lib/geometry/shape/edge/vhv.js.map +1 -1
  91. package/lib/geometry/shape/interval/funnel.js.map +1 -1
  92. package/lib/geometry/shape/interval/hollow-rect.js.map +1 -1
  93. package/lib/geometry/shape/interval/index.js.map +1 -1
  94. package/lib/geometry/shape/interval/line.js.map +1 -1
  95. package/lib/geometry/shape/interval/pyramid.js.map +1 -1
  96. package/lib/geometry/shape/interval/tick.js.map +1 -1
  97. package/lib/geometry/shape/line/index.js.map +1 -1
  98. package/lib/geometry/shape/line/step.js.map +1 -1
  99. package/lib/geometry/shape/point/hollow.js.map +1 -1
  100. package/lib/geometry/shape/point/image.js.map +1 -1
  101. package/lib/geometry/shape/point/index.js.map +1 -1
  102. package/lib/geometry/shape/point/solid.js.map +1 -1
  103. package/lib/geometry/shape/polygon/index.js.map +1 -1
  104. package/lib/geometry/shape/polygon/square.js.map +1 -1
  105. package/lib/geometry/shape/schema/box.js.map +1 -1
  106. package/lib/geometry/shape/schema/candle.js.map +1 -1
  107. package/lib/geometry/shape/violin/hollow.js.map +1 -1
  108. package/lib/geometry/shape/violin/index.js.map +1 -1
  109. package/lib/geometry/shape/violin/smooth.js.map +1 -1
  110. package/lib/interaction/action/component/tooltip/ellipsis-text.js +10 -0
  111. package/lib/interaction/action/component/tooltip/ellipsis-text.js.map +1 -1
  112. package/lib/interaction/action/element/highlight-util.d.ts +1 -1
  113. package/lib/interaction/action/element/highlight.d.ts +1 -1
  114. package/lib/interaction/action/element/link-by-color.d.ts +1 -1
  115. package/lib/interaction/action/register.d.ts +1 -1
  116. package/lib/interaction/interaction.d.ts +1 -1
  117. package/lib/interface.d.ts +59 -59
  118. package/lib/util/collision-detect.d.ts +1 -1
  119. package/lib/util/legend.d.ts +1 -1
  120. package/lib/util/text.d.ts +2 -2
  121. package/lib/util/types.d.ts +1 -1
  122. package/package.json +2 -2
  123. package/src/animate/animation/sector-path-update.ts +1 -1
  124. package/src/component/update-label.ts +2 -2
  125. package/src/core.ts +1 -1
  126. package/src/interaction/action/component/tooltip/ellipsis-text.ts +9 -0
@@ -1,6 +1,6 @@
1
1
  import * as CSS from 'csstype';
2
- declare type FontFace = CSS.Properties;
3
- declare type Font = Pick<FontFace, 'fontFamily' | 'fontWeight' | 'fontStyle' | 'fontVariant'> & {
2
+ type FontFace = CSS.Properties;
3
+ type Font = Pick<FontFace, 'fontFamily' | 'fontWeight' | 'fontStyle' | 'fontVariant'> & {
4
4
  fontSize?: number;
5
5
  };
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Remove readonly modifier from a type
3
3
  */
4
- export declare type Writeable<T> = {
4
+ export type Writeable<T> = {
5
5
  -readonly [P in keyof T]: T[P];
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g2",
3
- "version": "4.2.10",
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 lint test build dist",
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('path', path);
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
@@ -1,6 +1,6 @@
1
1
  /* G2 的一个壳子,不包含 Geometry,由开发者自己定义和引入 */
2
2
 
3
- export const VERSION = '4.2.10';
3
+ export const VERSION = '4.2.11';
4
4
 
5
5
  // 核心基类导出
6
6
  export { Chart, View, Event } from './chart'; // Chart, View 类
@@ -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