@antv/g2 4.1.32 → 4.1.37
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 +64 -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/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.js +4 -1
- package/esm/chart/controller/scrollbar.js.map +1 -1
- package/esm/chart/controller/slider.js +7 -1
- package/esm/chart/controller/slider.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 +4 -0
- package/esm/geometry/base.js +14 -9
- package/esm/geometry/base.js.map +1 -1
- package/esm/geometry/element/index.js +3 -6
- 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.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/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 +20 -3
- 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/component/list-focus.d.ts +5 -0
- package/esm/interaction/action/component/list-focus.js +30 -0
- package/esm/interaction/action/component/list-focus.js.map +1 -0
- package/esm/interaction/action/component/list-radio.d.ts +6 -0
- package/esm/interaction/action/component/list-radio.js +26 -0
- package/esm/interaction/action/component/list-radio.js.map +1 -0
- 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.js +1 -1
- package/esm/interaction/action/view/mousewheel-scroll.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 +5 -0
- 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/event.js +1 -1
- package/esm/util/event.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/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.js +4 -1
- package/lib/chart/controller/scrollbar.js.map +1 -1
- package/lib/chart/controller/slider.js +7 -1
- package/lib/chart/controller/slider.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 +4 -0
- package/lib/geometry/base.js +14 -9
- package/lib/geometry/base.js.map +1 -1
- package/lib/geometry/element/index.js +3 -6
- 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.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/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 +20 -3
- 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/component/list-focus.d.ts +5 -0
- package/lib/interaction/action/component/list-focus.js +32 -0
- package/lib/interaction/action/component/list-focus.js.map +1 -0
- package/lib/interaction/action/component/list-radio.d.ts +6 -0
- package/lib/interaction/action/component/list-radio.js +28 -0
- package/lib/interaction/action/component/list-radio.js.map +1 -0
- 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.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 +5 -0
- 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/event.js +1 -1
- package/lib/util/event.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/controller/scrollbar.ts +6 -1
- package/src/chart/controller/slider.ts +12 -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 +13 -2
- package/src/geometry/element/index.ts +3 -5
- package/src/geometry/label/interval.ts +3 -3
- package/src/geometry/label/layout/limit-in-plot.ts +6 -4
- 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 +20 -3
- package/src/interaction/action/component/list-checked.ts +1 -1
- package/src/interaction/action/component/list-focus.ts +24 -0
- package/src/interaction/action/component/list-radio.ts +23 -0
- package/src/interaction/action/view/mousewheel-scroll.ts +3 -4
- package/src/interface.ts +10 -3
- package/src/util/axis.ts +9 -4
- package/src/util/bbox.ts +1 -2
- 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
|
@@ -36,6 +36,8 @@ export interface GeometryCfg {
|
|
|
36
36
|
sortable?: boolean;
|
|
37
37
|
/** elements 的 zIndex 默认按顺序提升,通过 zIndexReversed 可以反序,从而数据越前,层级越高 */
|
|
38
38
|
zIndexReversed?: boolean;
|
|
39
|
+
/** 是否需要对 zIndex 进行 sort。因为耗时长,由具体场景自行决定 */
|
|
40
|
+
sortZIndex?: boolean;
|
|
39
41
|
/** 是否可见 */
|
|
40
42
|
visible?: boolean;
|
|
41
43
|
/** 主题配置 */
|
|
@@ -140,6 +142,8 @@ export default class Geometry<S extends ShapePoint = ShapePoint> extends Base {
|
|
|
140
142
|
protected multiplePieWidthRatio: number;
|
|
141
143
|
/** elements 的 zIndex 默认按顺序提升,通过 zIndexReversed 可以反序,从而数据越前,层级越高 */
|
|
142
144
|
zIndexReversed?: boolean;
|
|
145
|
+
/** 是否需要对 zIndex 进行 sort。因为耗时长,由具体场景自行决定 */
|
|
146
|
+
sortZIndex?: boolean;
|
|
143
147
|
/** 虚拟 Group,用于图形更新 */
|
|
144
148
|
private offscreenGroup;
|
|
145
149
|
private groupScales;
|
package/esm/geometry/base.js
CHANGED
|
@@ -62,7 +62,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
62
62
|
_this.isCoordinateChanged = false;
|
|
63
63
|
var container = cfg.container, labelsContainer = cfg.labelsContainer, coordinate = cfg.coordinate, data = cfg.data, _a = cfg.sortable, sortable = _a === void 0 ? false : _a, _b = cfg.visible, visible = _b === void 0 ? true : _b, theme = cfg.theme, _c = cfg.scales, scales = _c === void 0 ? {} : _c, _d = cfg.scaleDefs, scaleDefs = _d === void 0 ? {} : _d,
|
|
64
64
|
// 柱状图间隔与宽度相关配置
|
|
65
|
-
intervalPadding = cfg.intervalPadding, dodgePadding = cfg.dodgePadding, maxColumnWidth = cfg.maxColumnWidth, minColumnWidth = cfg.minColumnWidth, columnWidthRatio = cfg.columnWidthRatio, roseWidthRatio = cfg.roseWidthRatio, multiplePieWidthRatio = cfg.multiplePieWidthRatio, zIndexReversed = cfg.zIndexReversed;
|
|
65
|
+
intervalPadding = cfg.intervalPadding, dodgePadding = cfg.dodgePadding, maxColumnWidth = cfg.maxColumnWidth, minColumnWidth = cfg.minColumnWidth, columnWidthRatio = cfg.columnWidthRatio, roseWidthRatio = cfg.roseWidthRatio, multiplePieWidthRatio = cfg.multiplePieWidthRatio, zIndexReversed = cfg.zIndexReversed, sortZIndex = cfg.sortZIndex;
|
|
66
66
|
_this.container = container;
|
|
67
67
|
_this.labelsContainer = labelsContainer;
|
|
68
68
|
_this.coordinate = coordinate;
|
|
@@ -81,6 +81,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
81
81
|
_this.roseWidthRatio = roseWidthRatio;
|
|
82
82
|
_this.multiplePieWidthRatio = multiplePieWidthRatio;
|
|
83
83
|
_this.zIndexReversed = zIndexReversed;
|
|
84
|
+
_this.sortZIndex = sortZIndex;
|
|
84
85
|
return _this;
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
@@ -617,13 +618,13 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
617
618
|
}
|
|
618
619
|
var id;
|
|
619
620
|
if (type === 'interval' || type === 'schema') {
|
|
620
|
-
id = ""
|
|
621
|
+
id = "".concat(xVal);
|
|
621
622
|
}
|
|
622
623
|
else if (type === 'line' || type === 'area' || type === 'path') {
|
|
623
624
|
id = type;
|
|
624
625
|
}
|
|
625
626
|
else {
|
|
626
|
-
id = xVal
|
|
627
|
+
id = "".concat(xVal, "-").concat(yVal);
|
|
627
628
|
}
|
|
628
629
|
var groupScales = this.groupScales;
|
|
629
630
|
if (isEmpty(groupScales)) {
|
|
@@ -632,18 +633,18 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
632
633
|
for (var index = 0, length_2 = groupScales.length; index < length_2; index++) {
|
|
633
634
|
var groupScale = groupScales[index];
|
|
634
635
|
var field = groupScale.field;
|
|
635
|
-
id = id
|
|
636
|
+
id = "".concat(id, "-").concat(originData[field]);
|
|
636
637
|
}
|
|
637
638
|
// 用户在进行 dodge 类型的 adjust 调整的时候设置了 dodgeBy 属性
|
|
638
639
|
var dodgeAdjust = this.getAdjust('dodge');
|
|
639
640
|
if (dodgeAdjust) {
|
|
640
641
|
var dodgeBy = dodgeAdjust.dodgeBy;
|
|
641
642
|
if (dodgeBy) {
|
|
642
|
-
id = id
|
|
643
|
+
id = "".concat(id, "-").concat(originData[dodgeBy]);
|
|
643
644
|
}
|
|
644
645
|
}
|
|
645
646
|
if (this.getAdjust('jitter')) {
|
|
646
|
-
id = id
|
|
647
|
+
id = "".concat(id, "-").concat(data.x, "-").concat(data.y);
|
|
647
648
|
}
|
|
648
649
|
return id;
|
|
649
650
|
};
|
|
@@ -915,7 +916,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
915
916
|
for (var j = 0; j < mappingData.length; j++) {
|
|
916
917
|
var mappingDatum = mappingData[j];
|
|
917
918
|
var key = this.getElementId(mappingDatum);
|
|
918
|
-
var finalKey = keyDatum.has(key) ? key
|
|
919
|
+
var finalKey = keyDatum.has(key) ? "".concat(key, "-").concat(i, "-").concat(j) : key;
|
|
919
920
|
keys.push(finalKey);
|
|
920
921
|
keyDatum.set(finalKey, mappingDatum);
|
|
921
922
|
keyIndex.set(finalKey, index);
|
|
@@ -933,7 +934,7 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
933
934
|
this.elements[i] = element;
|
|
934
935
|
this.elementsMap[key] = element;
|
|
935
936
|
if (element.shape) {
|
|
936
|
-
element.shape.
|
|
937
|
+
element.shape.set('zIndex', this.zIndexReversed ? this.elements.length - i : i);
|
|
937
938
|
}
|
|
938
939
|
}
|
|
939
940
|
// 更新 element
|
|
@@ -952,9 +953,13 @@ var Geometry = /** @class */ (function (_super) {
|
|
|
952
953
|
this.elements[i] = element;
|
|
953
954
|
this.elementsMap[key] = element;
|
|
954
955
|
if (element.shape) {
|
|
955
|
-
element.shape.
|
|
956
|
+
element.shape.set('zIndex', this.zIndexReversed ? this.elements.length - i : i);
|
|
956
957
|
}
|
|
957
958
|
}
|
|
959
|
+
// 全部 setZIndex 之后,再执行 sort
|
|
960
|
+
if (this.container) {
|
|
961
|
+
this.container.sort();
|
|
962
|
+
}
|
|
958
963
|
// 销毁被删除的 elements
|
|
959
964
|
for (var _c = 0, removed_1 = removed; _c < removed_1.length; _c++) {
|
|
960
965
|
var key = removed_1[_c];
|