@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
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from '@antv/event-emitter';
|
|
2
2
|
import type { DisplayObject } from '@antv/g';
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas, IAnimation as GAnimation } from '@antv/g';
|
|
4
4
|
import {
|
|
5
|
+
G2Title,
|
|
6
|
+
G2ViewDescriptor,
|
|
7
|
+
GuideComponentPosition,
|
|
8
|
+
Layout,
|
|
9
|
+
Primitive,
|
|
10
|
+
} from './common';
|
|
11
|
+
import {
|
|
12
|
+
AdjustComponent,
|
|
13
|
+
AnimationComponent,
|
|
14
|
+
CompositionComponent,
|
|
15
|
+
CoordinateComponent,
|
|
5
16
|
G2BaseComponent,
|
|
6
|
-
StatisticComponent,
|
|
7
|
-
ThemeComponent,
|
|
8
17
|
G2ComponentNamespaces,
|
|
9
|
-
CoordinateComponent,
|
|
10
|
-
ScaleComponent,
|
|
11
|
-
InferComponent,
|
|
12
|
-
ShapeComponent,
|
|
13
|
-
PaletteComponent,
|
|
14
18
|
GuideComponentComponent,
|
|
15
|
-
|
|
19
|
+
InferComponent,
|
|
16
20
|
InteractionComponent,
|
|
17
|
-
CompositionComponent,
|
|
18
|
-
AdjustComponent,
|
|
19
|
-
Scale,
|
|
20
21
|
LabelTransformComponent,
|
|
22
|
+
PaletteComponent,
|
|
23
|
+
Scale,
|
|
24
|
+
ScaleComponent,
|
|
25
|
+
ShapeComponent,
|
|
26
|
+
StatisticComponent,
|
|
27
|
+
ThemeComponent,
|
|
21
28
|
} from './component';
|
|
22
29
|
|
|
23
|
-
import {
|
|
30
|
+
import { DataComponent } from './data';
|
|
24
31
|
import { EncodeComponent } from './encode';
|
|
25
32
|
import { MarkComponent } from './mark';
|
|
26
|
-
import {
|
|
33
|
+
import { TransformComponent } from './transform';
|
|
27
34
|
|
|
28
35
|
export type G2ViewTree = {
|
|
29
36
|
width?: number;
|
|
@@ -46,9 +53,10 @@ export type G2Library = Record<
|
|
|
46
53
|
export type G2Context = {
|
|
47
54
|
library?: G2Library;
|
|
48
55
|
canvas?: Canvas;
|
|
56
|
+
emitter?: EventEmitter;
|
|
49
57
|
group?: DisplayObject;
|
|
50
58
|
animations?: GAnimation[];
|
|
51
|
-
|
|
59
|
+
views?: G2ViewDescriptor[];
|
|
52
60
|
};
|
|
53
61
|
|
|
54
62
|
export type G2View = {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const ContinuousScale = {
|
|
2
|
+
linear: 'linear',
|
|
3
|
+
identity: 'identity',
|
|
4
|
+
log: 'log',
|
|
5
|
+
pow: 'pow',
|
|
6
|
+
sqrt: 'sqrt',
|
|
7
|
+
sequential: 'sequential',
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
export const DistributionScale = {
|
|
11
|
+
threshold: 'threshold',
|
|
12
|
+
quantize: 'quantize',
|
|
13
|
+
quantile: 'quantile',
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export const DiscreteScale = {
|
|
17
|
+
ordinal: 'ordinal',
|
|
18
|
+
band: 'band',
|
|
19
|
+
point: 'point',
|
|
20
|
+
} as const;
|
|
@@ -70,11 +70,12 @@ type InteractionTheme = {
|
|
|
70
70
|
|
|
71
71
|
type ComponentTheme = {
|
|
72
72
|
axis?: any;
|
|
73
|
-
|
|
73
|
+
axisLinear?: any;
|
|
74
74
|
axisTop?: any;
|
|
75
75
|
axisBottom?: any;
|
|
76
76
|
axisLeft?: any;
|
|
77
77
|
axisRight?: any;
|
|
78
|
+
axisRadar?: any;
|
|
78
79
|
legend?: any;
|
|
79
80
|
continuousLegend?: any;
|
|
80
81
|
label?: LabelStyleProps;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { curveStepAfter } from 'd3-shape';
|
|
2
|
+
import { ShapeComponent as SC } from '../../runtime';
|
|
3
|
+
import { Curve } from './curve';
|
|
4
|
+
|
|
5
|
+
export type HVOptions = Record<string, any>;
|
|
6
|
+
|
|
7
|
+
export const HV: SC<HVOptions> = (options) => {
|
|
8
|
+
return (P, value, coordinate, theme) => {
|
|
9
|
+
return Curve({ curve: curveStepAfter, ...options })(
|
|
10
|
+
P,
|
|
11
|
+
value,
|
|
12
|
+
coordinate,
|
|
13
|
+
theme,
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
HV.props = {
|
|
19
|
+
...Curve.props,
|
|
20
|
+
};
|
|
@@ -2,14 +2,14 @@ import { curveStep } from 'd3-shape';
|
|
|
2
2
|
import { ShapeComponent as SC } from '../../runtime';
|
|
3
3
|
import { Curve } from './curve';
|
|
4
4
|
|
|
5
|
-
export type
|
|
5
|
+
export type HVHOptions = Record<string, any>;
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const HVH: SC<HVHOptions> = (options) => {
|
|
8
8
|
return (P, value, coordinate, theme) => {
|
|
9
9
|
return Curve({ curve: curveStep, ...options })(P, value, coordinate, theme);
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
HVH.props = {
|
|
14
14
|
...Curve.props,
|
|
15
15
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { curveStepBefore } from 'd3-shape';
|
|
2
|
+
import { ShapeComponent as SC } from '../../runtime';
|
|
3
|
+
import { Curve } from './curve';
|
|
4
|
+
|
|
5
|
+
export type VHOptions = Record<string, any>;
|
|
6
|
+
|
|
7
|
+
export const VH: SC<VHOptions> = (options) => {
|
|
8
|
+
return (P, value, coordinate, theme) => {
|
|
9
|
+
return Curve({ curve: curveStepBefore, ...options })(
|
|
10
|
+
P,
|
|
11
|
+
value,
|
|
12
|
+
coordinate,
|
|
13
|
+
theme,
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
VH.props = {
|
|
19
|
+
...Curve.props,
|
|
20
|
+
};
|
package/src/shape/index.ts
CHANGED
|
@@ -31,7 +31,9 @@ export { Text } from './text/text';
|
|
|
31
31
|
export { Badge } from './text/badge';
|
|
32
32
|
export { Area } from './area/area';
|
|
33
33
|
export { Smooth as SmoothArea } from './area/smooth';
|
|
34
|
-
export {
|
|
34
|
+
export { HVH as HVHArea } from './area/hvh';
|
|
35
|
+
export { VH as VHArea } from './area/vh';
|
|
36
|
+
export { HV as HVArea } from './area/hv';
|
|
35
37
|
export { Link } from './link/link';
|
|
36
38
|
export { Smooth as SmoothEdge } from './link/smooth';
|
|
37
39
|
export { VHV as VHVEdge } from './link/vhv';
|
|
@@ -83,7 +85,10 @@ export type { TextOptions } from './text/text';
|
|
|
83
85
|
export type { BadgeOptions } from './text/badge';
|
|
84
86
|
export type { AreaOptions } from './area/area';
|
|
85
87
|
export type { SmoothOptions as SmoothAreaOptions } from './area/smooth';
|
|
86
|
-
export type {
|
|
88
|
+
export type { HVHOptions as HVHAreaOptions } from './area/hvh';
|
|
89
|
+
export type { VHOptions as VHAreaOptions } from './area/vh';
|
|
90
|
+
export type { HVOptions as HVAreaOptions } from './area/hv';
|
|
91
|
+
|
|
87
92
|
export type { LinkOptions } from './link/link';
|
|
88
93
|
export type { ImageOptions } from './image/image';
|
|
89
94
|
export type { PolygonOptions } from './polygon/polygon';
|
|
@@ -17,6 +17,72 @@ export type ColorOptions = {
|
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
// Render rect in different coordinate.
|
|
21
|
+
export function rect(
|
|
22
|
+
points,
|
|
23
|
+
value,
|
|
24
|
+
coordinate,
|
|
25
|
+
style: Record<string, any> = {},
|
|
26
|
+
) {
|
|
27
|
+
const {
|
|
28
|
+
inset = 0,
|
|
29
|
+
radius = 0,
|
|
30
|
+
insetLeft = inset,
|
|
31
|
+
insetTop = inset,
|
|
32
|
+
insetRight = inset,
|
|
33
|
+
insetBottom = inset,
|
|
34
|
+
radiusBottomLeft = radius,
|
|
35
|
+
radiusBottomRight = radius,
|
|
36
|
+
radiusTopLeft = radius,
|
|
37
|
+
radiusTopRight = radius,
|
|
38
|
+
...rest
|
|
39
|
+
} = style;
|
|
40
|
+
if (!isPolar(coordinate) && !isHelix(coordinate)) {
|
|
41
|
+
const tpShape = !!isTranspose(coordinate);
|
|
42
|
+
|
|
43
|
+
const [p0, , p2] = tpShape ? reorder(points) : points;
|
|
44
|
+
const [x, y] = p0;
|
|
45
|
+
const [width, height] = sub(p2, p0);
|
|
46
|
+
// Deal with width or height is negative.
|
|
47
|
+
const absX = width > 0 ? x : x + width;
|
|
48
|
+
const absY = height > 0 ? y : y + height;
|
|
49
|
+
const absWidth = Math.abs(width);
|
|
50
|
+
const absHeight = Math.abs(height);
|
|
51
|
+
const finalX = absX + insetLeft;
|
|
52
|
+
const finalY = absY + insetTop;
|
|
53
|
+
const finalWidth = absWidth - (insetLeft + insetRight);
|
|
54
|
+
const finalHeight = absHeight - (insetTop + insetBottom);
|
|
55
|
+
|
|
56
|
+
return select(new Rect({}))
|
|
57
|
+
.style('x', finalX)
|
|
58
|
+
.style('y', finalY)
|
|
59
|
+
.style('width', finalWidth)
|
|
60
|
+
.style('height', finalHeight)
|
|
61
|
+
.style('radius', [
|
|
62
|
+
radiusTopLeft,
|
|
63
|
+
radiusTopRight,
|
|
64
|
+
radiusBottomRight,
|
|
65
|
+
radiusBottomLeft,
|
|
66
|
+
])
|
|
67
|
+
.call(applyStyle, rest)
|
|
68
|
+
.node();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Render path in polar coordinate.
|
|
72
|
+
const { y, y1 } = value;
|
|
73
|
+
const center = coordinate.getCenter() as Vector2;
|
|
74
|
+
const arcObject = getArcObject(coordinate, points, [y, y1]);
|
|
75
|
+
const path = arc()
|
|
76
|
+
.cornerRadius(radius as number)
|
|
77
|
+
.padAngle((inset * Math.PI) / 180);
|
|
78
|
+
|
|
79
|
+
return select(new Path({}))
|
|
80
|
+
.style('path', path(arcObject))
|
|
81
|
+
.style('transform', `translate(${center[0]}, ${center[1]})`)
|
|
82
|
+
.call(applyStyle, rest)
|
|
83
|
+
.node();
|
|
84
|
+
}
|
|
85
|
+
|
|
20
86
|
/**
|
|
21
87
|
* Render rect in different coordinate.
|
|
22
88
|
* Calc arc path based on control points directly rather startAngle, endAngle, innerRadius,
|
|
@@ -36,7 +102,6 @@ export const Color: SC<ColorOptions> = (options) => {
|
|
|
36
102
|
return (points, value, coordinate, theme) => {
|
|
37
103
|
const { mark, shape, defaultShape } = value;
|
|
38
104
|
const {
|
|
39
|
-
// [colorAttribute]: defaultColor,
|
|
40
105
|
defaultColor,
|
|
41
106
|
radius: defaultRadius = 0,
|
|
42
107
|
...defaults
|
|
@@ -55,70 +120,37 @@ export const Color: SC<ColorOptions> = (options) => {
|
|
|
55
120
|
innerRadiusTopRight = innerRadius,
|
|
56
121
|
innerRadiusBottomRight = innerRadius,
|
|
57
122
|
innerRadiusBottomLeft = innerRadius,
|
|
123
|
+
lineWidth = colorAttribute === 'stroke' || stroke ? defaultLineWidth : 0,
|
|
58
124
|
inset = 0,
|
|
59
125
|
insetLeft = inset,
|
|
60
126
|
insetRight = inset,
|
|
61
127
|
insetBottom = inset,
|
|
62
128
|
insetTop = inset,
|
|
63
|
-
lineWidth = colorAttribute === 'stroke' || stroke ? defaultLineWidth : 0,
|
|
64
129
|
...rest
|
|
65
130
|
} = style;
|
|
66
131
|
const { color = defaultColor, opacity } = value;
|
|
67
132
|
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const finalWidth = absWidth - (insetLeft + insetRight);
|
|
83
|
-
const finalHeight = absHeight - (insetTop + insetBottom);
|
|
84
|
-
|
|
85
|
-
return select(new Rect({}))
|
|
86
|
-
.call(applyStyle, defaults)
|
|
87
|
-
.style('lineWidth', lineWidth)
|
|
88
|
-
.style('x', finalX)
|
|
89
|
-
.style('y', finalY)
|
|
90
|
-
.style('width', finalWidth)
|
|
91
|
-
.style('height', finalHeight)
|
|
92
|
-
.style('stroke', stroke === undefined ? color : stroke)
|
|
93
|
-
.style(toOpacityKey(options), opacity)
|
|
94
|
-
.style(colorAttribute, color)
|
|
95
|
-
.style('radius', [
|
|
96
|
-
first ? radiusTopLeft : innerRadiusTopLeft,
|
|
97
|
-
first ? radiusTopRight : innerRadiusTopRight,
|
|
98
|
-
last ? radiusBottomRight : innerRadiusBottomRight,
|
|
99
|
-
last ? radiusBottomLeft : innerRadiusBottomLeft,
|
|
100
|
-
])
|
|
101
|
-
.call(applyStyle, rest)
|
|
102
|
-
.node();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Render path in polar coordinate.
|
|
106
|
-
const { y, y1 } = value;
|
|
107
|
-
const center = coordinate.getCenter() as Vector2;
|
|
108
|
-
const arcObject = getArcObject(coordinate, points, [y, y1]);
|
|
109
|
-
const path = arc()
|
|
110
|
-
.cornerRadius(radius as number)
|
|
111
|
-
.padAngle((inset * Math.PI) / 180);
|
|
133
|
+
// Extended style, which is not supported by native g shape,
|
|
134
|
+
// should apply at first.
|
|
135
|
+
const extendedStyle = {
|
|
136
|
+
radius,
|
|
137
|
+
radiusTopLeft: first ? radiusTopLeft : innerRadiusTopLeft,
|
|
138
|
+
radiusTopRight: first ? radiusTopRight : innerRadiusTopRight,
|
|
139
|
+
radiusBottomRight: last ? radiusBottomRight : innerRadiusBottomRight,
|
|
140
|
+
radiusBottomLeft: last ? radiusBottomLeft : innerRadiusBottomLeft,
|
|
141
|
+
inset,
|
|
142
|
+
insetLeft,
|
|
143
|
+
insetRight,
|
|
144
|
+
insetBottom,
|
|
145
|
+
insetTop,
|
|
146
|
+
};
|
|
112
147
|
|
|
113
|
-
return select(
|
|
114
|
-
.call(applyStyle, defaults)
|
|
115
|
-
.style('path', path(arcObject))
|
|
116
|
-
.style('transform', `translate(${center[0]}, ${center[1]})`)
|
|
117
|
-
.style('stroke', color || stroke)
|
|
118
|
-
.style('lineWidth', lineWidth)
|
|
119
|
-
.style(colorAttribute, color)
|
|
148
|
+
return select(rect(points, value, coordinate, extendedStyle))
|
|
149
|
+
.call(applyStyle, { ...defaults, ...rest })
|
|
120
150
|
.style(toOpacityKey(options), opacity)
|
|
121
|
-
.
|
|
151
|
+
.style(colorAttribute, color)
|
|
152
|
+
.style('lineWidth', lineWidth)
|
|
153
|
+
.style('stroke', stroke === undefined ? color : stroke)
|
|
122
154
|
.node();
|
|
123
155
|
};
|
|
124
156
|
};
|
package/src/shape/utils.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Path } from '@antv/g';
|
|
1
2
|
import { Path as D3Path } from 'd3-path';
|
|
2
3
|
import { extent } from 'd3-array';
|
|
3
4
|
import { Coordinate } from '@antv/coord';
|
|
@@ -8,6 +9,7 @@ import { isPolar, isTranspose } from '../utils/coordinate';
|
|
|
8
9
|
import { angle, angleWithQuadrant, dist, sub } from '../utils/vector';
|
|
9
10
|
import { Selection } from '../utils/selection';
|
|
10
11
|
import { indexOf } from '../utils/array';
|
|
12
|
+
import * as Symbols from './point/symbol';
|
|
11
13
|
|
|
12
14
|
type A = ['a' | 'A', number, number, number, number, number, number, number];
|
|
13
15
|
type C = ['c' | 'C', number, number, number, number, number, number];
|
package/src/spec/composition.ts
CHANGED
package/src/spec/geometry.ts
CHANGED
|
@@ -126,7 +126,9 @@ export type BaseGeometry<
|
|
|
126
126
|
Record<'x' | 'y' | 'position' | `position${number}`, Axis | boolean>
|
|
127
127
|
>
|
|
128
128
|
| boolean;
|
|
129
|
-
legend?:
|
|
129
|
+
legend?:
|
|
130
|
+
| Partial<Record<'size' | 'color' | 'shape' | 'opacity', Legend | boolean>>
|
|
131
|
+
| boolean;
|
|
130
132
|
slider?: Partial<Record<'x' | 'y', any>>;
|
|
131
133
|
scrollbar?: Partial<Record<'x' | 'y', any>>;
|
|
132
134
|
coordinates?: Coordinate[];
|
package/src/spec/interaction.ts
CHANGED
|
@@ -12,17 +12,19 @@ export type Interaction =
|
|
|
12
12
|
| ElementSelectInteraction
|
|
13
13
|
| TooltipInteraction
|
|
14
14
|
| FisheyeInteraction
|
|
15
|
-
|
|
|
15
|
+
| ChartIndexInteraction
|
|
16
16
|
| CustomInteraction
|
|
17
17
|
| LegendFilterInteraction
|
|
18
|
+
| LegendHighlightInteraction
|
|
18
19
|
| BrushHighlightInteraction
|
|
19
20
|
| BrushXHighlightInteraction
|
|
20
21
|
| BrushYHighlightInteraction
|
|
21
22
|
| BrushAxisHighlightInteraction
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
23
|
+
| BrushFilterInteraction
|
|
24
|
+
| BrushYFilterInteraction
|
|
25
|
+
| BrushXFilterInteraction
|
|
26
|
+
| SliderFilterInteraction
|
|
27
|
+
| PoptipInteraction;
|
|
26
28
|
// | ElementListHighlightInteraction
|
|
27
29
|
// | LegendActiveInteraction
|
|
28
30
|
// | LegendHighlightInteraction
|
|
@@ -45,6 +47,7 @@ export type InteractionTypes =
|
|
|
45
47
|
| 'fisheye'
|
|
46
48
|
| 'tooltip'
|
|
47
49
|
| 'legendFilter'
|
|
50
|
+
| 'legendHighlight'
|
|
48
51
|
| 'brushXHighlight'
|
|
49
52
|
| 'brushYHighlight'
|
|
50
53
|
| 'brushHighlight'
|
|
@@ -52,6 +55,7 @@ export type InteractionTypes =
|
|
|
52
55
|
| 'brushXFilter'
|
|
53
56
|
| 'brushYFilter'
|
|
54
57
|
| 'sliderFilter'
|
|
58
|
+
| 'poptip'
|
|
55
59
|
| InteractionComponent;
|
|
56
60
|
// | 'elementListHighlight'
|
|
57
61
|
// | 'legendActive'
|
|
@@ -101,17 +105,17 @@ export type BrushAxisHighlightInteraction = {
|
|
|
101
105
|
reverse?: boolean;
|
|
102
106
|
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
103
107
|
|
|
104
|
-
export type
|
|
108
|
+
export type BrushFilterInteraction = {
|
|
105
109
|
type?: 'brushFilter';
|
|
106
110
|
reverse?: boolean;
|
|
107
111
|
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
108
112
|
|
|
109
|
-
export type
|
|
113
|
+
export type BrushXFilterInteraction = {
|
|
110
114
|
type?: 'brushXFilter';
|
|
111
115
|
reverse?: boolean;
|
|
112
116
|
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
113
117
|
|
|
114
|
-
export type
|
|
118
|
+
export type BrushYFilterInteraction = {
|
|
115
119
|
type?: 'brushYFilter';
|
|
116
120
|
reverse?: boolean;
|
|
117
121
|
} & Record<`${'mask' | 'highlighted' | 'unhighlighted'}${any}`, any>;
|
|
@@ -125,33 +129,60 @@ export type ElementHighlightInteraction = {
|
|
|
125
129
|
type?: 'elementHighlight';
|
|
126
130
|
// @todo: Style supported by G.
|
|
127
131
|
link?: boolean;
|
|
128
|
-
|
|
132
|
+
background?: boolean;
|
|
133
|
+
offset?: number;
|
|
134
|
+
} & Record<
|
|
135
|
+
`${'link' | 'highlighted' | 'unhighlighted' | 'background'}${any}`,
|
|
136
|
+
any
|
|
137
|
+
>;
|
|
129
138
|
|
|
130
139
|
export type ElementSelectInteraction = {
|
|
131
140
|
type?: 'elementSelect';
|
|
132
141
|
single?: boolean;
|
|
133
|
-
|
|
142
|
+
background?: true;
|
|
143
|
+
offset?: number;
|
|
144
|
+
} & Record<`${'selected' | 'link' | 'unselected' | 'background'}${any}`, any>;
|
|
134
145
|
|
|
135
146
|
export type ElementSelectByColorInteraction = {
|
|
136
147
|
type?: 'elementSelectByColor';
|
|
137
148
|
single?: boolean;
|
|
149
|
+
offset?: number;
|
|
138
150
|
} & Record<`${'selected' | 'link' | 'unselected'}${any}`, any>;
|
|
139
151
|
|
|
140
152
|
export type ElementSelectByXInteraction = {
|
|
141
153
|
type?: 'elementSelectByX';
|
|
142
154
|
single?: boolean;
|
|
143
|
-
|
|
155
|
+
background?: true;
|
|
156
|
+
offset?: number;
|
|
157
|
+
} & Record<`${'selected' | 'link' | 'unselected' | 'background'}${any}`, any>;
|
|
144
158
|
|
|
145
159
|
export type ElementHighlightByXInteraction = {
|
|
146
160
|
type?: 'elementHighlightByX';
|
|
147
161
|
x?: string;
|
|
148
162
|
link?: boolean;
|
|
149
|
-
|
|
163
|
+
background?: boolean;
|
|
164
|
+
offset?: number;
|
|
165
|
+
} & Record<
|
|
166
|
+
`${'link' | 'highlighted' | 'unhighlighted' | 'background'}${any}`,
|
|
167
|
+
any
|
|
168
|
+
>;
|
|
150
169
|
|
|
151
170
|
export type ElementHighlightByColorInteraction = {
|
|
152
171
|
type?: 'elementHighlightByColor';
|
|
153
172
|
color?: string;
|
|
154
|
-
|
|
173
|
+
background?: boolean;
|
|
174
|
+
link?: boolean;
|
|
175
|
+
offset?: number;
|
|
176
|
+
} & Record<
|
|
177
|
+
`${'link' | 'highlighted' | 'unhighlighted' | 'background'}${any}`,
|
|
178
|
+
any
|
|
179
|
+
>;
|
|
180
|
+
|
|
181
|
+
export type PoptipInteraction = {
|
|
182
|
+
type?: 'poptip';
|
|
183
|
+
offsetX?: number;
|
|
184
|
+
offsetY?: number;
|
|
185
|
+
} & Record<`tip${any}`, any>;
|
|
155
186
|
|
|
156
187
|
export type LegendFilterInteraction = {
|
|
157
188
|
type?: 'legendFilter';
|
|
@@ -159,14 +190,19 @@ export type LegendFilterInteraction = {
|
|
|
159
190
|
[key: string]: any; // @todo
|
|
160
191
|
} & Record<`${'marker' | 'label'}Unselected${any}`, any>;
|
|
161
192
|
|
|
162
|
-
export type
|
|
193
|
+
export type LegendHighlightInteraction = {
|
|
194
|
+
type?: 'legendHighlight';
|
|
195
|
+
[key: string]: any; // @todo
|
|
196
|
+
} & Record<`${'marker' | 'label'}Unhighlighted${any}`, any>;
|
|
197
|
+
|
|
198
|
+
export type ChartIndexInteraction = {
|
|
163
199
|
type?: 'chartIndex';
|
|
164
200
|
wait?: number;
|
|
165
201
|
leading?: boolean;
|
|
166
202
|
trailing?: boolean;
|
|
167
203
|
} & Record<`${'rule' | 'label'}${any}`, any>;
|
|
168
204
|
|
|
169
|
-
export type
|
|
205
|
+
export type SliderFilterInteraction = {
|
|
170
206
|
type?: 'sliderFilter';
|
|
171
207
|
wait?: number;
|
|
172
208
|
leading?: boolean;
|
|
@@ -181,10 +217,6 @@ export type LegendActiveInteraction = {
|
|
|
181
217
|
type?: 'legendActive';
|
|
182
218
|
};
|
|
183
219
|
|
|
184
|
-
export type LegendHighlightInteraction = {
|
|
185
|
-
type?: 'legendHighlight';
|
|
186
|
-
};
|
|
187
|
-
|
|
188
220
|
export type TooltipInteraction = Omit<TooltipAction, 'type'> & {
|
|
189
221
|
type?: 'tooltip';
|
|
190
222
|
shared?: boolean;
|
package/src/spec/transform.ts
CHANGED
|
@@ -254,11 +254,36 @@ export type BinTransform = {
|
|
|
254
254
|
thresholdsY?: number;
|
|
255
255
|
} & { [key in ChannelTypes]?: Reducer };
|
|
256
256
|
|
|
257
|
+
export type SampleFunction = (
|
|
258
|
+
I: number[],
|
|
259
|
+
X: number[],
|
|
260
|
+
Y: number[],
|
|
261
|
+
thresholds: number,
|
|
262
|
+
) => number[];
|
|
263
|
+
|
|
257
264
|
export type SampleTransform = {
|
|
258
265
|
type?: 'sample';
|
|
259
|
-
|
|
266
|
+
/**
|
|
267
|
+
* Sample strategy. Default is 'median'.
|
|
268
|
+
*/
|
|
269
|
+
strategy?:
|
|
270
|
+
| 'lttb'
|
|
271
|
+
| 'median'
|
|
272
|
+
| 'max'
|
|
273
|
+
| 'min'
|
|
274
|
+
| 'first'
|
|
275
|
+
| 'last'
|
|
276
|
+
| SampleFunction;
|
|
277
|
+
/**
|
|
278
|
+
* The thresholds of sample, when data size great then thresholds, sample will take effect.
|
|
279
|
+
* Default is 2000.
|
|
280
|
+
*/
|
|
260
281
|
thresholds?: number;
|
|
261
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Group data by fields, for series data.
|
|
284
|
+
*/
|
|
285
|
+
groupBy?: string | string[];
|
|
286
|
+
};
|
|
262
287
|
|
|
263
288
|
export type FilterTransform = {
|
|
264
289
|
type?: 'filter';
|