@antv/g2 4.1.30 → 4.1.35
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 +80 -0
- package/README.en-US.md +1 -2
- package/README.md +1 -2
- package/dist/g2.min.js +4 -18
- package/dist/g2.min.js.map +1 -1
- package/esm/chart/chart.d.ts +10 -0
- package/esm/chart/chart.js +20 -0
- package/esm/chart/chart.js.map +1 -1
- package/esm/chart/controller/axis.js +3 -3
- package/esm/chart/controller/axis.js.map +1 -1
- package/esm/chart/controller/gesture.js +2 -2
- package/esm/chart/controller/gesture.js.map +1 -1
- package/esm/chart/controller/legend.js +1 -1
- package/esm/chart/controller/legend.js.map +1 -1
- package/esm/chart/controller/scrollbar.d.ts +8 -0
- package/esm/chart/controller/scrollbar.js +24 -3
- package/esm/chart/controller/scrollbar.js.map +1 -1
- package/esm/chart/controller/tooltip.js +2 -2
- package/esm/chart/controller/tooltip.js.map +1 -1
- package/esm/chart/event.js +1 -1
- package/esm/chart/event.js.map +1 -1
- package/esm/chart/layout/constraint/bounds.js +4 -4
- package/esm/chart/layout/constraint/bounds.js.map +1 -1
- package/esm/chart/layout/constraint/constraint.js.map +1 -1
- package/esm/chart/layout/constraint/gauss.js +3 -3
- package/esm/chart/layout/constraint/gauss.js.map +1 -1
- package/esm/chart/layout/constraint/solver.js.map +1 -1
- package/esm/chart/layout/constraint/types.js.map +1 -1
- package/esm/chart/layout/constraint/variable.js +1 -1
- package/esm/chart/layout/constraint/variable.js.map +1 -1
- package/esm/chart/util/scale-pool.js +1 -1
- package/esm/chart/util/scale-pool.js.map +1 -1
- package/esm/chart/util/sync-view-padding.js.map +1 -1
- package/esm/chart/view.js +4 -4
- package/esm/chart/view.js.map +1 -1
- package/esm/core.d.ts +5 -1
- package/esm/core.js +6 -1
- package/esm/core.js.map +1 -1
- package/esm/dependents.d.ts +1 -1
- package/esm/dependents.js +1 -1
- package/esm/dependents.js.map +1 -1
- package/esm/engine/index.js +1 -1
- package/esm/engine/index.js.map +1 -1
- package/esm/geometry/base.d.ts +2 -2
- package/esm/geometry/base.js +16 -16
- package/esm/geometry/base.js.map +1 -1
- package/esm/geometry/element/index.d.ts +4 -0
- package/esm/geometry/element/index.js +8 -2
- package/esm/geometry/element/index.js.map +1 -1
- package/esm/geometry/label/base.js +2 -2
- package/esm/geometry/label/base.js.map +1 -1
- package/esm/geometry/label/interval.d.ts +2 -5
- package/esm/geometry/label/interval.js +11 -3
- package/esm/geometry/label/interval.js.map +1 -1
- package/esm/geometry/label/layout/limit-in-plot.js.map +1 -1
- package/esm/geometry/label/layout/overlap.js +2 -2
- package/esm/geometry/label/layout/overlap.js.map +1 -1
- package/esm/geometry/label/layout/pie/distribute.js +3 -3
- package/esm/geometry/label/layout/pie/distribute.js.map +1 -1
- package/esm/geometry/label/layout/pie/outer.js +6 -6
- package/esm/geometry/label/layout/pie/outer.js.map +1 -1
- package/esm/geometry/label/layout/pie/spider.js +5 -5
- package/esm/geometry/label/layout/pie/spider.js.map +1 -1
- package/esm/geometry/path.js +1 -0
- package/esm/geometry/path.js.map +1 -1
- package/esm/geometry/shape/edge/util.js +1 -6
- package/esm/geometry/shape/edge/util.js.map +1 -1
- package/esm/geometry/shape/interval/util.js +63 -47
- package/esm/geometry/shape/interval/util.js.map +1 -1
- package/esm/geometry/shape/line/index.d.ts +6 -0
- package/esm/geometry/shape/line/index.js +4 -1
- package/esm/geometry/shape/line/index.js.map +1 -1
- package/esm/geometry/shape/point/index.js +1 -1
- package/esm/geometry/shape/point/index.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/util/group-data.js +1 -1
- package/esm/geometry/util/group-data.js.map +1 -1
- package/esm/geometry/util/shape-size.js +1 -1
- package/esm/geometry/util/shape-size.js.map +1 -1
- package/esm/index.js +5 -0
- package/esm/index.js.map +1 -1
- package/esm/interaction/action/component/list-checked.js +1 -1
- package/esm/interaction/action/component/list-checked.js.map +1 -1
- package/esm/interaction/action/mask/base.js +1 -1
- package/esm/interaction/action/mask/base.js.map +1 -1
- package/esm/interaction/action/view/mousewheel-scroll.d.ts +5 -0
- package/esm/interaction/action/view/mousewheel-scroll.js +35 -0
- package/esm/interaction/action/view/mousewheel-scroll.js.map +1 -0
- package/esm/interaction/context.js +2 -2
- package/esm/interaction/context.js.map +1 -1
- package/esm/interaction/grammar-interaction.js +2 -2
- package/esm/interaction/grammar-interaction.js.map +1 -1
- package/esm/interface.d.ts +9 -3
- package/esm/interface.js.map +1 -1
- package/esm/theme/util/create-by-style-sheet.js +9 -9
- package/esm/theme/util/create-by-style-sheet.js.map +1 -1
- package/esm/util/axis.js.map +1 -1
- package/esm/util/bbox.js +1 -2
- package/esm/util/bbox.js.map +1 -1
- package/esm/util/collision-detect.js +10 -0
- package/esm/util/collision-detect.js.map +1 -1
- package/esm/util/event.js +1 -1
- package/esm/util/event.js.map +1 -1
- package/esm/util/graphics.js +17 -1
- package/esm/util/graphics.js.map +1 -1
- package/esm/util/legend.js +3 -1
- package/esm/util/legend.js.map +1 -1
- package/esm/util/scale.js.map +1 -1
- package/esm/util/stat.js +1 -1
- package/esm/util/stat.js.map +1 -1
- package/esm/util/text.js +2 -2
- package/esm/util/text.js.map +1 -1
- package/lib/chart/chart.d.ts +10 -0
- package/lib/chart/chart.js +20 -0
- package/lib/chart/chart.js.map +1 -1
- package/lib/chart/controller/axis.js +3 -3
- package/lib/chart/controller/axis.js.map +1 -1
- package/lib/chart/controller/gesture.js +2 -2
- package/lib/chart/controller/gesture.js.map +1 -1
- package/lib/chart/controller/legend.js +1 -1
- package/lib/chart/controller/legend.js.map +1 -1
- package/lib/chart/controller/scrollbar.d.ts +8 -0
- package/lib/chart/controller/scrollbar.js +23 -2
- package/lib/chart/controller/scrollbar.js.map +1 -1
- package/lib/chart/controller/tooltip.js +2 -2
- package/lib/chart/controller/tooltip.js.map +1 -1
- package/lib/chart/event.js +1 -1
- package/lib/chart/event.js.map +1 -1
- package/lib/chart/layout/constraint/bounds.js +4 -4
- package/lib/chart/layout/constraint/bounds.js.map +1 -1
- package/lib/chart/layout/constraint/constraint.js.map +1 -1
- package/lib/chart/layout/constraint/gauss.js +3 -3
- package/lib/chart/layout/constraint/gauss.js.map +1 -1
- package/lib/chart/layout/constraint/solver.js.map +1 -1
- package/lib/chart/layout/constraint/types.js.map +1 -1
- package/lib/chart/layout/constraint/variable.js +1 -1
- package/lib/chart/layout/constraint/variable.js.map +1 -1
- package/lib/chart/util/scale-pool.js +1 -1
- package/lib/chart/util/scale-pool.js.map +1 -1
- package/lib/chart/util/sync-view-padding.js.map +1 -1
- package/lib/chart/view.js +4 -4
- package/lib/chart/view.js.map +1 -1
- package/lib/core.d.ts +5 -1
- package/lib/core.js +6 -1
- package/lib/core.js.map +1 -1
- package/lib/dependents.d.ts +1 -1
- package/lib/dependents.js.map +1 -1
- package/lib/engine/index.js +1 -1
- package/lib/engine/index.js.map +1 -1
- package/lib/geometry/base.d.ts +2 -2
- package/lib/geometry/base.js +16 -16
- package/lib/geometry/base.js.map +1 -1
- package/lib/geometry/element/index.d.ts +4 -0
- package/lib/geometry/element/index.js +8 -2
- package/lib/geometry/element/index.js.map +1 -1
- package/lib/geometry/label/base.js +2 -2
- package/lib/geometry/label/base.js.map +1 -1
- package/lib/geometry/label/interval.d.ts +2 -5
- package/lib/geometry/label/interval.js +11 -3
- package/lib/geometry/label/interval.js.map +1 -1
- package/lib/geometry/label/layout/limit-in-plot.js.map +1 -1
- package/lib/geometry/label/layout/overlap.js +2 -2
- package/lib/geometry/label/layout/overlap.js.map +1 -1
- package/lib/geometry/label/layout/pie/distribute.js +3 -3
- package/lib/geometry/label/layout/pie/distribute.js.map +1 -1
- package/lib/geometry/label/layout/pie/outer.js +6 -6
- package/lib/geometry/label/layout/pie/outer.js.map +1 -1
- package/lib/geometry/label/layout/pie/spider.js +5 -5
- package/lib/geometry/label/layout/pie/spider.js.map +1 -1
- package/lib/geometry/path.js +1 -0
- package/lib/geometry/path.js.map +1 -1
- package/lib/geometry/shape/edge/util.js +1 -6
- package/lib/geometry/shape/edge/util.js.map +1 -1
- package/lib/geometry/shape/interval/util.js +63 -47
- package/lib/geometry/shape/interval/util.js.map +1 -1
- package/lib/geometry/shape/line/index.d.ts +6 -0
- package/lib/geometry/shape/line/index.js +5 -0
- package/lib/geometry/shape/line/index.js.map +1 -1
- package/lib/geometry/shape/point/index.js +1 -1
- package/lib/geometry/shape/point/index.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/util/group-data.js +1 -1
- package/lib/geometry/util/group-data.js.map +1 -1
- package/lib/geometry/util/shape-size.js +1 -1
- package/lib/geometry/util/shape-size.js.map +1 -1
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/lib/interaction/action/component/list-checked.js +1 -1
- package/lib/interaction/action/component/list-checked.js.map +1 -1
- package/lib/interaction/action/mask/base.js +1 -1
- package/lib/interaction/action/mask/base.js.map +1 -1
- package/lib/interaction/action/view/mousewheel-scroll.d.ts +5 -0
- package/lib/interaction/action/view/mousewheel-scroll.js +37 -0
- package/lib/interaction/action/view/mousewheel-scroll.js.map +1 -0
- package/lib/interaction/context.js +2 -2
- package/lib/interaction/context.js.map +1 -1
- package/lib/interaction/grammar-interaction.js +2 -2
- package/lib/interaction/grammar-interaction.js.map +1 -1
- package/lib/interface.d.ts +9 -3
- package/lib/interface.js.map +1 -1
- package/lib/theme/util/create-by-style-sheet.js +9 -9
- package/lib/theme/util/create-by-style-sheet.js.map +1 -1
- package/lib/util/axis.js.map +1 -1
- package/lib/util/bbox.js +1 -2
- package/lib/util/bbox.js.map +1 -1
- package/lib/util/collision-detect.js +10 -0
- package/lib/util/collision-detect.js.map +1 -1
- package/lib/util/event.js +1 -1
- package/lib/util/event.js.map +1 -1
- package/lib/util/graphics.js +16 -0
- package/lib/util/graphics.js.map +1 -1
- package/lib/util/legend.js +3 -1
- package/lib/util/legend.js.map +1 -1
- package/lib/util/scale.js.map +1 -1
- package/lib/util/stat.js +1 -1
- package/lib/util/stat.js.map +1 -1
- package/lib/util/text.js +2 -2
- package/lib/util/text.js.map +1 -1
- package/package.json +15 -15
- package/src/chart/chart.ts +24 -1
- package/src/chart/controller/scrollbar.ts +27 -2
- package/src/chart/controller/tooltip.ts +2 -2
- package/src/chart/layout/constraint/bounds.ts +3 -4
- package/src/chart/layout/constraint/constraint.ts +4 -5
- package/src/chart/layout/constraint/gauss.ts +7 -7
- package/src/chart/layout/constraint/solver.ts +5 -6
- package/src/chart/layout/constraint/types.ts +2 -2
- package/src/chart/layout/constraint/variable.ts +2 -2
- package/src/chart/util/scale-pool.ts +8 -4
- package/src/chart/util/sync-view-padding.ts +1 -1
- package/src/chart/view.ts +10 -6
- package/src/core.ts +7 -1
- package/src/dependents.ts +11 -3
- package/src/geometry/base.ts +10 -11
- package/src/geometry/element/index.ts +11 -2
- package/src/geometry/label/interval.ts +20 -8
- package/src/geometry/label/layout/limit-in-plot.ts +6 -4
- package/src/geometry/path.ts +1 -0
- package/src/geometry/shape/edge/util.ts +1 -6
- package/src/geometry/shape/interval/util.ts +65 -46
- package/src/geometry/shape/line/index.ts +4 -1
- package/src/geometry/shape/violin/hollow.ts +1 -1
- package/src/geometry/shape/violin/index.ts +2 -2
- package/src/geometry/util/shape-size.ts +2 -5
- package/src/index.ts +7 -0
- package/src/interaction/action/component/list-checked.ts +1 -1
- package/src/interaction/action/view/mousewheel-scroll.ts +38 -0
- package/src/interaction/context.ts +2 -2
- package/src/interface.ts +12 -2
- package/src/util/axis.ts +9 -4
- package/src/util/bbox.ts +1 -2
- package/src/util/collision-detect.ts +12 -2
- package/src/util/graphics.ts +22 -3
- package/src/util/legend.ts +6 -4
- package/src/util/scale.ts +9 -4
- package/src/util/stat.ts +9 -5
package/esm/dependents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependents.js","sourceRoot":"","sources":["../src/dependents.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,IAAI;AACJ,OAAO,
|
|
1
|
+
{"version":3,"file":"dependents.js","sourceRoot":"","sources":["../src/dependents.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,IAAI;AACJ,OAAO,EASL,KAAK,EACL,aAAa,EACb,aAAa,GACd,MAAM,cAAc,CAAC;AAItB,SAAS;AACT,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO;AACP,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,aAAa;AACb,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAE3F,QAAQ;AACR,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAqB,MAAM,aAAa,CAAC;AAEhF,YAAY;AACZ,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,SAAS,EACT,IAAI,EACJ,cAAc,EACd,aAAa,EACb,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,GACV,MAAM,iBAAiB,CAAC;AAoCzB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,OAAO;AACC,IAAM,QAAQ,GAAyB,IAAI,KAA7B,EAAU,UAAU,GAAK,IAAI,OAAT,CAAU;AACpD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAChC,OAAO;AACC,IAAM,QAAQ,GAAyB,IAAI,KAA7B,EAAU,UAAU,GAAK,IAAI,OAAT,CAAU;AACpD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAChC,SAAS;AACD,IAAU,cAAc,GAAmC,MAAM,SAAzC,EAAc,gBAAgB,GAAK,MAAM,WAAX,CAAY;AAC1E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;AAC5C,UAAU;AACF,IAAM,WAAW,GAAK,OAAO,KAAZ,CAAa;AACtC,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY;AACZ,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["/* 依赖的模块,在这里统一引入,方便打包优化 */\n\n// G\nexport {\n ICanvas,\n IElement,\n IGroup,\n IShape,\n PathCommand,\n BBox,\n Point,\n ShapeAttrs,\n Event,\n AbstractGroup,\n AbstractShape,\n} from '@antv/g-base';\n// 需要有 G-base 提供 g engine 类型定义\nexport type IG = any;\n\n// adjust\nexport { registerAdjust, getAdjust, Adjust } from '@antv/adjust';\n\n// attr\nexport { getAttribute, Attribute } from '@antv/attr';\nexport { Color } from '@antv/attr';\n\n// coordinate\nexport { getCoordinate, registerCoordinate, Coordinate, CoordinateCfg } from '@antv/coord';\n\n// scale\nexport { getScale, registerScale, Scale, ScaleConfig, Tick } from '@antv/scale';\n\n// component\nimport {\n Annotation,\n Axis,\n Component,\n Crosshair,\n Grid,\n GroupComponent,\n HtmlComponent,\n Legend,\n Slider,\n Tooltip,\n Scrollbar,\n} from '@antv/component';\n\nexport {\n CategoryLegendCfg,\n CircleAxisCfg,\n LineAxisCfg,\n GroupComponentCfg,\n ListItem,\n AxisLineCfg,\n AxisTickLineCfg,\n AxisSubTickLineCfg,\n AxisTitleCfg,\n AxisLabelCfg,\n GridLineCfg,\n LegendMarkerCfg,\n LegendTitleCfg,\n LegendBackgroundCfg,\n LegendItemNameCfg,\n LegendItemValueCfg,\n LegendPageNavigatorCfg,\n ContinueLegendCfg,\n ContinueLegendTrackCfg,\n ContinueLegendRailCfg,\n ContinueLegendLabelCfg,\n ContinueLegendHandlerCfg,\n CrosshairLineCfg,\n CrosshairTextCfg,\n CrosshairTextBackgroundCfg,\n SliderCfg,\n TrendCfg,\n EnhancedTextCfg,\n LineAnnotationTextCfg,\n IComponent,\n IList,\n} from '@antv/component';\n\nexport { HtmlComponent, GroupComponent, Component, Crosshair };\nexport { Annotation };\n// axis\nconst { Line: LineAxis, Circle: CircleAxis } = Axis;\nexport { LineAxis, CircleAxis };\n// grid\nconst { Line: LineGrid, Circle: CircleGrid } = Grid;\nexport { LineGrid, CircleGrid };\n// legend\nconst { Category: CategoryLegend, Continuous: ContinuousLegend } = Legend;\nexport { CategoryLegend, ContinuousLegend };\n// Tooltip\nconst { Html: HtmlTooltip } = Tooltip;\nexport { HtmlTooltip };\n// Slider\nexport { Slider };\n// Scrollbar\nexport { Scrollbar };\n"]}
|
package/esm/engine/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var ENGINES = {};
|
|
|
7
7
|
export function getEngine(name) {
|
|
8
8
|
var G = ENGINES[name];
|
|
9
9
|
if (!G) {
|
|
10
|
-
throw new Error("G engine '"
|
|
10
|
+
throw new Error("G engine '".concat(name, "' is not exist, please register it at first."));
|
|
11
11
|
}
|
|
12
12
|
return G;
|
|
13
13
|
}
|
package/esm/engine/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAEA,IAAM,OAAO,GAAuB,EAAE,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB,IAAI,CAAC,CAAC,EAAE;QACN,MAAM,IAAI,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAEA,IAAM,OAAO,GAAuB,EAAE,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,IAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB,IAAI,CAAC,CAAC,EAAE;QACN,MAAM,IAAI,KAAK,CAAC,oBAAa,IAAI,iDAA8C,CAAC,CAAC;KAClF;IAED,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAU;IACrD,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACzB,CAAC","sourcesContent":["import { IG } from '../dependents';\n\nconst ENGINES: Record<string, IG> = {};\n\n/**\n * 通过名字获取渲染 engine\n * @param name 渲染引擎名字\n * @returns G engine\n */\nexport function getEngine(name: string): IG {\n const G = ENGINES[name];\n\n if (!G) {\n throw new Error(`G engine '${name}' is not exist, please register it at first.`);\n }\n\n return G;\n}\n\n/**\n * 注册渲染引擎\n * @param name\n * @param engine\n */\nexport function registerEngine(name: string, engine: IG) {\n ENGINES[name] = engine;\n}\n"]}
|
package/esm/geometry/base.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export default class Geometry<S extends ShapePoint = ShapePoint> extends Base {
|
|
|
139
139
|
/** 多层饼图/环图占比 */
|
|
140
140
|
protected multiplePieWidthRatio: number;
|
|
141
141
|
/** elements 的 zIndex 默认按顺序提升,通过 zIndexReversed 可以反序,从而数据越前,层级越高 */
|
|
142
|
-
|
|
142
|
+
zIndexReversed?: boolean;
|
|
143
143
|
/** 虚拟 Group,用于图形更新 */
|
|
144
144
|
private offscreenGroup;
|
|
145
145
|
private groupScales;
|
|
@@ -747,7 +747,7 @@ export default class Geometry<S extends ShapePoint = ShapePoint> extends Base {
|
|
|
747
747
|
* @param [isUpdate] 是否处于更新阶段
|
|
748
748
|
* @returns element 返回创建的 Element 实例
|
|
749
749
|
*/
|
|
750
|
-
protected createElement(mappingDatum: MappingDatum, isUpdate?: boolean): Element;
|
|
750
|
+
protected createElement(mappingDatum: MappingDatum, index: number, isUpdate?: boolean): Element;
|
|
751
751
|
/**
|
|
752
752
|
* 获取每条数据对应的图形绘制数据。
|
|
753
753
|
* @param mappingDatum 映射后的数据
|
package/esm/geometry/base.js
CHANGED
|
@@ -617,13 +617,13 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
617
617
|
}
|
|
618
618
|
var id;
|
|
619
619
|
if (type === 'interval' || type === 'schema') {
|
|
620
|
-
id = ""
|
|
620
|
+
id = "".concat(xVal);
|
|
621
621
|
}
|
|
622
622
|
else if (type === 'line' || type === 'area' || type === 'path') {
|
|
623
623
|
id = type;
|
|
624
624
|
}
|
|
625
625
|
else {
|
|
626
|
-
id = xVal
|
|
626
|
+
id = "".concat(xVal, "-").concat(yVal);
|
|
627
627
|
}
|
|
628
628
|
var groupScales = this.groupScales;
|
|
629
629
|
if (isEmpty(groupScales)) {
|
|
@@ -632,18 +632,18 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
632
632
|
for (var index = 0, length_2 = groupScales.length; index < length_2; index++) {
|
|
633
633
|
var groupScale = groupScales[index];
|
|
634
634
|
var field = groupScale.field;
|
|
635
|
-
id = id
|
|
635
|
+
id = "".concat(id, "-").concat(originData[field]);
|
|
636
636
|
}
|
|
637
637
|
// 用户在进行 dodge 类型的 adjust 调整的时候设置了 dodgeBy 属性
|
|
638
638
|
var dodgeAdjust = this.getAdjust('dodge');
|
|
639
639
|
if (dodgeAdjust) {
|
|
640
640
|
var dodgeBy = dodgeAdjust.dodgeBy;
|
|
641
641
|
if (dodgeBy) {
|
|
642
|
-
id = id
|
|
642
|
+
id = "".concat(id, "-").concat(originData[dodgeBy]);
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
if (this.getAdjust('jitter')) {
|
|
646
|
-
id = id
|
|
646
|
+
id = "".concat(id, "-").concat(data.x, "-").concat(data.y);
|
|
647
647
|
}
|
|
648
648
|
return id;
|
|
649
649
|
};
|
|
@@ -847,7 +847,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
847
847
|
* @param [isUpdate] 是否处于更新阶段
|
|
848
848
|
* @returns element 返回创建的 Element 实例
|
|
849
849
|
*/
|
|
850
|
-
Geometry.prototype.createElement = function (mappingDatum, isUpdate) {
|
|
850
|
+
Geometry.prototype.createElement = function (mappingDatum, index, isUpdate) {
|
|
851
851
|
if (isUpdate === void 0) { isUpdate = false; }
|
|
852
852
|
var container = this.container;
|
|
853
853
|
var shapeCfg = this.getDrawCfg(mappingDatum); // 获取绘制图形的配置信息
|
|
@@ -856,6 +856,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
856
856
|
shapeFactory: shapeFactory,
|
|
857
857
|
container: container,
|
|
858
858
|
offscreenGroup: this.getOffscreenGroup(),
|
|
859
|
+
elementIndex: index,
|
|
859
860
|
});
|
|
860
861
|
element.animate = this.animateOption;
|
|
861
862
|
element.geometry = this;
|
|
@@ -914,7 +915,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
914
915
|
for (var j = 0; j < mappingData.length; j++) {
|
|
915
916
|
var mappingDatum = mappingData[j];
|
|
916
917
|
var key = this.getElementId(mappingDatum);
|
|
917
|
-
var finalKey = keyDatum.has(key) ? key
|
|
918
|
+
var finalKey = keyDatum.has(key) ? "".concat(key, "-").concat(i, "-").concat(j) : key;
|
|
918
919
|
keys.push(finalKey);
|
|
919
920
|
keyDatum.set(finalKey, mappingDatum);
|
|
920
921
|
keyIndex.set(finalKey, index);
|
|
@@ -927,10 +928,13 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
927
928
|
for (var _i = 0, added_1 = added; _i < added_1.length; _i++) {
|
|
928
929
|
var key = added_1[_i];
|
|
929
930
|
var mappingDatum = keyDatum.get(key);
|
|
930
|
-
var element = this.createElement(mappingDatum, isUpdate);
|
|
931
931
|
var i = keyIndex.get(key);
|
|
932
|
+
var element = this.createElement(mappingDatum, i, isUpdate);
|
|
932
933
|
this.elements[i] = element;
|
|
933
934
|
this.elementsMap[key] = element;
|
|
935
|
+
if (element.shape) {
|
|
936
|
+
element.shape.setZIndex(this.zIndexReversed ? this.elements.length - i : i);
|
|
937
|
+
}
|
|
934
938
|
}
|
|
935
939
|
// 更新 element
|
|
936
940
|
for (var _b = 0, updated_1 = updated; _b < updated_1.length; _b++) {
|
|
@@ -947,6 +951,9 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
947
951
|
}
|
|
948
952
|
this.elements[i] = element;
|
|
949
953
|
this.elementsMap[key] = element;
|
|
954
|
+
if (element.shape) {
|
|
955
|
+
element.shape.setZIndex(this.zIndexReversed ? this.elements.length - i : i);
|
|
956
|
+
}
|
|
950
957
|
}
|
|
951
958
|
// 销毁被删除的 elements
|
|
952
959
|
for (var _c = 0, removed_1 = removed; _c < removed_1.length; _c++) {
|
|
@@ -956,13 +963,6 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
956
963
|
element.animate = this.animateOption;
|
|
957
964
|
element.destroy();
|
|
958
965
|
}
|
|
959
|
-
// 对 elements 的 zIndex 进行反序
|
|
960
|
-
if (this.zIndexReversed) {
|
|
961
|
-
var length_5 = this.elements.length;
|
|
962
|
-
for (var i = 0; i < length_5; i++) {
|
|
963
|
-
this.elements[i].shape.setZIndex(length_5 - i);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
966
|
};
|
|
967
967
|
/**
|
|
968
968
|
* 获取渲染的 label 类型。
|
|
@@ -1249,7 +1249,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
if (this.generatePoints) {
|
|
1251
1251
|
// 需要生成关键点
|
|
1252
|
-
for (var index = 0,
|
|
1252
|
+
for (var index = 0, length_5 = source.length; index < length_5; index++) {
|
|
1253
1253
|
var currentData = source[index];
|
|
1254
1254
|
this.generateShapePoints(currentData);
|
|
1255
1255
|
var nextData = source[index + 1];
|