@antv/g2 5.0.0-beta.7 → 5.0.0-beta.9
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/dist/g2-lite.min.js +3 -3
- package/dist/g2.min.js +4 -4
- package/esm/animation/morphing.js +22 -2
- package/esm/animation/morphing.js.map +1 -1
- package/esm/api/chart.d.ts +8 -3
- package/esm/api/chart.js +35 -16
- package/esm/api/chart.js.map +1 -1
- package/esm/api/composition/base.d.ts +18 -1
- package/esm/api/composition/base.js +44 -1
- package/esm/api/composition/base.js.map +1 -1
- package/esm/api/mark/base.d.ts +22 -0
- package/esm/api/mark/base.js +54 -0
- package/esm/api/mark/base.js.map +1 -0
- package/esm/api/mark/mark.d.ts +1 -7
- package/esm/api/mark/mark.js +1 -13
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/props.js +0 -20
- package/esm/api/props.js.map +1 -1
- package/esm/component/axis.d.ts +5 -7
- package/esm/component/axis.js +126 -94
- package/esm/component/axis.js.map +1 -1
- package/esm/component/axisArc.d.ts +7 -0
- package/esm/component/axisArc.js +9 -0
- package/esm/component/axisArc.js.map +1 -0
- package/esm/component/axisRadar.d.ts +9 -0
- package/esm/component/axisRadar.js +46 -0
- package/esm/component/axisRadar.js.map +1 -0
- package/esm/component/axisX.d.ts +2 -1
- package/esm/component/axisX.js +5 -4
- package/esm/component/axisX.js.map +1 -1
- package/esm/component/axisY.d.ts +1 -1
- package/esm/component/axisY.js +4 -4
- package/esm/component/axisY.js.map +1 -1
- package/esm/component/index.d.ts +8 -0
- package/esm/component/index.js +5 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/legendCategory.d.ts +5 -3
- package/esm/component/legendCategory.js +80 -36
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.d.ts +4 -2
- package/esm/component/legendContinuous.js +76 -24
- package/esm/component/legendContinuous.js.map +1 -1
- package/esm/component/legendContinuousBlock.d.ts +4 -0
- package/esm/component/legendContinuousBlock.js +6 -0
- package/esm/component/legendContinuousBlock.js.map +1 -0
- package/esm/component/legendContinuousBlockSize.d.ts +4 -0
- package/esm/component/legendContinuousBlockSize.js +6 -0
- package/esm/component/legendContinuousBlockSize.js.map +1 -0
- package/esm/component/legendContinuousSize.d.ts +4 -0
- package/esm/component/legendContinuousSize.js +10 -0
- package/esm/component/legendContinuousSize.js.map +1 -0
- package/esm/component/scrollbar.js +1 -1
- package/esm/component/scrollbar.js.map +1 -1
- package/esm/component/slider.js +1 -1
- package/esm/component/slider.js.map +1 -1
- package/esm/component/title.js +1 -1
- package/esm/component/title.js.map +1 -1
- package/esm/component/utils.d.ts +12 -0
- package/esm/component/utils.js +35 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/composition/facetCircle.js +1 -1
- package/esm/composition/facetCircle.js.map +1 -1
- package/esm/coordinate/index.d.ts +3 -3
- package/esm/coordinate/index.js +3 -3
- package/esm/coordinate/index.js.map +1 -1
- package/esm/coordinate/polar.d.ts +6 -0
- package/esm/coordinate/polar.js +18 -6
- package/esm/coordinate/polar.js.map +1 -1
- package/esm/coordinate/radial.d.ts +6 -0
- package/esm/coordinate/radial.js +17 -5
- package/esm/coordinate/radial.js.map +1 -1
- package/esm/coordinate/theta.d.ts +7 -0
- package/esm/coordinate/theta.js +16 -4
- package/esm/coordinate/theta.js.map +1 -1
- package/esm/interaction/builtin/elementHighlight.d.ts +2 -0
- package/esm/interaction/builtin/elementHighlightByColor.d.ts +2 -0
- package/esm/interaction/builtin/elementHighlightByX.d.ts +2 -0
- package/esm/interaction/index.d.ts +2 -0
- package/esm/interaction/index.js +2 -0
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushAxisHighlight.js +6 -1
- package/esm/interaction/native/brushAxisHighlight.js.map +1 -1
- package/esm/interaction/native/brushFilter.js +1 -1
- package/esm/interaction/native/brushFilter.js.map +1 -1
- package/esm/interaction/native/elementHighlight.d.ts +7 -2
- package/esm/interaction/native/elementHighlight.js +72 -19
- package/esm/interaction/native/elementHighlight.js.map +1 -1
- package/esm/interaction/native/elementHighlightByColor.d.ts +4 -1
- package/esm/interaction/native/elementHighlightByColor.js +19 -3
- package/esm/interaction/native/elementHighlightByColor.js.map +1 -1
- package/esm/interaction/native/elementHighlightByX.d.ts +3 -3
- package/esm/interaction/native/elementHighlightByX.js +19 -3
- package/esm/interaction/native/elementHighlightByX.js.map +1 -1
- package/esm/interaction/native/elementSelect.d.ts +1 -1
- package/esm/interaction/native/elementSelect.js +42 -21
- package/esm/interaction/native/elementSelect.js.map +1 -1
- package/esm/interaction/native/elementSelectByColor.js +3 -2
- package/esm/interaction/native/elementSelectByColor.js.map +1 -1
- package/esm/interaction/native/elementSelectByX.js +3 -2
- package/esm/interaction/native/elementSelectByX.js.map +1 -1
- package/esm/interaction/native/legendFilter.d.ts +6 -0
- package/esm/interaction/native/legendFilter.js +26 -7
- package/esm/interaction/native/legendFilter.js.map +1 -1
- package/esm/interaction/native/legendHighlight.d.ts +4 -0
- package/esm/interaction/native/legendHighlight.js +93 -0
- package/esm/interaction/native/legendHighlight.js.map +1 -0
- package/esm/interaction/native/poptip.d.ts +5 -0
- package/esm/interaction/native/poptip.js +91 -0
- package/esm/interaction/native/poptip.js.map +1 -0
- package/esm/interaction/native/utils.d.ts +13 -2
- package/esm/interaction/native/utils.js +151 -26
- package/esm/interaction/native/utils.js.map +1 -1
- package/esm/label-transform/overlapDodgeY.js +0 -8
- package/esm/label-transform/overlapDodgeY.js.map +1 -1
- package/esm/mark/area.js +1 -1
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/pack.js +0 -1
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/treemap.js +0 -1
- package/esm/mark/treemap.js.map +1 -1
- package/esm/runtime/component.d.ts +3 -0
- package/esm/runtime/component.js +246 -103
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/coordinate.d.ts +11 -0
- package/esm/runtime/coordinate.js +23 -16
- package/esm/runtime/coordinate.js.map +1 -1
- package/esm/runtime/layout.d.ts +1 -1
- package/esm/runtime/layout.js +145 -76
- package/esm/runtime/layout.js.map +1 -1
- package/esm/runtime/plot.js +5 -4
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.js +18 -13
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/scale.d.ts +2 -1
- package/esm/runtime/scale.js +35 -0
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +1 -1
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +11 -2
- package/esm/runtime/types/component.d.ts +9 -7
- package/esm/runtime/types/options.d.ts +8 -6
- package/esm/runtime/types/scale.d.ts +18 -0
- package/esm/runtime/types/scale.js +19 -0
- package/esm/runtime/types/scale.js.map +1 -0
- package/esm/runtime/types/theme.d.ts +2 -1
- package/esm/shape/area/hv.d.ts +3 -0
- package/esm/shape/area/hv.js +9 -0
- package/esm/shape/area/hv.js.map +1 -0
- package/esm/shape/area/hvh.d.ts +3 -0
- package/esm/shape/area/{step.js → hvh.js} +3 -3
- package/esm/shape/area/hvh.js.map +1 -0
- package/esm/shape/area/vh.d.ts +3 -0
- package/esm/shape/area/vh.js +9 -0
- package/esm/shape/area/vh.js.map +1 -0
- package/esm/shape/connector/connector.js +1 -1
- package/esm/shape/index.d.ts +6 -2
- package/esm/shape/index.js +3 -1
- package/esm/shape/index.js.map +1 -1
- package/esm/shape/interval/color.d.ts +1 -0
- package/esm/shape/interval/color.js +65 -53
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/utils.js.map +1 -1
- package/esm/spec/composition.d.ts +0 -3
- package/esm/spec/geometry.d.ts +1 -1
- package/esm/spec/interaction.d.ts +33 -15
- package/esm/spec/transform.d.ts +13 -3
- package/esm/stdlib/index.js +4 -9
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.js +10 -4
- package/esm/theme/academy.js.map +1 -1
- package/esm/theme/dark.js +10 -4
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/light.js +12 -4
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/sample.js +42 -26
- package/esm/transform/sample.js.map +1 -1
- package/esm/transform/utils/lttb.d.ts +5 -0
- package/esm/transform/utils/lttb.js +56 -0
- package/esm/transform/utils/lttb.js.map +1 -0
- package/esm/utils/angle.d.ts +2 -0
- package/esm/utils/angle.js +7 -0
- package/esm/utils/angle.js.map +1 -0
- package/esm/utils/array.d.ts +8 -0
- package/esm/utils/array.js +35 -0
- package/esm/utils/array.js.map +1 -1
- package/esm/utils/coordinate.d.ts +4 -0
- package/esm/utils/coordinate.js +19 -0
- package/esm/utils/coordinate.js.map +1 -1
- package/esm/utils/event.d.ts +0 -2
- package/esm/utils/event.js +0 -18
- package/esm/utils/event.js.map +1 -1
- package/esm/utils/scale.d.ts +1 -0
- package/esm/utils/scale.js +3 -3
- package/esm/utils/scale.js.map +1 -1
- package/esm/utils/vector.d.ts +1 -1
- package/esm/utils/vector.js +1 -1
- package/lib/animation/morphing.js +22 -2
- package/lib/animation/morphing.js.map +1 -1
- package/lib/api/chart.d.ts +8 -3
- package/lib/api/chart.js +37 -15
- package/lib/api/chart.js.map +1 -1
- package/lib/api/composition/base.d.ts +18 -1
- package/lib/api/composition/base.js +44 -1
- package/lib/api/composition/base.js.map +1 -1
- package/lib/api/mark/base.d.ts +22 -0
- package/lib/api/mark/base.js +58 -0
- package/lib/api/mark/base.js.map +1 -0
- package/lib/api/mark/mark.d.ts +1 -7
- package/lib/api/mark/mark.js +28 -41
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/props.js +0 -20
- package/lib/api/props.js.map +1 -1
- package/lib/component/axis.d.ts +5 -7
- package/lib/component/axis.js +127 -96
- package/lib/component/axis.js.map +1 -1
- package/lib/component/axisArc.d.ts +7 -0
- package/lib/component/axisArc.js +13 -0
- package/lib/component/axisArc.js.map +1 -0
- package/lib/component/axisRadar.d.ts +9 -0
- package/lib/component/axisRadar.js +50 -0
- package/lib/component/axisRadar.js.map +1 -0
- package/lib/component/axisX.d.ts +2 -1
- package/lib/component/axisX.js +6 -4
- package/lib/component/axisX.js.map +1 -1
- package/lib/component/axisY.d.ts +1 -1
- package/lib/component/axisY.js +3 -3
- package/lib/component/axisY.js.map +1 -1
- package/lib/component/index.d.ts +8 -0
- package/lib/component/index.js +12 -1
- package/lib/component/index.js.map +1 -1
- package/lib/component/legendCategory.d.ts +5 -3
- package/lib/component/legendCategory.js +79 -35
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.d.ts +4 -2
- package/lib/component/legendContinuous.js +75 -23
- package/lib/component/legendContinuous.js.map +1 -1
- package/lib/component/legendContinuousBlock.d.ts +4 -0
- package/lib/component/legendContinuousBlock.js +10 -0
- package/lib/component/legendContinuousBlock.js.map +1 -0
- package/lib/component/legendContinuousBlockSize.d.ts +4 -0
- package/lib/component/legendContinuousBlockSize.js +10 -0
- package/lib/component/legendContinuousBlockSize.js.map +1 -0
- package/lib/component/legendContinuousSize.d.ts +4 -0
- package/lib/component/legendContinuousSize.js +14 -0
- package/lib/component/legendContinuousSize.js.map +1 -0
- package/lib/component/scrollbar.js +1 -1
- package/lib/component/scrollbar.js.map +1 -1
- package/lib/component/slider.js +1 -1
- package/lib/component/slider.js.map +1 -1
- package/lib/component/title.js +1 -1
- package/lib/component/title.js.map +1 -1
- package/lib/component/utils.d.ts +12 -0
- package/lib/component/utils.js +39 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/composition/facetCircle.js +1 -1
- package/lib/composition/facetCircle.js.map +1 -1
- package/lib/coordinate/index.d.ts +3 -3
- package/lib/coordinate/index.js +4 -1
- package/lib/coordinate/index.js.map +1 -1
- package/lib/coordinate/polar.d.ts +6 -0
- package/lib/coordinate/polar.js +20 -7
- package/lib/coordinate/polar.js.map +1 -1
- package/lib/coordinate/radial.d.ts +6 -0
- package/lib/coordinate/radial.js +19 -6
- package/lib/coordinate/radial.js.map +1 -1
- package/lib/coordinate/theta.d.ts +7 -0
- package/lib/coordinate/theta.js +18 -5
- package/lib/coordinate/theta.js.map +1 -1
- package/lib/interaction/builtin/elementHighlight.d.ts +2 -0
- package/lib/interaction/builtin/elementHighlightByColor.d.ts +2 -0
- package/lib/interaction/builtin/elementHighlightByX.d.ts +2 -0
- package/lib/interaction/index.d.ts +2 -0
- package/lib/interaction/index.js +5 -1
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushAxisHighlight.js +6 -1
- package/lib/interaction/native/brushAxisHighlight.js.map +1 -1
- package/lib/interaction/native/brushFilter.js +1 -1
- package/lib/interaction/native/brushFilter.js.map +1 -1
- package/lib/interaction/native/elementHighlight.d.ts +7 -2
- package/lib/interaction/native/elementHighlight.js +71 -18
- package/lib/interaction/native/elementHighlight.js.map +1 -1
- package/lib/interaction/native/elementHighlightByColor.d.ts +4 -1
- package/lib/interaction/native/elementHighlightByColor.js +18 -2
- package/lib/interaction/native/elementHighlightByColor.js.map +1 -1
- package/lib/interaction/native/elementHighlightByX.d.ts +3 -3
- package/lib/interaction/native/elementHighlightByX.js +18 -2
- package/lib/interaction/native/elementHighlightByX.js.map +1 -1
- package/lib/interaction/native/elementSelect.d.ts +1 -1
- package/lib/interaction/native/elementSelect.js +41 -20
- package/lib/interaction/native/elementSelect.js.map +1 -1
- package/lib/interaction/native/elementSelectByColor.js +2 -1
- package/lib/interaction/native/elementSelectByColor.js.map +1 -1
- package/lib/interaction/native/elementSelectByX.js +2 -1
- package/lib/interaction/native/elementSelectByX.js.map +1 -1
- package/lib/interaction/native/legendFilter.d.ts +6 -0
- package/lib/interaction/native/legendFilter.js +31 -6
- package/lib/interaction/native/legendFilter.js.map +1 -1
- package/lib/interaction/native/legendHighlight.d.ts +4 -0
- package/lib/interaction/native/legendHighlight.js +97 -0
- package/lib/interaction/native/legendHighlight.js.map +1 -0
- package/lib/interaction/native/poptip.d.ts +5 -0
- package/lib/interaction/native/poptip.js +95 -0
- package/lib/interaction/native/poptip.js.map +1 -0
- package/lib/interaction/native/utils.d.ts +13 -2
- package/lib/interaction/native/utils.js +154 -27
- package/lib/interaction/native/utils.js.map +1 -1
- package/lib/label-transform/overlapDodgeY.js +0 -8
- package/lib/label-transform/overlapDodgeY.js.map +1 -1
- package/lib/mark/area.js +1 -1
- package/lib/mark/area.js.map +1 -1
- package/lib/mark/pack.js +0 -1
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/treemap.js +0 -1
- package/lib/mark/treemap.js.map +1 -1
- package/lib/runtime/component.d.ts +3 -0
- package/lib/runtime/component.js +250 -107
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/coordinate.d.ts +11 -0
- package/lib/runtime/coordinate.js +26 -17
- package/lib/runtime/coordinate.js.map +1 -1
- package/lib/runtime/layout.d.ts +1 -1
- package/lib/runtime/layout.js +146 -77
- package/lib/runtime/layout.js.map +1 -1
- package/lib/runtime/plot.js +4 -3
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.js +20 -12
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/scale.d.ts +2 -1
- package/lib/runtime/scale.js +37 -1
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +1 -1
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +11 -2
- package/lib/runtime/types/component.d.ts +9 -7
- package/lib/runtime/types/options.d.ts +8 -6
- package/lib/runtime/types/scale.d.ts +18 -0
- package/lib/runtime/types/scale.js +22 -0
- package/lib/runtime/types/scale.js.map +1 -0
- package/lib/runtime/types/theme.d.ts +2 -1
- package/lib/shape/area/hv.d.ts +3 -0
- package/lib/shape/area/hv.js +13 -0
- package/lib/shape/area/hv.js.map +1 -0
- package/lib/shape/area/hvh.d.ts +3 -0
- package/lib/shape/area/{step.js → hvh.js} +5 -5
- package/lib/shape/area/hvh.js.map +1 -0
- package/lib/shape/area/vh.d.ts +3 -0
- package/lib/shape/area/vh.js +13 -0
- package/lib/shape/area/vh.js.map +1 -0
- package/lib/shape/connector/connector.js +1 -1
- package/lib/shape/index.d.ts +6 -2
- package/lib/shape/index.js +7 -3
- package/lib/shape/index.js.map +1 -1
- package/lib/shape/interval/color.d.ts +1 -0
- package/lib/shape/interval/color.js +67 -54
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/spec/composition.d.ts +0 -3
- package/lib/spec/geometry.d.ts +1 -1
- package/lib/spec/interaction.d.ts +33 -15
- package/lib/spec/transform.d.ts +13 -3
- package/lib/stdlib/index.js +1 -1
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.js +10 -4
- package/lib/theme/academy.js.map +1 -1
- package/lib/theme/dark.js +10 -4
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/light.js +12 -4
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/sample.js +42 -26
- package/lib/transform/sample.js.map +1 -1
- package/lib/transform/utils/lttb.d.ts +5 -0
- package/lib/transform/utils/lttb.js +60 -0
- package/lib/transform/utils/lttb.js.map +1 -0
- package/lib/utils/angle.d.ts +2 -0
- package/lib/utils/angle.js +12 -0
- package/lib/utils/angle.js.map +1 -0
- package/lib/utils/array.d.ts +8 -0
- package/lib/utils/array.js +38 -1
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/coordinate.d.ts +4 -0
- package/lib/utils/coordinate.js +24 -1
- package/lib/utils/coordinate.js.map +1 -1
- package/lib/utils/event.d.ts +0 -2
- package/lib/utils/event.js +1 -21
- package/lib/utils/event.js.map +1 -1
- package/lib/utils/scale.d.ts +1 -0
- package/lib/utils/scale.js +5 -4
- package/lib/utils/scale.js.map +1 -1
- package/lib/utils/vector.d.ts +1 -1
- package/lib/utils/vector.js +1 -1
- package/package.json +7 -7
- package/src/animation/morphing.ts +23 -2
- package/src/api/chart.ts +43 -20
- package/src/api/composition/base.ts +46 -1
- package/src/api/mark/base.ts +58 -0
- package/src/api/mark/mark.ts +1 -20
- package/src/api/props.ts +0 -23
- package/src/component/axis.ts +199 -118
- package/src/component/axisArc.ts +16 -0
- package/src/component/axisRadar.ts +73 -0
- package/src/component/axisX.ts +7 -4
- package/src/component/axisY.ts +4 -4
- package/src/component/index.ts +8 -0
- package/src/component/legendCategory.ts +156 -35
- package/src/component/legendContinuous.ts +133 -32
- package/src/component/legendContinuousBlock.ts +17 -0
- package/src/component/legendContinuousBlockSize.ts +22 -0
- package/src/component/legendContinuousSize.ts +27 -0
- package/src/component/scrollbar.ts +1 -1
- package/src/component/slider.ts +1 -1
- package/src/component/title.ts +1 -1
- package/src/component/utils.ts +46 -0
- package/src/composition/facetCircle.ts +1 -1
- package/src/coordinate/index.ts +3 -3
- package/src/coordinate/polar.ts +19 -11
- package/src/coordinate/radial.ts +19 -10
- package/src/coordinate/theta.ts +18 -9
- package/src/interaction/index.ts +2 -0
- package/src/interaction/native/brushAxisHighlight.ts +9 -1
- package/src/interaction/native/brushFilter.ts +1 -1
- package/src/interaction/native/elementHighlight.ts +78 -12
- package/src/interaction/native/elementHighlightByColor.ts +9 -4
- package/src/interaction/native/elementHighlightByX.ts +9 -5
- package/src/interaction/native/elementSelect.ts +58 -15
- package/src/interaction/native/elementSelectByColor.ts +4 -1
- package/src/interaction/native/elementSelectByX.ts +4 -1
- package/src/interaction/native/legendFilter.ts +29 -7
- package/src/interaction/native/legendHighlight.ts +86 -0
- package/src/interaction/native/poptip.ts +87 -0
- package/src/interaction/native/utils.ts +183 -26
- package/src/label-transform/overlapDodgeY.ts +0 -7
- package/src/mark/area.ts +1 -1
- package/src/mark/pack.ts +0 -1
- package/src/mark/treemap.ts +0 -1
- package/src/runtime/component.ts +335 -124
- package/src/runtime/coordinate.ts +29 -16
- package/src/runtime/layout.ts +206 -97
- package/src/runtime/plot.ts +5 -4
- package/src/runtime/render.ts +26 -13
- package/src/runtime/scale.ts +41 -0
- package/src/runtime/transform.ts +3 -0
- package/src/runtime/types/common.ts +23 -10
- package/src/runtime/types/component.ts +19 -10
- package/src/runtime/types/options.ts +24 -16
- package/src/runtime/types/scale.ts +20 -0
- package/src/runtime/types/theme.ts +2 -1
- package/src/shape/area/hv.ts +20 -0
- package/src/shape/area/{step.ts → hvh.ts} +3 -3
- package/src/shape/area/vh.ts +20 -0
- package/src/shape/connector/connector.ts +1 -1
- package/src/shape/index.ts +7 -2
- package/src/shape/interval/color.ts +86 -54
- package/src/shape/utils.ts +2 -0
- package/src/spec/composition.ts +0 -1
- package/src/spec/geometry.ts +3 -1
- package/src/spec/interaction.ts +51 -19
- package/src/spec/transform.ts +27 -2
- package/src/stdlib/index.ts +22 -6
- package/src/theme/academy.ts +10 -4
- package/src/theme/dark.ts +10 -4
- package/src/theme/light.ts +12 -4
- package/src/transform/sample.ts +54 -18
- package/src/transform/utils/lttb.ts +73 -0
- package/src/utils/angle.ts +7 -0
- package/src/utils/array.ts +39 -0
- package/src/utils/coordinate.ts +29 -0
- package/src/utils/event.ts +0 -26
- package/src/utils/scale.ts +4 -4
- package/src/utils/vector.ts +1 -1
- package/esm/shape/area/step.d.ts +0 -3
- package/esm/shape/area/step.js.map +0 -1
- package/lib/shape/area/step.d.ts +0 -3
- package/lib/shape/area/step.js.map +0 -1
package/lib/api/chart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RendererPlugin } from '@antv/g';
|
|
1
|
+
import { RendererPlugin, Canvas as GCanvas } from '@antv/g';
|
|
2
2
|
import { Renderer as CanvasRenderer } from '@antv/g-canvas';
|
|
3
3
|
import { G2Context } from '../runtime';
|
|
4
4
|
import { ViewComposition } from '../spec';
|
|
@@ -11,6 +11,7 @@ export declare function removeContainer(container: HTMLElement): void;
|
|
|
11
11
|
export declare function optionsOf(node: Node): Record<string, any>;
|
|
12
12
|
export type ChartOptions = ViewComposition & {
|
|
13
13
|
container?: string | HTMLElement;
|
|
14
|
+
canvas?: GCanvas;
|
|
14
15
|
width?: number;
|
|
15
16
|
height?: number;
|
|
16
17
|
autoFit?: boolean;
|
|
@@ -30,7 +31,6 @@ export interface Chart extends Composition, Mark {
|
|
|
30
31
|
transform: ArrayAttribute<ChartProps['transform'], Chart>;
|
|
31
32
|
theme: ObjectAttribute<ChartProps['theme'], Chart>;
|
|
32
33
|
title: ObjectAttribute<ChartProps['title'], Chart>;
|
|
33
|
-
on: ObjectAttribute<ChartProps['on'], Chart>;
|
|
34
34
|
scale: ObjectAttribute<ChartOptions['scale'], Chart>;
|
|
35
35
|
axis: ObjectAttribute<ChartOptions['axis'], Chart>;
|
|
36
36
|
legend: ObjectAttribute<ChartOptions['legend'], Chart>;
|
|
@@ -40,13 +40,18 @@ export declare const props: NodePropertyDescriptor[];
|
|
|
40
40
|
export declare class Chart extends View<ChartOptions> {
|
|
41
41
|
private _container;
|
|
42
42
|
private _context;
|
|
43
|
+
private _emitter;
|
|
43
44
|
constructor(options?: ChartOptions);
|
|
44
45
|
options(): Record<string, any>;
|
|
45
46
|
context(): G2Context;
|
|
47
|
+
on(event: string, callback: (...args: any[]) => any, once?: boolean): this;
|
|
48
|
+
once(event: string, callback: (...args: any[]) => any): this;
|
|
49
|
+
emit(event: string, ...args: any[]): this;
|
|
50
|
+
off(event?: string, callback?: (...args: any[]) => any): this;
|
|
46
51
|
destroy(): void;
|
|
47
52
|
clear(): void;
|
|
48
53
|
forceFit(): void;
|
|
49
|
-
changeSize(adjustedWidth: number, adjustedHeight: number):
|
|
54
|
+
changeSize(adjustedWidth: number, adjustedHeight: number): Promise<Chart>;
|
|
50
55
|
private onResize;
|
|
51
56
|
private bindAutoFit;
|
|
52
57
|
private unbindAutoFit;
|
package/lib/api/chart.js
CHANGED
|
@@ -16,12 +16,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
16
16
|
}
|
|
17
17
|
return t;
|
|
18
18
|
};
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
19
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
23
|
exports.Chart = exports.props = exports.optionsOf = exports.removeContainer = void 0;
|
|
21
24
|
const g_1 = require("@antv/g");
|
|
22
25
|
const g_canvas_1 = require("@antv/g-canvas");
|
|
23
26
|
const g_plugin_dragndrop_1 = require("@antv/g-plugin-dragndrop");
|
|
24
27
|
const util_1 = require("@antv/util");
|
|
28
|
+
const event_emitter_1 = __importDefault(require("@antv/event-emitter"));
|
|
25
29
|
const runtime_1 = require("../runtime");
|
|
26
30
|
const size_1 = require("../utils/size");
|
|
27
31
|
const event_1 = require("../utils/event");
|
|
@@ -115,7 +119,6 @@ exports.props = [
|
|
|
115
119
|
{ name: 'key', type: 'value' },
|
|
116
120
|
{ name: 'transform', type: 'array' },
|
|
117
121
|
{ name: 'theme', type: 'object' },
|
|
118
|
-
{ name: 'on', type: 'event' },
|
|
119
122
|
{ name: 'scale', type: 'object' },
|
|
120
123
|
{ name: 'axis', type: 'object' },
|
|
121
124
|
{ name: 'legend', type: 'object' },
|
|
@@ -125,13 +128,14 @@ exports.props = [
|
|
|
125
128
|
];
|
|
126
129
|
let Chart = class Chart extends composition_1.View {
|
|
127
130
|
constructor(options = {}) {
|
|
128
|
-
const { container } = options, rest = __rest(options, ["container"]);
|
|
131
|
+
const { container, canvas } = options, rest = __rest(options, ["container", "canvas"]);
|
|
129
132
|
super(rest, 'view');
|
|
130
133
|
this.onResize = (0, util_1.debounce)(() => {
|
|
131
134
|
this.forceFit();
|
|
132
135
|
}, 300);
|
|
133
136
|
this._container = normalizeContainer(container);
|
|
134
|
-
this.
|
|
137
|
+
this._emitter = new event_emitter_1.default();
|
|
138
|
+
this._context = { library: library_1.library, emitter: this._emitter, canvas };
|
|
135
139
|
this.bindAutoFit();
|
|
136
140
|
}
|
|
137
141
|
render() {
|
|
@@ -144,8 +148,9 @@ let Chart = class Chart extends composition_1.View {
|
|
|
144
148
|
// Create canvas if it does not exist.
|
|
145
149
|
this._context.canvas = Canvas(this._container, width, height, renderer, plugins);
|
|
146
150
|
}
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
return new Promise((resolve) => {
|
|
152
|
+
(0, runtime_1.render)(this.options(), this._context, () => resolve(this));
|
|
153
|
+
});
|
|
149
154
|
}
|
|
150
155
|
options() {
|
|
151
156
|
return optionsOf(this);
|
|
@@ -156,22 +161,36 @@ let Chart = class Chart extends composition_1.View {
|
|
|
156
161
|
context() {
|
|
157
162
|
return this._context;
|
|
158
163
|
}
|
|
164
|
+
on(event, callback, once) {
|
|
165
|
+
this._emitter.on(event, callback, once);
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
once(event, callback) {
|
|
169
|
+
this._emitter.once(event, callback);
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
172
|
+
emit(event, ...args) {
|
|
173
|
+
this._emitter.emit(event, ...args);
|
|
174
|
+
return this;
|
|
175
|
+
}
|
|
176
|
+
off(event, callback) {
|
|
177
|
+
this._emitter.off(event, callback);
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
159
180
|
destroy() {
|
|
160
181
|
const options = this.options();
|
|
161
|
-
|
|
162
|
-
(0, event_1.emitEvent)(on, event_1.CHART_LIFE_CIRCLE.BEFORE_DESTROY);
|
|
182
|
+
this.emit(event_1.CHART_LIFE_CIRCLE.BEFORE_DESTROY);
|
|
163
183
|
this.unbindAutoFit();
|
|
164
184
|
(0, runtime_1.destroy)(options, this._context);
|
|
165
185
|
// Remove the container.
|
|
166
186
|
removeContainer(this._container);
|
|
167
|
-
|
|
187
|
+
this.emit(event_1.CHART_LIFE_CIRCLE.AFTER_DESTROY);
|
|
168
188
|
}
|
|
169
189
|
clear() {
|
|
170
190
|
const options = this.options();
|
|
171
|
-
|
|
172
|
-
(0, event_1.emitEvent)(on, event_1.CHART_LIFE_CIRCLE.BEFORE_CLEAR);
|
|
191
|
+
this.emit(event_1.CHART_LIFE_CIRCLE.BEFORE_CLEAR);
|
|
173
192
|
(0, runtime_1.destroy)(options, this._context);
|
|
174
|
-
|
|
193
|
+
this.emit(event_1.CHART_LIFE_CIRCLE.AFTER_CLEAR);
|
|
175
194
|
}
|
|
176
195
|
forceFit() {
|
|
177
196
|
const { width, height, autoFit } = this.options();
|
|
@@ -183,13 +202,16 @@ let Chart = class Chart extends composition_1.View {
|
|
|
183
202
|
changeSize(adjustedWidth, adjustedHeight) {
|
|
184
203
|
const { width, height, on } = this.options();
|
|
185
204
|
if (width === adjustedWidth && height === adjustedHeight) {
|
|
186
|
-
return this;
|
|
205
|
+
return Promise.resolve(this);
|
|
187
206
|
}
|
|
188
|
-
|
|
207
|
+
this.emit(event_1.CHART_LIFE_CIRCLE.BEFORE_CHANGE_SIZE);
|
|
189
208
|
this.width(adjustedWidth);
|
|
190
209
|
this.height(adjustedHeight);
|
|
191
|
-
this.render();
|
|
192
|
-
(
|
|
210
|
+
const finished = this.render();
|
|
211
|
+
finished.then(() => {
|
|
212
|
+
this.emit(event_1.CHART_LIFE_CIRCLE.AFTER_CHANGE_SIZE);
|
|
213
|
+
});
|
|
214
|
+
return finished;
|
|
193
215
|
}
|
|
194
216
|
bindAutoFit() {
|
|
195
217
|
const options = this.options();
|
package/lib/api/chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","sourceRoot":"src/","sources":["api/chart.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"src/","sources":["api/chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4D;AAC5D,6CAA4D;AAC5D,iEAAuE;AACvE,qCAAsC;AACtC,wEAA+C;AAC/C,wCAAwD;AAExD,wCAA6C;AAC7C,0CAAmD;AAEnD,mCAKiB;AAOjB,iCAAoC;AACpC,+CAA+D;AAC/D,uCAAoC;AAEpC,SAAS,kBAAkB,CAAC,SAA+B;IACzD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClE,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;QACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,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C;QAC5B,IAAI,OAAO,EAAE;YACX,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;SAClD;IACH,CAAC;IAEO,aAAa;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC5B,IAAI,OAAO,EAAE;YACX,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;SACrD;IACH,CAAC;CACF,CAAA;AAhJY,KAAK;IADjB,IAAA,mBAAW,EAAC,aAAK,CAAC;GACN,KAAK,CAgJjB;AAhJY,sBAAK"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
|
+
import { Coordinate } from '@antv/coord';
|
|
1
3
|
import { Node } from '../node';
|
|
4
|
+
import { G2Theme, G2ViewDescriptor } from '../../runtime';
|
|
2
5
|
export declare class Base<Value extends Record<string, any> = Record<string, any>, ParentValue extends Record<string, any> = Record<string, any>, ChildValue extends Record<string, any> = Record<string, any>> extends Node<Value, ParentValue, ChildValue> {
|
|
3
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Get view instance by key.
|
|
8
|
+
*/
|
|
9
|
+
getView(): G2ViewDescriptor;
|
|
10
|
+
getCoordinate(): Coordinate;
|
|
11
|
+
getTheme(): G2Theme;
|
|
12
|
+
getGroup(): DisplayObject;
|
|
13
|
+
/**
|
|
14
|
+
* Show the view.
|
|
15
|
+
*/
|
|
16
|
+
show(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Hide the view.
|
|
19
|
+
*/
|
|
20
|
+
hide(): void;
|
|
4
21
|
}
|
|
@@ -10,7 +10,50 @@ exports.Base = void 0;
|
|
|
10
10
|
const props_1 = require("../props");
|
|
11
11
|
const node_1 = require("../node");
|
|
12
12
|
let Base = class Base extends node_1.Node {
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Get view instance by key.
|
|
15
|
+
*/
|
|
16
|
+
getView() {
|
|
17
|
+
const chart = this.root();
|
|
18
|
+
const { views } = chart.context();
|
|
19
|
+
if (!(views === null || views === void 0 ? void 0 : views.length))
|
|
20
|
+
return undefined;
|
|
21
|
+
return views.find((view) => view.key === this.attr('key'));
|
|
22
|
+
}
|
|
23
|
+
getCoordinate() {
|
|
24
|
+
var _a;
|
|
25
|
+
return (_a = this.getView()) === null || _a === void 0 ? void 0 : _a.coordinate;
|
|
26
|
+
}
|
|
27
|
+
getTheme() {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_a = this.getView()) === null || _a === void 0 ? void 0 : _a.theme;
|
|
30
|
+
}
|
|
31
|
+
getGroup() {
|
|
32
|
+
const key = this.attr('key');
|
|
33
|
+
if (!key)
|
|
34
|
+
return undefined;
|
|
35
|
+
const chart = this.root();
|
|
36
|
+
const chartGroup = chart.context().canvas.getRoot();
|
|
37
|
+
return chartGroup.getElementById(key);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Show the view.
|
|
41
|
+
*/
|
|
42
|
+
show() {
|
|
43
|
+
const group = this.getGroup();
|
|
44
|
+
if (!group)
|
|
45
|
+
return;
|
|
46
|
+
!group.isVisible() && group.setAttribute('visibility', 'visible');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Hide the view.
|
|
50
|
+
*/
|
|
51
|
+
hide() {
|
|
52
|
+
const group = this.getGroup();
|
|
53
|
+
if (!group)
|
|
54
|
+
return;
|
|
55
|
+
group.isVisible() && group.setAttribute('visibility', 'hidden');
|
|
56
|
+
}
|
|
14
57
|
};
|
|
15
58
|
Base = __decorate([
|
|
16
59
|
(0, props_1.defineProps)([{ name: 'on', type: 'event' }])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"src/","sources":["api/composition/base.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"base.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S,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,KAAK,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAhDY,IAAI;IADhB,IAAA,mBAAW,EAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;GAChC,IAAI,CAgDhB;AAhDY,oBAAI"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DisplayObject } from '@antv/g';
|
|
2
|
+
import { Node } from '../node';
|
|
3
|
+
import { G2MarkState, Scale } from '../../runtime';
|
|
4
|
+
export declare class MarkBase<Value extends Record<string, any> = Record<string, any>, ParentValue extends Record<string, any> = Record<string, any>, ChildValue extends Record<string, any> = Record<string, any>> extends Node<Value, ParentValue, ChildValue> {
|
|
5
|
+
changeData(data: any): Promise<import("..").Chart>;
|
|
6
|
+
/**
|
|
7
|
+
* Get mark from chart views.
|
|
8
|
+
*/
|
|
9
|
+
getMark(): G2MarkState;
|
|
10
|
+
/**
|
|
11
|
+
* Get all scales instance.
|
|
12
|
+
*/
|
|
13
|
+
getScale(): Record<string, Scale>;
|
|
14
|
+
/**
|
|
15
|
+
* Get the scale instance by channel.
|
|
16
|
+
*/
|
|
17
|
+
getScaleByChannel(channel: string): Scale;
|
|
18
|
+
/**
|
|
19
|
+
* Get canvas group.
|
|
20
|
+
*/
|
|
21
|
+
getGroup(): DisplayObject;
|
|
22
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarkBase = void 0;
|
|
4
|
+
const node_1 = require("../node");
|
|
5
|
+
class MarkBase extends node_1.Node {
|
|
6
|
+
changeData(data) {
|
|
7
|
+
const chart = this.root();
|
|
8
|
+
if (!chart)
|
|
9
|
+
return;
|
|
10
|
+
this.attr('data', data);
|
|
11
|
+
return chart === null || chart === void 0 ? void 0 : chart.render();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get mark from chart views.
|
|
15
|
+
*/
|
|
16
|
+
getMark() {
|
|
17
|
+
var _a;
|
|
18
|
+
const chartView = (_a = this.root()) === null || _a === void 0 ? void 0 : _a.getView();
|
|
19
|
+
if (!chartView)
|
|
20
|
+
return undefined;
|
|
21
|
+
const { markState } = chartView;
|
|
22
|
+
const markKey = Array.from(markState.keys()).find((item) => item.key === this.attr('key'));
|
|
23
|
+
return markState.get(markKey);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get all scales instance.
|
|
27
|
+
*/
|
|
28
|
+
getScale() {
|
|
29
|
+
var _a;
|
|
30
|
+
const chartView = (_a = this.root()) === null || _a === void 0 ? void 0 : _a.getView();
|
|
31
|
+
if (!chartView)
|
|
32
|
+
return undefined;
|
|
33
|
+
return chartView === null || chartView === void 0 ? void 0 : chartView.scale;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get the scale instance by channel.
|
|
37
|
+
*/
|
|
38
|
+
getScaleByChannel(channel) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const chartView = (_a = this.root()) === null || _a === void 0 ? void 0 : _a.getView();
|
|
41
|
+
if (!chartView)
|
|
42
|
+
return undefined;
|
|
43
|
+
return (_b = chartView === null || chartView === void 0 ? void 0 : chartView.scale) === null || _b === void 0 ? void 0 : _b[channel];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get canvas group.
|
|
47
|
+
*/
|
|
48
|
+
getGroup() {
|
|
49
|
+
const key = this.attr('key');
|
|
50
|
+
if (!key)
|
|
51
|
+
return undefined;
|
|
52
|
+
const chart = this.root();
|
|
53
|
+
const chartGroup = chart.context().canvas.getRoot();
|
|
54
|
+
return chartGroup.getElementById(key);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.MarkBase = MarkBase;
|
|
58
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"src/","sources":["api/mark/base.ts"],"names":[],"mappings":";;;AACA,kCAA+B;AAG/B,MAAa,QAIX,SAAQ,WAAoC;IAC5C,UAAU,CAAC,IAAS;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxB,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,OAAO;;QACL,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,IAAI,EAAE,0CAAE,OAAO,EAAE,CAAC;QACzC,IAAI,CAAC,SAAS;YAAE,OAAO,SAAS,CAAC;QACjC,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;QAChC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAC/C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CACxC,CAAC;QACF,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,QAAQ;;QACN,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,IAAI,EAAE,0CAAE,OAAO,EAAE,CAAC;QACzC,IAAI,CAAC,SAAS;YAAE,OAAO,SAAS,CAAC;QACjC,OAAO,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,OAAe;;QAC/B,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,IAAI,EAAE,0CAAE,OAAO,EAAE,CAAC;QACzC,IAAI,CAAC,SAAS;YAAE,OAAO,SAAS,CAAC;QACjC,OAAO,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAG,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC1B,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpD,OAAO,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACF;AArDD,4BAqDC"}
|
package/lib/api/mark/mark.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IntervalGeometry, RectGeometry, AreaGeometry, PointGeometry, CellGeometry, VectorGeometry, LinkGeometry, PolygonGeometry, ImageGeometry, TextGeometry, BoxGeometry, LineGeometry, LineXMark, LineYMark, RangeMark, RangeXMark, RangeYMark, ConnectorMark, SankeyMark, BoxPlotMark, ShapeMark, TreemapMark, ForceGraphMark, PackMark, TreeMark, WordCloudMark } from '../../spec';
|
|
2
2
|
import { NodePropertyDescriptor } from '../props';
|
|
3
|
-
import { Node } from '../node';
|
|
4
3
|
import { Concrete } from '../types';
|
|
4
|
+
import { MarkBase } from './base';
|
|
5
5
|
import { API } from './types';
|
|
6
6
|
export interface Interval extends API<Concrete<IntervalGeometry>, Interval> {
|
|
7
7
|
type: 'interval';
|
|
@@ -82,12 +82,6 @@ export interface WordCloud extends API<Concrete<WordCloudMark>, WordCloud> {
|
|
|
82
82
|
type: 'wordCloud';
|
|
83
83
|
}
|
|
84
84
|
export declare const props: NodePropertyDescriptor[];
|
|
85
|
-
export declare class MarkBase<Value extends Record<string, any> = Record<string, any>, ParentValue extends Record<string, any> = Record<string, any>, ChildValue extends Record<string, any> = Record<string, any>> extends Node<Value, ParentValue, ChildValue> {
|
|
86
|
-
changeData(data: any): void;
|
|
87
|
-
getMark(): void;
|
|
88
|
-
getScale(): void;
|
|
89
|
-
getGroup(): void;
|
|
90
|
-
}
|
|
91
85
|
export declare class Interval extends MarkBase<IntervalGeometry> {
|
|
92
86
|
constructor();
|
|
93
87
|
}
|
package/lib/api/mark/mark.js
CHANGED
|
@@ -6,9 +6,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.WordCloud = exports.Tree = exports.ForceGraph = exports.Pack = exports.Boxplot = exports.Treemap = exports.Sankey = exports.Shape = exports.Connector = exports.RangeY = exports.RangeX = exports.Range = exports.LineY = exports.LineX = exports.Box = exports.Text = exports.Image = exports.Polygon = exports.Link = exports.Vector = exports.Cell = exports.Line = exports.Area = exports.Point = exports.Rect = exports.Interval = exports.
|
|
9
|
+
exports.WordCloud = exports.Tree = exports.ForceGraph = exports.Pack = exports.Boxplot = exports.Treemap = exports.Sankey = exports.Shape = exports.Connector = exports.RangeY = exports.RangeX = exports.Range = exports.LineY = exports.LineX = exports.Box = exports.Text = exports.Image = exports.Polygon = exports.Link = exports.Vector = exports.Cell = exports.Line = exports.Area = exports.Point = exports.Rect = exports.Interval = exports.props = void 0;
|
|
10
10
|
const props_1 = require("../props");
|
|
11
|
-
const
|
|
11
|
+
const base_1 = require("./base");
|
|
12
12
|
exports.props = [
|
|
13
13
|
{ name: 'encode', type: 'object' },
|
|
14
14
|
{ name: 'scale', type: 'object' },
|
|
@@ -22,20 +22,7 @@ exports.props = [
|
|
|
22
22
|
{ name: 'slider', type: 'object' },
|
|
23
23
|
{ name: 'scrollbar', type: 'object' },
|
|
24
24
|
];
|
|
25
|
-
class
|
|
26
|
-
changeData(data) {
|
|
27
|
-
const chart = this.root();
|
|
28
|
-
if (!chart)
|
|
29
|
-
return;
|
|
30
|
-
this.attr('data', data);
|
|
31
|
-
chart === null || chart === void 0 ? void 0 : chart.render();
|
|
32
|
-
}
|
|
33
|
-
getMark() { }
|
|
34
|
-
getScale() { }
|
|
35
|
-
getGroup() { }
|
|
36
|
-
}
|
|
37
|
-
exports.MarkBase = MarkBase;
|
|
38
|
-
let Interval = class Interval extends MarkBase {
|
|
25
|
+
let Interval = class Interval extends base_1.MarkBase {
|
|
39
26
|
constructor() {
|
|
40
27
|
super({}, 'interval');
|
|
41
28
|
}
|
|
@@ -44,7 +31,7 @@ Interval = __decorate([
|
|
|
44
31
|
(0, props_1.defineProps)(exports.props)
|
|
45
32
|
], Interval);
|
|
46
33
|
exports.Interval = Interval;
|
|
47
|
-
let Rect = class Rect extends MarkBase {
|
|
34
|
+
let Rect = class Rect extends base_1.MarkBase {
|
|
48
35
|
constructor() {
|
|
49
36
|
super({}, 'rect');
|
|
50
37
|
}
|
|
@@ -53,7 +40,7 @@ Rect = __decorate([
|
|
|
53
40
|
(0, props_1.defineProps)(exports.props)
|
|
54
41
|
], Rect);
|
|
55
42
|
exports.Rect = Rect;
|
|
56
|
-
let Point = class Point extends MarkBase {
|
|
43
|
+
let Point = class Point extends base_1.MarkBase {
|
|
57
44
|
constructor() {
|
|
58
45
|
super({}, 'point');
|
|
59
46
|
}
|
|
@@ -62,7 +49,7 @@ Point = __decorate([
|
|
|
62
49
|
(0, props_1.defineProps)(exports.props)
|
|
63
50
|
], Point);
|
|
64
51
|
exports.Point = Point;
|
|
65
|
-
let Area = class Area extends MarkBase {
|
|
52
|
+
let Area = class Area extends base_1.MarkBase {
|
|
66
53
|
constructor() {
|
|
67
54
|
super({}, 'area');
|
|
68
55
|
}
|
|
@@ -71,7 +58,7 @@ Area = __decorate([
|
|
|
71
58
|
(0, props_1.defineProps)(exports.props)
|
|
72
59
|
], Area);
|
|
73
60
|
exports.Area = Area;
|
|
74
|
-
let Line = class Line extends MarkBase {
|
|
61
|
+
let Line = class Line extends base_1.MarkBase {
|
|
75
62
|
constructor() {
|
|
76
63
|
super({}, 'line');
|
|
77
64
|
}
|
|
@@ -80,7 +67,7 @@ Line = __decorate([
|
|
|
80
67
|
(0, props_1.defineProps)(exports.props)
|
|
81
68
|
], Line);
|
|
82
69
|
exports.Line = Line;
|
|
83
|
-
let Cell = class Cell extends MarkBase {
|
|
70
|
+
let Cell = class Cell extends base_1.MarkBase {
|
|
84
71
|
constructor() {
|
|
85
72
|
super({}, 'cell');
|
|
86
73
|
}
|
|
@@ -89,7 +76,7 @@ Cell = __decorate([
|
|
|
89
76
|
(0, props_1.defineProps)(exports.props)
|
|
90
77
|
], Cell);
|
|
91
78
|
exports.Cell = Cell;
|
|
92
|
-
let Vector = class Vector extends MarkBase {
|
|
79
|
+
let Vector = class Vector extends base_1.MarkBase {
|
|
93
80
|
constructor() {
|
|
94
81
|
super({}, 'vector');
|
|
95
82
|
}
|
|
@@ -98,7 +85,7 @@ Vector = __decorate([
|
|
|
98
85
|
(0, props_1.defineProps)(exports.props)
|
|
99
86
|
], Vector);
|
|
100
87
|
exports.Vector = Vector;
|
|
101
|
-
let Link = class Link extends MarkBase {
|
|
88
|
+
let Link = class Link extends base_1.MarkBase {
|
|
102
89
|
constructor() {
|
|
103
90
|
super({}, 'link');
|
|
104
91
|
}
|
|
@@ -107,7 +94,7 @@ Link = __decorate([
|
|
|
107
94
|
(0, props_1.defineProps)(exports.props)
|
|
108
95
|
], Link);
|
|
109
96
|
exports.Link = Link;
|
|
110
|
-
let Polygon = class Polygon extends MarkBase {
|
|
97
|
+
let Polygon = class Polygon extends base_1.MarkBase {
|
|
111
98
|
constructor() {
|
|
112
99
|
super({}, 'polygon');
|
|
113
100
|
}
|
|
@@ -116,7 +103,7 @@ Polygon = __decorate([
|
|
|
116
103
|
(0, props_1.defineProps)(exports.props)
|
|
117
104
|
], Polygon);
|
|
118
105
|
exports.Polygon = Polygon;
|
|
119
|
-
let Image = class Image extends MarkBase {
|
|
106
|
+
let Image = class Image extends base_1.MarkBase {
|
|
120
107
|
constructor() {
|
|
121
108
|
super({}, 'image');
|
|
122
109
|
}
|
|
@@ -125,7 +112,7 @@ Image = __decorate([
|
|
|
125
112
|
(0, props_1.defineProps)(exports.props)
|
|
126
113
|
], Image);
|
|
127
114
|
exports.Image = Image;
|
|
128
|
-
let Text = class Text extends MarkBase {
|
|
115
|
+
let Text = class Text extends base_1.MarkBase {
|
|
129
116
|
constructor() {
|
|
130
117
|
super({}, 'text');
|
|
131
118
|
}
|
|
@@ -134,7 +121,7 @@ Text = __decorate([
|
|
|
134
121
|
(0, props_1.defineProps)(exports.props)
|
|
135
122
|
], Text);
|
|
136
123
|
exports.Text = Text;
|
|
137
|
-
let Box = class Box extends MarkBase {
|
|
124
|
+
let Box = class Box extends base_1.MarkBase {
|
|
138
125
|
constructor() {
|
|
139
126
|
super({}, 'box');
|
|
140
127
|
}
|
|
@@ -143,7 +130,7 @@ Box = __decorate([
|
|
|
143
130
|
(0, props_1.defineProps)(exports.props)
|
|
144
131
|
], Box);
|
|
145
132
|
exports.Box = Box;
|
|
146
|
-
let LineX = class LineX extends MarkBase {
|
|
133
|
+
let LineX = class LineX extends base_1.MarkBase {
|
|
147
134
|
constructor() {
|
|
148
135
|
super({}, 'lineX');
|
|
149
136
|
}
|
|
@@ -152,7 +139,7 @@ LineX = __decorate([
|
|
|
152
139
|
(0, props_1.defineProps)(exports.props)
|
|
153
140
|
], LineX);
|
|
154
141
|
exports.LineX = LineX;
|
|
155
|
-
let LineY = class LineY extends MarkBase {
|
|
142
|
+
let LineY = class LineY extends base_1.MarkBase {
|
|
156
143
|
constructor() {
|
|
157
144
|
super({}, 'lineY');
|
|
158
145
|
}
|
|
@@ -161,7 +148,7 @@ LineY = __decorate([
|
|
|
161
148
|
(0, props_1.defineProps)(exports.props)
|
|
162
149
|
], LineY);
|
|
163
150
|
exports.LineY = LineY;
|
|
164
|
-
let Range = class Range extends MarkBase {
|
|
151
|
+
let Range = class Range extends base_1.MarkBase {
|
|
165
152
|
constructor() {
|
|
166
153
|
super({}, 'range');
|
|
167
154
|
}
|
|
@@ -170,7 +157,7 @@ Range = __decorate([
|
|
|
170
157
|
(0, props_1.defineProps)(exports.props)
|
|
171
158
|
], Range);
|
|
172
159
|
exports.Range = Range;
|
|
173
|
-
let RangeX = class RangeX extends MarkBase {
|
|
160
|
+
let RangeX = class RangeX extends base_1.MarkBase {
|
|
174
161
|
constructor() {
|
|
175
162
|
super({}, 'rangeX');
|
|
176
163
|
}
|
|
@@ -179,7 +166,7 @@ RangeX = __decorate([
|
|
|
179
166
|
(0, props_1.defineProps)(exports.props)
|
|
180
167
|
], RangeX);
|
|
181
168
|
exports.RangeX = RangeX;
|
|
182
|
-
let RangeY = class RangeY extends MarkBase {
|
|
169
|
+
let RangeY = class RangeY extends base_1.MarkBase {
|
|
183
170
|
constructor() {
|
|
184
171
|
super({}, 'rangeY');
|
|
185
172
|
}
|
|
@@ -188,7 +175,7 @@ RangeY = __decorate([
|
|
|
188
175
|
(0, props_1.defineProps)(exports.props)
|
|
189
176
|
], RangeY);
|
|
190
177
|
exports.RangeY = RangeY;
|
|
191
|
-
let Connector = class Connector extends MarkBase {
|
|
178
|
+
let Connector = class Connector extends base_1.MarkBase {
|
|
192
179
|
constructor() {
|
|
193
180
|
super({}, 'connector');
|
|
194
181
|
}
|
|
@@ -197,7 +184,7 @@ Connector = __decorate([
|
|
|
197
184
|
(0, props_1.defineProps)(exports.props)
|
|
198
185
|
], Connector);
|
|
199
186
|
exports.Connector = Connector;
|
|
200
|
-
let Shape = class Shape extends MarkBase {
|
|
187
|
+
let Shape = class Shape extends base_1.MarkBase {
|
|
201
188
|
constructor() {
|
|
202
189
|
super({}, 'shape');
|
|
203
190
|
}
|
|
@@ -206,7 +193,7 @@ Shape = __decorate([
|
|
|
206
193
|
(0, props_1.defineProps)(exports.props)
|
|
207
194
|
], Shape);
|
|
208
195
|
exports.Shape = Shape;
|
|
209
|
-
let Sankey = class Sankey extends MarkBase {
|
|
196
|
+
let Sankey = class Sankey extends base_1.MarkBase {
|
|
210
197
|
constructor() {
|
|
211
198
|
super({}, 'sankey');
|
|
212
199
|
}
|
|
@@ -215,7 +202,7 @@ Sankey = __decorate([
|
|
|
215
202
|
(0, props_1.defineProps)([...exports.props, { name: 'layout', type: 'value' }])
|
|
216
203
|
], Sankey);
|
|
217
204
|
exports.Sankey = Sankey;
|
|
218
|
-
let Treemap = class Treemap extends MarkBase {
|
|
205
|
+
let Treemap = class Treemap extends base_1.MarkBase {
|
|
219
206
|
constructor() {
|
|
220
207
|
super({}, 'treemap');
|
|
221
208
|
}
|
|
@@ -224,7 +211,7 @@ Treemap = __decorate([
|
|
|
224
211
|
(0, props_1.defineProps)([...exports.props, { name: 'layout', type: 'value' }])
|
|
225
212
|
], Treemap);
|
|
226
213
|
exports.Treemap = Treemap;
|
|
227
|
-
let Boxplot = class Boxplot extends MarkBase {
|
|
214
|
+
let Boxplot = class Boxplot extends base_1.MarkBase {
|
|
228
215
|
constructor() {
|
|
229
216
|
super({}, 'boxplot');
|
|
230
217
|
}
|
|
@@ -233,7 +220,7 @@ Boxplot = __decorate([
|
|
|
233
220
|
(0, props_1.defineProps)(exports.props)
|
|
234
221
|
], Boxplot);
|
|
235
222
|
exports.Boxplot = Boxplot;
|
|
236
|
-
let Pack = class Pack extends MarkBase {
|
|
223
|
+
let Pack = class Pack extends base_1.MarkBase {
|
|
237
224
|
constructor() {
|
|
238
225
|
super({}, 'pack');
|
|
239
226
|
}
|
|
@@ -242,7 +229,7 @@ Pack = __decorate([
|
|
|
242
229
|
(0, props_1.defineProps)([...exports.props, { name: 'layout', type: 'value' }])
|
|
243
230
|
], Pack);
|
|
244
231
|
exports.Pack = Pack;
|
|
245
|
-
let ForceGraph = class ForceGraph extends MarkBase {
|
|
232
|
+
let ForceGraph = class ForceGraph extends base_1.MarkBase {
|
|
246
233
|
constructor() {
|
|
247
234
|
super({}, 'forceGraph');
|
|
248
235
|
}
|
|
@@ -251,7 +238,7 @@ ForceGraph = __decorate([
|
|
|
251
238
|
(0, props_1.defineProps)([...exports.props, { name: 'layout', type: 'value' }])
|
|
252
239
|
], ForceGraph);
|
|
253
240
|
exports.ForceGraph = ForceGraph;
|
|
254
|
-
let Tree = class Tree extends MarkBase {
|
|
241
|
+
let Tree = class Tree extends base_1.MarkBase {
|
|
255
242
|
constructor() {
|
|
256
243
|
super({}, 'tree');
|
|
257
244
|
}
|
|
@@ -260,7 +247,7 @@ Tree = __decorate([
|
|
|
260
247
|
(0, props_1.defineProps)([...exports.props, { name: 'layout', type: 'value' }])
|
|
261
248
|
], Tree);
|
|
262
249
|
exports.Tree = Tree;
|
|
263
|
-
let WordCloud = class WordCloud extends MarkBase {
|
|
250
|
+
let WordCloud = class WordCloud extends base_1.MarkBase {
|
|
264
251
|
constructor() {
|
|
265
252
|
super({}, 'wordCloud');
|
|
266
253
|
}
|