@antv/g2 5.0.0-beta.1 → 5.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g2-lite.min.js +5 -2
- package/dist/g2.min.js +5 -2
- package/esm/animation/morphing.js +32 -10
- package/esm/animation/morphing.js.map +1 -1
- package/esm/animation/waveIn.js +1 -12
- package/esm/animation/waveIn.js.map +1 -1
- package/esm/api/chart.d.ts +16 -7
- package/esm/api/chart.js +66 -29
- package/esm/api/chart.js.map +1 -1
- package/esm/api/composition/base.d.ts +21 -0
- package/esm/api/composition/base.js +59 -0
- package/esm/api/composition/base.js.map +1 -0
- package/esm/api/composition/facetCircle.d.ts +2 -3
- package/esm/api/composition/facetCircle.js +2 -2
- package/esm/api/composition/facetCircle.js.map +1 -1
- package/esm/api/composition/facetRect.d.ts +2 -3
- package/esm/api/composition/facetRect.js +2 -2
- package/esm/api/composition/facetRect.js.map +1 -1
- package/esm/api/composition/geoPath.d.ts +5 -7
- package/esm/api/composition/geoPath.js +4 -5
- package/esm/api/composition/geoPath.js.map +1 -1
- package/esm/api/composition/geoView.d.ts +4 -6
- package/esm/api/composition/geoView.js +4 -5
- package/esm/api/composition/geoView.js.map +1 -1
- package/esm/api/composition/index.d.ts +2 -1
- package/esm/api/composition/index.js +2 -1
- package/esm/api/composition/index.js.map +1 -1
- package/esm/api/composition/repeatMatrix.d.ts +2 -3
- package/esm/api/composition/repeatMatrix.js +2 -2
- package/esm/api/composition/repeatMatrix.js.map +1 -1
- package/esm/api/composition/spaceFlex.d.ts +2 -3
- package/esm/api/composition/spaceFlex.js +2 -2
- package/esm/api/composition/spaceFlex.js.map +1 -1
- package/esm/api/composition/spaceLayer.d.ts +2 -3
- package/esm/api/composition/spaceLayer.js +2 -2
- package/esm/api/composition/spaceLayer.js.map +1 -1
- package/esm/api/composition/timingKeyframe.d.ts +2 -3
- package/esm/api/composition/timingKeyframe.js +2 -2
- package/esm/api/composition/timingKeyframe.js.map +1 -1
- package/esm/api/composition/view.d.ts +5 -5
- package/esm/api/composition/view.js +6 -6
- package/esm/api/composition/view.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 +29 -29
- package/esm/api/mark/mark.js +32 -29
- package/esm/api/mark/mark.js.map +1 -1
- package/esm/api/mark/types.d.ts +5 -2
- package/esm/api/node.d.ts +2 -1
- package/esm/api/node.js +8 -9
- package/esm/api/node.js.map +1 -1
- package/esm/api/props.js +3 -22
- package/esm/api/props.js.map +1 -1
- package/esm/component/axis.d.ts +5 -8
- package/esm/component/axis.js +182 -234
- 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 +45 -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 +14 -0
- package/esm/component/index.js +9 -0
- package/esm/component/index.js.map +1 -1
- package/esm/component/legendCategory.d.ts +5 -4
- package/esm/component/legendCategory.js +87 -55
- package/esm/component/legendCategory.js.map +1 -1
- package/esm/component/legendContinuous.d.ts +4 -2
- package/esm/component/legendContinuous.js +87 -25
- 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.d.ts +9 -0
- package/esm/component/scrollbar.js +36 -0
- package/esm/component/scrollbar.js.map +1 -0
- package/esm/component/scrollbarX.d.ts +7 -0
- package/esm/component/scrollbarX.js +9 -0
- package/esm/component/scrollbarX.js.map +1 -0
- package/esm/component/scrollbarY.d.ts +7 -0
- package/esm/component/scrollbarY.js +9 -0
- package/esm/component/scrollbarY.js.map +1 -0
- package/esm/component/slider.d.ts +9 -0
- package/esm/component/slider.js +47 -0
- package/esm/component/slider.js.map +1 -0
- package/esm/component/sliderX.d.ts +7 -0
- package/esm/component/sliderX.js +9 -0
- package/esm/component/sliderX.js.map +1 -0
- package/esm/component/sliderY.d.ts +7 -0
- package/esm/component/sliderY.js +9 -0
- package/esm/component/sliderY.js.map +1 -0
- package/esm/component/title.js +47 -23
- package/esm/component/title.js.map +1 -1
- package/esm/component/utils.d.ts +13 -0
- package/esm/component/utils.js +50 -0
- package/esm/component/utils.js.map +1 -1
- package/esm/composition/facetCircle.js +2 -2
- package/esm/composition/facetCircle.js.map +1 -1
- package/esm/composition/facetRect.js +6 -8
- package/esm/composition/facetRect.js.map +1 -1
- package/esm/composition/mark.js +5 -3
- package/esm/composition/mark.js.map +1 -1
- package/esm/composition/repeatMatrix.js +4 -4
- package/esm/composition/repeatMatrix.js.map +1 -1
- package/esm/composition/view.js +3 -3
- package/esm/composition/view.js.map +1 -1
- package/esm/coordinate/fisheye.js +1 -1
- package/esm/coordinate/fisheye.js.map +1 -1
- package/esm/coordinate/index.d.ts +5 -13
- package/esm/coordinate/index.js +4 -8
- 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/radar.d.ts +7 -0
- package/esm/coordinate/radar.js +14 -0
- package/esm/coordinate/radar.js.map +1 -0
- package/esm/coordinate/radial.d.ts +6 -0
- package/esm/coordinate/radial.js +19 -6
- 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/coordinate/transpose.js +1 -1
- package/esm/coordinate/transpose.js.map +1 -1
- package/esm/data/filter.d.ts +3 -3
- package/esm/data/filter.js.map +1 -1
- package/esm/data/fold.js +4 -10
- package/esm/data/fold.js.map +1 -1
- package/esm/data/index.d.ts +5 -3
- package/esm/data/index.js +2 -1
- package/esm/data/index.js.map +1 -1
- package/esm/data/pick.js +10 -2
- package/esm/data/pick.js.map +1 -1
- package/esm/data/slice.d.ts +8 -0
- package/esm/data/slice.js +10 -0
- package/esm/data/slice.js.map +1 -0
- package/esm/data/sort.d.ts +8 -0
- package/esm/data/sort.js +12 -0
- package/esm/data/sort.js.map +1 -0
- package/esm/geo/{d3-projection.js → d3Projection.js} +1 -1
- package/esm/geo/d3Projection.js.map +1 -0
- package/esm/geo/geoView.js +4 -4
- package/esm/geo/geoView.js.map +1 -1
- package/esm/interaction/action/service/legendItemSelection.js.map +1 -1
- package/esm/interaction/action/transformer/setItemState.js.map +1 -1
- package/esm/interaction/builtin/activeRegion.d.ts +0 -2
- package/esm/interaction/builtin/brush.d.ts +1 -1
- package/esm/interaction/builtin/brushHighlight.d.ts +1 -1
- package/esm/interaction/builtin/brushVisible.d.ts +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/builtin/ellipsisText.d.ts +0 -3
- package/esm/interaction/builtin/fisheye.d.ts +6 -6
- package/esm/interaction/builtin/tooltip.d.ts +4 -8
- package/esm/interaction/index.d.ts +13 -0
- package/esm/interaction/index.js +12 -30
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/native/brushAxisHighlight.d.ts +27 -0
- package/esm/interaction/native/brushAxisHighlight.js +167 -0
- package/esm/interaction/native/brushAxisHighlight.js.map +1 -0
- package/esm/interaction/native/brushFilter.d.ts +14 -0
- package/esm/interaction/native/brushFilter.js +122 -0
- package/esm/interaction/native/brushFilter.js.map +1 -0
- package/esm/interaction/native/brushHighlight.d.ts +41 -0
- package/esm/interaction/native/brushHighlight.js +349 -0
- package/esm/interaction/native/brushHighlight.js.map +1 -0
- package/esm/interaction/native/brushXFilter.d.ts +1 -0
- package/esm/interaction/native/brushXFilter.js +6 -0
- package/esm/interaction/native/brushXFilter.js.map +1 -0
- package/esm/interaction/native/brushXHighlight.d.ts +6 -0
- package/esm/interaction/native/brushXHighlight.js +9 -0
- package/esm/interaction/native/brushXHighlight.js.map +1 -0
- package/esm/interaction/native/brushYFilter.d.ts +1 -0
- package/esm/interaction/native/brushYFilter.js +6 -0
- package/esm/interaction/native/brushYFilter.js.map +1 -0
- package/esm/interaction/native/brushYHighlight.d.ts +6 -0
- package/esm/interaction/native/brushYHighlight.js +9 -0
- package/esm/interaction/native/brushYHighlight.js.map +1 -0
- package/esm/interaction/native/elementHighlight.d.ts +10 -2
- package/esm/interaction/native/elementHighlight.js +87 -24
- package/esm/interaction/native/elementHighlight.js.map +1 -1
- package/esm/interaction/native/elementHighlightByColor.d.ts +0 -3
- package/esm/interaction/native/elementHighlightByColor.js +3 -9
- package/esm/interaction/native/elementHighlightByColor.js.map +1 -1
- package/esm/interaction/native/elementHighlightByX.d.ts +1 -8
- package/esm/interaction/native/elementHighlightByX.js +4 -11
- package/esm/interaction/native/elementHighlightByX.js.map +1 -1
- package/esm/interaction/native/elementSelect.d.ts +7 -2
- package/esm/interaction/native/elementSelect.js +59 -27
- package/esm/interaction/native/elementSelect.js.map +1 -1
- package/esm/interaction/native/elementSelectByColor.js +3 -6
- package/esm/interaction/native/elementSelectByColor.js.map +1 -1
- package/esm/interaction/native/elementSelectByX.js +3 -6
- package/esm/interaction/native/elementSelectByX.js.map +1 -1
- package/esm/interaction/native/fisheye.js +6 -4
- package/esm/interaction/native/fisheye.js.map +1 -1
- package/esm/interaction/native/legendFilter.d.ts +14 -0
- package/esm/interaction/native/legendFilter.js +195 -0
- package/esm/interaction/native/legendFilter.js.map +1 -0
- package/esm/interaction/native/legendHighlight.d.ts +1 -0
- package/esm/interaction/native/legendHighlight.js +87 -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/sliderFilter.d.ts +5 -0
- package/esm/interaction/native/sliderFilter.js +87 -0
- package/esm/interaction/native/sliderFilter.js.map +1 -0
- package/esm/interaction/native/tooltip.d.ts +2 -2
- package/esm/interaction/native/tooltip.js +157 -48
- package/esm/interaction/native/tooltip.js.map +1 -1
- package/esm/interaction/native/utils.d.ts +24 -5
- package/esm/interaction/native/utils.js +248 -42
- package/esm/interaction/native/utils.js.map +1 -1
- package/esm/label-transform/contrastReverse.d.ts +9 -0
- package/esm/label-transform/contrastReverse.js +48 -0
- package/esm/label-transform/contrastReverse.js.map +1 -0
- package/esm/label-transform/index.d.ts +8 -8
- package/esm/label-transform/index.js +4 -4
- package/esm/label-transform/index.js.map +1 -1
- package/esm/label-transform/overflowHide.d.ts +7 -0
- package/esm/label-transform/overflowHide.js +18 -0
- package/esm/label-transform/overflowHide.js.map +1 -0
- package/esm/label-transform/overlapDodgeY.d.ts +7 -0
- package/esm/label-transform/{dodgeY.js → overlapDodgeY.js} +4 -4
- package/esm/label-transform/overlapDodgeY.js.map +1 -0
- package/esm/label-transform/overlapHide.d.ts +7 -0
- package/esm/label-transform/overlapHide.js +24 -0
- package/esm/label-transform/overlapHide.js.map +1 -0
- package/esm/mark/area.js +3 -2
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/box.js +1 -0
- package/esm/mark/box.js.map +1 -1
- package/esm/mark/boxplot.js +6 -21
- package/esm/mark/boxplot.js.map +1 -1
- package/esm/mark/cell.js +2 -1
- package/esm/mark/cell.js.map +1 -1
- package/esm/mark/connector.js +1 -0
- package/esm/mark/connector.js.map +1 -1
- package/esm/mark/forceGraph.js +1 -1
- package/esm/mark/forceGraph.js.map +1 -1
- package/esm/mark/image.js +1 -0
- package/esm/mark/image.js.map +1 -1
- package/esm/mark/interval.js +1 -0
- package/esm/mark/interval.js.map +1 -1
- package/esm/mark/line.js +2 -1
- package/esm/mark/line.js.map +1 -1
- package/esm/mark/lineX.js +1 -0
- package/esm/mark/lineX.js.map +1 -1
- package/esm/mark/lineY.js +1 -0
- package/esm/mark/lineY.js.map +1 -1
- package/esm/mark/link.js +1 -0
- package/esm/mark/link.js.map +1 -1
- package/esm/mark/pack.js +1 -2
- package/esm/mark/pack.js.map +1 -1
- package/esm/mark/path.js +1 -0
- package/esm/mark/path.js.map +1 -1
- package/esm/mark/point.js +1 -0
- package/esm/mark/point.js.map +1 -1
- package/esm/mark/polygon.js +1 -0
- package/esm/mark/polygon.js.map +1 -1
- package/esm/mark/range.js +1 -0
- package/esm/mark/range.js.map +1 -1
- package/esm/mark/rangeX.js +1 -0
- package/esm/mark/rangeX.js.map +1 -1
- package/esm/mark/rangeY.js +1 -0
- package/esm/mark/rangeY.js.map +1 -1
- package/esm/mark/rect.js +1 -0
- package/esm/mark/rect.js.map +1 -1
- package/esm/mark/sankey.js +1 -1
- package/esm/mark/sankey.js.map +1 -1
- package/esm/mark/shape.js +1 -0
- package/esm/mark/shape.js.map +1 -1
- package/esm/mark/text.js +1 -0
- package/esm/mark/text.js.map +1 -1
- package/esm/mark/tree.js +1 -1
- package/esm/mark/tree.js.map +1 -1
- package/esm/mark/treemap.js +1 -2
- package/esm/mark/treemap.js.map +1 -1
- package/esm/mark/vector.js +1 -0
- package/esm/mark/vector.js.map +1 -1
- package/esm/mark/wordCloud.js +1 -1
- package/esm/mark/wordCloud.js.map +1 -1
- package/esm/runtime/component.d.ts +4 -1
- package/esm/runtime/component.js +274 -106
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/coordinate.d.ts +12 -0
- package/esm/runtime/coordinate.js +47 -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/mark.js +7 -4
- package/esm/runtime/mark.js.map +1 -1
- package/esm/runtime/plot.d.ts +1 -1
- package/esm/runtime/plot.js +199 -88
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.d.ts +0 -1
- package/esm/runtime/render.js +22 -47
- package/esm/runtime/render.js.map +1 -1
- package/esm/runtime/scale.d.ts +3 -1
- package/esm/runtime/scale.js +61 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +18 -9
- package/esm/runtime/transform.js.map +1 -1
- package/esm/runtime/types/common.d.ts +38 -11
- package/esm/runtime/types/component.d.ts +13 -8
- package/esm/runtime/types/mark.d.ts +4 -4
- package/esm/runtime/types/options.d.ts +16 -12
- 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 +8 -5
- package/esm/scale/constant.d.ts +4 -0
- package/esm/scale/constant.js +6 -0
- package/esm/scale/constant.js.map +1 -0
- package/esm/scale/index.d.ts +2 -0
- package/esm/scale/index.js +1 -0
- package/esm/scale/index.js.map +1 -1
- package/esm/shape/area/curve.js +17 -17
- package/esm/shape/area/curve.js.map +1 -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/box/box.js +1 -1
- package/esm/shape/box/box.js.map +1 -1
- package/esm/shape/connector/connector.js +3 -3
- package/esm/shape/connector/connector.js.map +1 -1
- package/esm/shape/image/image.js +2 -2
- package/esm/shape/image/image.js.map +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 +68 -50
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/label/label.js +3 -3
- package/esm/shape/label/label.js.map +1 -1
- package/esm/shape/label/position/area.d.ts +13 -0
- package/esm/shape/label/position/area.js +28 -0
- package/esm/shape/label/position/area.js.map +1 -0
- package/esm/shape/label/position/bottom.d.ts +1 -0
- package/esm/shape/label/position/bottom.js +2 -0
- package/esm/shape/label/position/bottom.js.map +1 -0
- package/esm/shape/label/position/bottomLeft.d.ts +1 -0
- package/esm/shape/label/position/bottomLeft.js +2 -0
- package/esm/shape/label/position/bottomLeft.js.map +1 -0
- package/esm/shape/label/position/bottomRight.d.ts +1 -0
- package/esm/shape/label/position/bottomRight.js +2 -0
- package/esm/shape/label/position/bottomRight.js.map +1 -0
- package/esm/shape/label/position/default.d.ts +18 -0
- package/esm/shape/label/position/default.js +107 -0
- package/esm/shape/label/position/default.js.map +1 -0
- package/esm/shape/label/position/index.d.ts +13 -0
- package/esm/shape/label/position/index.js +14 -0
- package/esm/shape/label/position/index.js.map +1 -0
- package/esm/shape/label/position/inside.d.ts +1 -0
- package/esm/shape/label/position/inside.js +2 -0
- package/esm/shape/label/position/inside.js.map +1 -0
- package/esm/shape/label/position/left.d.ts +1 -0
- package/esm/shape/label/position/left.js +2 -0
- package/esm/shape/label/position/left.js.map +1 -0
- package/esm/shape/label/position/outside.d.ts +18 -0
- package/esm/shape/label/position/outside.js +67 -0
- package/esm/shape/label/position/outside.js.map +1 -0
- package/esm/shape/label/position/right.d.ts +1 -0
- package/esm/shape/label/position/right.js +2 -0
- package/esm/shape/label/position/right.js.map +1 -0
- package/esm/shape/label/position/spider.d.ts +7 -0
- package/esm/shape/label/position/spider.js +34 -0
- package/esm/shape/label/position/spider.js.map +1 -0
- package/esm/shape/label/position/surround.d.ts +7 -0
- package/esm/shape/label/position/surround.js +35 -0
- package/esm/shape/label/position/surround.js.map +1 -0
- package/esm/shape/label/position/top.d.ts +1 -0
- package/esm/shape/label/position/top.js +2 -0
- package/esm/shape/label/position/top.js.map +1 -0
- package/esm/shape/label/position/topLeft.d.ts +1 -0
- package/esm/shape/label/position/topLeft.js +2 -0
- package/esm/shape/label/position/topLeft.js.map +1 -0
- package/esm/shape/label/position/topRight.d.ts +1 -0
- package/esm/shape/label/position/topRight.js +2 -0
- package/esm/shape/label/position/topRight.js.map +1 -0
- package/esm/shape/line/curve.js +24 -13
- package/esm/shape/line/curve.js.map +1 -1
- package/esm/shape/line/line.js +6 -2
- package/esm/shape/line/line.js.map +1 -1
- package/esm/shape/line/smooth.js +6 -2
- package/esm/shape/line/smooth.js.map +1 -1
- package/esm/shape/lineXY/line.js +2 -2
- package/esm/shape/lineXY/line.js.map +1 -1
- package/esm/shape/link/arc.js +2 -2
- package/esm/shape/link/arc.js.map +1 -1
- package/esm/shape/link/link.js +2 -2
- package/esm/shape/link/link.js.map +1 -1
- package/esm/shape/link/smooth.js +2 -2
- package/esm/shape/link/smooth.js.map +1 -1
- package/esm/shape/link/vhv.js +2 -2
- package/esm/shape/link/vhv.js.map +1 -1
- package/esm/shape/point/color.js +1 -1
- package/esm/shape/point/color.js.map +1 -1
- package/esm/shape/polygon/polygon.js +3 -3
- package/esm/shape/polygon/polygon.js.map +1 -1
- package/esm/shape/polygon/ribbon.js +3 -3
- package/esm/shape/polygon/ribbon.js.map +1 -1
- package/esm/shape/text/advance.js +3 -3
- package/esm/shape/text/advance.js.map +1 -1
- package/esm/shape/text/badge.js +3 -3
- package/esm/shape/text/badge.js.map +1 -1
- package/esm/shape/text/text.js +1 -1
- package/esm/shape/text/text.js.map +1 -1
- package/esm/shape/utils.d.ts +5 -0
- package/esm/shape/utils.js +14 -2
- package/esm/shape/utils.js.map +1 -1
- package/esm/shape/vector/vector.js +3 -3
- package/esm/shape/vector/vector.js.map +1 -1
- package/esm/spec/composition.d.ts +9 -7
- package/esm/spec/coordinate.d.ts +17 -33
- package/esm/spec/data.d.ts +32 -10
- package/esm/spec/geometry.d.ts +24 -9
- package/esm/spec/interaction.d.ts +81 -27
- package/esm/spec/labelTransform.d.ts +24 -11
- package/esm/spec/scale.d.ts +4 -3
- package/esm/spec/theme.d.ts +5 -2
- package/esm/spec/transform.d.ts +27 -4
- package/esm/spec/utils.d.ts +7 -0
- package/esm/spec/utils.js +2 -0
- package/esm/spec/utils.js.map +1 -0
- package/esm/stdlib/index.js +12 -18
- package/esm/stdlib/index.js.map +1 -1
- package/esm/theme/academy.d.ts +3 -0
- package/esm/theme/academy.js +404 -0
- package/esm/theme/academy.js.map +1 -0
- package/esm/theme/dark.js +163 -100
- package/esm/theme/dark.js.map +1 -1
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/theme/index.js.map +1 -1
- package/esm/theme/light.js +177 -101
- package/esm/theme/light.js.map +1 -1
- package/esm/transform/filter.d.ts +7 -0
- package/esm/transform/filter.js +42 -0
- package/esm/transform/filter.js.map +1 -0
- package/esm/transform/groupN.js +2 -0
- package/esm/transform/groupN.js.map +1 -1
- package/esm/transform/index.d.ts +10 -6
- package/esm/transform/index.js +5 -3
- package/esm/transform/index.js.map +1 -1
- package/esm/transform/maybeTooltip.js +3 -1
- package/esm/transform/maybeTooltip.js.map +1 -1
- package/esm/transform/sample.d.ts +8 -0
- package/esm/transform/sample.js +64 -0
- package/esm/transform/sample.js.map +1 -0
- package/esm/transform/{Select.js → select.js} +2 -14
- package/esm/transform/select.js.map +1 -0
- package/esm/transform/{SelectX.js → selectX.js} +3 -3
- package/esm/transform/selectX.js.map +1 -0
- package/esm/transform/{SelectY.js → selectY.js} +3 -3
- package/esm/transform/selectY.js.map +1 -0
- package/esm/transform/sort.d.ts +1 -1
- package/esm/transform/sort.js +39 -21
- package/esm/transform/sort.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/bounds.d.ts +26 -0
- package/esm/utils/bounds.js +41 -0
- package/esm/utils/bounds.js.map +1 -0
- package/esm/utils/color.d.ts +6 -0
- package/esm/utils/color.js +7 -0
- package/esm/utils/color.js.map +1 -0
- package/esm/utils/coordinate.d.ts +5 -0
- package/esm/utils/coordinate.js +31 -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/helper.d.ts +2 -0
- package/esm/utils/helper.js +10 -2
- package/esm/utils/helper.js.map +1 -1
- package/esm/utils/scale.d.ts +3 -0
- package/esm/utils/scale.js +30 -0
- package/esm/utils/scale.js.map +1 -0
- package/esm/utils/selection.d.ts +1 -0
- package/esm/utils/selection.js +5 -2
- package/esm/utils/selection.js.map +1 -1
- package/esm/utils/size.js +1 -1
- package/esm/utils/size.js.map +1 -1
- package/esm/utils/vector.d.ts +1 -1
- package/esm/utils/vector.js +1 -1
- package/lib/animation/morphing.js +32 -10
- package/lib/animation/morphing.js.map +1 -1
- package/lib/animation/waveIn.js +1 -12
- package/lib/animation/waveIn.js.map +1 -1
- package/lib/api/chart.d.ts +16 -7
- package/lib/api/chart.js +67 -27
- package/lib/api/chart.js.map +1 -1
- package/lib/api/composition/base.d.ts +21 -0
- package/lib/api/composition/base.js +62 -0
- package/lib/api/composition/base.js.map +1 -0
- package/lib/api/composition/facetCircle.d.ts +2 -3
- package/lib/api/composition/facetCircle.js +2 -2
- package/lib/api/composition/facetCircle.js.map +1 -1
- package/lib/api/composition/facetRect.d.ts +2 -3
- package/lib/api/composition/facetRect.js +2 -2
- package/lib/api/composition/facetRect.js.map +1 -1
- package/lib/api/composition/geoPath.d.ts +5 -7
- package/lib/api/composition/geoPath.js +4 -5
- package/lib/api/composition/geoPath.js.map +1 -1
- package/lib/api/composition/geoView.d.ts +4 -6
- package/lib/api/composition/geoView.js +4 -5
- package/lib/api/composition/geoView.js.map +1 -1
- package/lib/api/composition/index.d.ts +2 -1
- package/lib/api/composition/index.js +3 -1
- package/lib/api/composition/index.js.map +1 -1
- package/lib/api/composition/repeatMatrix.d.ts +2 -3
- package/lib/api/composition/repeatMatrix.js +2 -2
- package/lib/api/composition/repeatMatrix.js.map +1 -1
- package/lib/api/composition/spaceFlex.d.ts +2 -3
- package/lib/api/composition/spaceFlex.js +2 -2
- package/lib/api/composition/spaceFlex.js.map +1 -1
- package/lib/api/composition/spaceLayer.d.ts +2 -3
- package/lib/api/composition/spaceLayer.js +2 -2
- package/lib/api/composition/spaceLayer.js.map +1 -1
- package/lib/api/composition/timingKeyframe.d.ts +2 -3
- package/lib/api/composition/timingKeyframe.js +2 -2
- package/lib/api/composition/timingKeyframe.js.map +1 -1
- package/lib/api/composition/view.d.ts +5 -5
- package/lib/api/composition/view.js +6 -6
- package/lib/api/composition/view.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 +29 -29
- package/lib/api/mark/mark.js +32 -29
- package/lib/api/mark/mark.js.map +1 -1
- package/lib/api/mark/types.d.ts +5 -2
- package/lib/api/node.d.ts +2 -1
- package/lib/api/node.js +8 -9
- package/lib/api/node.js.map +1 -1
- package/lib/api/props.js +3 -22
- package/lib/api/props.js.map +1 -1
- package/lib/component/axis.d.ts +5 -8
- package/lib/component/axis.js +181 -234
- 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 +49 -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 +14 -0
- package/lib/component/index.js +20 -1
- package/lib/component/index.js.map +1 -1
- package/lib/component/legendCategory.d.ts +5 -4
- package/lib/component/legendCategory.js +87 -55
- package/lib/component/legendCategory.js.map +1 -1
- package/lib/component/legendContinuous.d.ts +4 -2
- package/lib/component/legendContinuous.js +87 -25
- 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.d.ts +9 -0
- package/lib/component/scrollbar.js +40 -0
- package/lib/component/scrollbar.js.map +1 -0
- package/lib/component/scrollbarX.d.ts +7 -0
- package/lib/component/scrollbarX.js +13 -0
- package/lib/component/scrollbarX.js.map +1 -0
- package/lib/component/scrollbarY.d.ts +7 -0
- package/lib/component/scrollbarY.js +13 -0
- package/lib/component/scrollbarY.js.map +1 -0
- package/lib/component/slider.d.ts +9 -0
- package/lib/component/slider.js +51 -0
- package/lib/component/slider.js.map +1 -0
- package/lib/component/sliderX.d.ts +7 -0
- package/lib/component/sliderX.js +13 -0
- package/lib/component/sliderX.js.map +1 -0
- package/lib/component/sliderY.d.ts +7 -0
- package/lib/component/sliderY.js +13 -0
- package/lib/component/sliderY.js.map +1 -0
- package/lib/component/title.js +47 -23
- package/lib/component/title.js.map +1 -1
- package/lib/component/utils.d.ts +13 -0
- package/lib/component/utils.js +55 -1
- package/lib/component/utils.js.map +1 -1
- package/lib/composition/facetCircle.js +2 -2
- package/lib/composition/facetCircle.js.map +1 -1
- package/lib/composition/facetRect.js +6 -8
- package/lib/composition/facetRect.js.map +1 -1
- package/lib/composition/mark.js +5 -3
- package/lib/composition/mark.js.map +1 -1
- package/lib/composition/repeatMatrix.js +4 -4
- package/lib/composition/repeatMatrix.js.map +1 -1
- package/lib/composition/view.js +3 -3
- package/lib/composition/view.js.map +1 -1
- package/lib/coordinate/fisheye.js +1 -1
- package/lib/coordinate/fisheye.js.map +1 -1
- package/lib/coordinate/index.d.ts +5 -13
- package/lib/coordinate/index.js +6 -11
- 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/radar.d.ts +7 -0
- package/lib/coordinate/radar.js +18 -0
- package/lib/coordinate/radar.js.map +1 -0
- package/lib/coordinate/radial.d.ts +6 -0
- package/lib/coordinate/radial.js +21 -7
- 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/coordinate/transpose.js +1 -1
- package/lib/coordinate/transpose.js.map +1 -1
- package/lib/data/filter.d.ts +3 -3
- package/lib/data/filter.js.map +1 -1
- package/lib/data/fold.js +4 -10
- package/lib/data/fold.js.map +1 -1
- package/lib/data/index.d.ts +5 -3
- package/lib/data/index.js +5 -3
- package/lib/data/index.js.map +1 -1
- package/lib/data/pick.js +10 -2
- package/lib/data/pick.js.map +1 -1
- package/lib/data/slice.d.ts +8 -0
- package/lib/data/slice.js +14 -0
- package/lib/data/slice.js.map +1 -0
- package/lib/data/sort.d.ts +8 -0
- package/lib/data/sort.js +17 -0
- package/lib/data/sort.js.map +1 -0
- package/lib/geo/{d3-projection.js → d3Projection.js} +1 -1
- package/lib/geo/d3Projection.js.map +1 -0
- package/lib/geo/geoView.js +4 -4
- package/lib/geo/geoView.js.map +1 -1
- package/lib/interaction/action/service/legendItemSelection.js.map +1 -1
- package/lib/interaction/action/transformer/setItemState.js.map +1 -1
- package/lib/interaction/builtin/activeRegion.d.ts +0 -2
- package/lib/interaction/builtin/brush.d.ts +1 -1
- package/lib/interaction/builtin/brushHighlight.d.ts +1 -1
- package/lib/interaction/builtin/brushVisible.d.ts +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/builtin/ellipsisText.d.ts +0 -3
- package/lib/interaction/builtin/fisheye.d.ts +6 -6
- package/lib/interaction/builtin/tooltip.d.ts +4 -8
- package/lib/interaction/index.d.ts +13 -0
- package/lib/interaction/index.js +25 -31
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/native/brushAxisHighlight.d.ts +27 -0
- package/lib/interaction/native/brushAxisHighlight.js +172 -0
- package/lib/interaction/native/brushAxisHighlight.js.map +1 -0
- package/lib/interaction/native/brushFilter.d.ts +14 -0
- package/lib/interaction/native/brushFilter.js +127 -0
- package/lib/interaction/native/brushFilter.js.map +1 -0
- package/lib/interaction/native/brushHighlight.d.ts +41 -0
- package/lib/interaction/native/brushHighlight.js +355 -0
- package/lib/interaction/native/brushHighlight.js.map +1 -0
- package/lib/interaction/native/brushXFilter.d.ts +1 -0
- package/lib/interaction/native/brushXFilter.js +10 -0
- package/lib/interaction/native/brushXFilter.js.map +1 -0
- package/lib/interaction/native/brushXHighlight.d.ts +6 -0
- package/lib/interaction/native/brushXHighlight.js +14 -0
- package/lib/interaction/native/brushXHighlight.js.map +1 -0
- package/lib/interaction/native/brushYFilter.d.ts +1 -0
- package/lib/interaction/native/brushYFilter.js +10 -0
- package/lib/interaction/native/brushYFilter.js.map +1 -0
- package/lib/interaction/native/brushYHighlight.d.ts +6 -0
- package/lib/interaction/native/brushYHighlight.js +14 -0
- package/lib/interaction/native/brushYHighlight.js.map +1 -0
- package/lib/interaction/native/elementHighlight.d.ts +10 -2
- package/lib/interaction/native/elementHighlight.js +86 -23
- package/lib/interaction/native/elementHighlight.js.map +1 -1
- package/lib/interaction/native/elementHighlightByColor.d.ts +0 -3
- package/lib/interaction/native/elementHighlightByColor.js +1 -7
- package/lib/interaction/native/elementHighlightByColor.js.map +1 -1
- package/lib/interaction/native/elementHighlightByX.d.ts +1 -8
- package/lib/interaction/native/elementHighlightByX.js +2 -9
- package/lib/interaction/native/elementHighlightByX.js.map +1 -1
- package/lib/interaction/native/elementSelect.d.ts +7 -2
- package/lib/interaction/native/elementSelect.js +58 -26
- package/lib/interaction/native/elementSelect.js.map +1 -1
- package/lib/interaction/native/elementSelectByColor.js +1 -4
- package/lib/interaction/native/elementSelectByColor.js.map +1 -1
- package/lib/interaction/native/elementSelectByX.js +1 -4
- package/lib/interaction/native/elementSelectByX.js.map +1 -1
- package/lib/interaction/native/fisheye.js +6 -4
- package/lib/interaction/native/fisheye.js.map +1 -1
- package/lib/interaction/native/legendFilter.d.ts +14 -0
- package/lib/interaction/native/legendFilter.js +205 -0
- package/lib/interaction/native/legendFilter.js.map +1 -0
- package/lib/interaction/native/legendHighlight.d.ts +1 -0
- package/lib/interaction/native/legendHighlight.js +91 -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/sliderFilter.d.ts +5 -0
- package/lib/interaction/native/sliderFilter.js +91 -0
- package/lib/interaction/native/sliderFilter.js.map +1 -0
- package/lib/interaction/native/tooltip.d.ts +2 -2
- package/lib/interaction/native/tooltip.js +154 -45
- package/lib/interaction/native/tooltip.js.map +1 -1
- package/lib/interaction/native/utils.d.ts +24 -5
- package/lib/interaction/native/utils.js +258 -44
- package/lib/interaction/native/utils.js.map +1 -1
- package/lib/label-transform/contrastReverse.d.ts +9 -0
- package/lib/label-transform/contrastReverse.js +52 -0
- package/lib/label-transform/contrastReverse.js.map +1 -0
- package/lib/label-transform/index.d.ts +8 -8
- package/lib/label-transform/index.js +9 -9
- package/lib/label-transform/index.js.map +1 -1
- package/lib/label-transform/overflowHide.d.ts +7 -0
- package/lib/label-transform/overflowHide.js +22 -0
- package/lib/label-transform/overflowHide.js.map +1 -0
- package/lib/label-transform/overlapDodgeY.d.ts +7 -0
- package/lib/label-transform/{dodgeY.js → overlapDodgeY.js} +6 -6
- package/lib/label-transform/overlapDodgeY.js.map +1 -0
- package/lib/label-transform/overlapHide.d.ts +7 -0
- package/lib/label-transform/overlapHide.js +28 -0
- package/lib/label-transform/overlapHide.js.map +1 -0
- package/lib/mark/area.js +3 -2
- package/lib/mark/area.js.map +1 -1
- package/lib/mark/box.js +1 -0
- package/lib/mark/box.js.map +1 -1
- package/lib/mark/boxplot.js +6 -21
- package/lib/mark/boxplot.js.map +1 -1
- package/lib/mark/cell.js +2 -1
- package/lib/mark/cell.js.map +1 -1
- package/lib/mark/connector.js +1 -0
- package/lib/mark/connector.js.map +1 -1
- package/lib/mark/forceGraph.js +1 -1
- package/lib/mark/forceGraph.js.map +1 -1
- package/lib/mark/image.js +1 -0
- package/lib/mark/image.js.map +1 -1
- package/lib/mark/interval.js +1 -0
- package/lib/mark/interval.js.map +1 -1
- package/lib/mark/line.js +2 -1
- package/lib/mark/line.js.map +1 -1
- package/lib/mark/lineX.js +1 -0
- package/lib/mark/lineX.js.map +1 -1
- package/lib/mark/lineY.js +1 -0
- package/lib/mark/lineY.js.map +1 -1
- package/lib/mark/link.js +1 -0
- package/lib/mark/link.js.map +1 -1
- package/lib/mark/pack.js +1 -2
- package/lib/mark/pack.js.map +1 -1
- package/lib/mark/path.js +1 -0
- package/lib/mark/path.js.map +1 -1
- package/lib/mark/point.js +1 -0
- package/lib/mark/point.js.map +1 -1
- package/lib/mark/polygon.js +1 -0
- package/lib/mark/polygon.js.map +1 -1
- package/lib/mark/range.js +1 -0
- package/lib/mark/range.js.map +1 -1
- package/lib/mark/rangeX.js +1 -0
- package/lib/mark/rangeX.js.map +1 -1
- package/lib/mark/rangeY.js +1 -0
- package/lib/mark/rangeY.js.map +1 -1
- package/lib/mark/rect.js +1 -0
- package/lib/mark/rect.js.map +1 -1
- package/lib/mark/sankey.js +1 -1
- package/lib/mark/sankey.js.map +1 -1
- package/lib/mark/shape.js +1 -0
- package/lib/mark/shape.js.map +1 -1
- package/lib/mark/text.js +1 -0
- package/lib/mark/text.js.map +1 -1
- package/lib/mark/tree.js +1 -1
- package/lib/mark/tree.js.map +1 -1
- package/lib/mark/treemap.js +1 -2
- package/lib/mark/treemap.js.map +1 -1
- package/lib/mark/vector.js +1 -0
- package/lib/mark/vector.js.map +1 -1
- package/lib/mark/wordCloud.js +1 -1
- package/lib/mark/wordCloud.js.map +1 -1
- package/lib/runtime/component.d.ts +4 -1
- package/lib/runtime/component.js +276 -108
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/coordinate.d.ts +12 -0
- package/lib/runtime/coordinate.js +51 -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/mark.js +7 -4
- package/lib/runtime/mark.js.map +1 -1
- package/lib/runtime/plot.d.ts +1 -1
- package/lib/runtime/plot.js +196 -85
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.d.ts +0 -1
- package/lib/runtime/render.js +24 -47
- package/lib/runtime/render.js.map +1 -1
- package/lib/runtime/scale.d.ts +3 -1
- package/lib/runtime/scale.js +63 -5
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +18 -9
- package/lib/runtime/transform.js.map +1 -1
- package/lib/runtime/types/common.d.ts +38 -11
- package/lib/runtime/types/component.d.ts +13 -8
- package/lib/runtime/types/mark.d.ts +4 -4
- package/lib/runtime/types/options.d.ts +16 -12
- 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 +8 -5
- package/lib/scale/constant.d.ts +4 -0
- package/lib/scale/constant.js +10 -0
- package/lib/scale/constant.js.map +1 -0
- package/lib/scale/index.d.ts +2 -0
- package/lib/scale/index.js +3 -1
- package/lib/scale/index.js.map +1 -1
- package/lib/shape/area/curve.js +16 -16
- package/lib/shape/area/curve.js.map +1 -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/box/box.js +1 -1
- package/lib/shape/box/box.js.map +1 -1
- package/lib/shape/connector/connector.js +3 -3
- package/lib/shape/connector/connector.js.map +1 -1
- package/lib/shape/image/image.js +2 -2
- package/lib/shape/image/image.js.map +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 +70 -51
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/label/label.js +3 -3
- package/lib/shape/label/label.js.map +1 -1
- package/lib/shape/label/position/area.d.ts +13 -0
- package/lib/shape/label/position/area.js +32 -0
- package/lib/shape/label/position/area.js.map +1 -0
- package/lib/shape/label/position/bottom.d.ts +1 -0
- package/lib/shape/label/position/bottom.js +6 -0
- package/lib/shape/label/position/bottom.js.map +1 -0
- package/lib/shape/label/position/bottomLeft.d.ts +1 -0
- package/lib/shape/label/position/bottomLeft.js +6 -0
- package/lib/shape/label/position/bottomLeft.js.map +1 -0
- package/lib/shape/label/position/bottomRight.d.ts +1 -0
- package/lib/shape/label/position/bottomRight.js +6 -0
- package/lib/shape/label/position/bottomRight.js.map +1 -0
- package/lib/shape/label/position/default.d.ts +18 -0
- package/lib/shape/label/{position.js → position/default.js} +24 -81
- package/lib/shape/label/position/default.js.map +1 -0
- package/lib/shape/label/position/index.d.ts +13 -0
- package/lib/shape/label/position/index.js +30 -0
- package/lib/shape/label/position/index.js.map +1 -0
- package/lib/shape/label/position/inside.d.ts +1 -0
- package/lib/shape/label/position/inside.js +6 -0
- package/lib/shape/label/position/inside.js.map +1 -0
- package/lib/shape/label/position/left.d.ts +1 -0
- package/lib/shape/label/position/left.js +6 -0
- package/lib/shape/label/position/left.js.map +1 -0
- package/lib/shape/label/position/outside.d.ts +18 -0
- package/lib/shape/label/position/outside.js +75 -0
- package/lib/shape/label/position/outside.js.map +1 -0
- package/lib/shape/label/position/right.d.ts +1 -0
- package/lib/shape/label/position/right.js +6 -0
- package/lib/shape/label/position/right.js.map +1 -0
- package/lib/shape/label/position/spider.d.ts +7 -0
- package/lib/shape/label/position/spider.js +38 -0
- package/lib/shape/label/position/spider.js.map +1 -0
- package/lib/shape/label/position/surround.d.ts +7 -0
- package/lib/shape/label/position/surround.js +39 -0
- package/lib/shape/label/position/surround.js.map +1 -0
- package/lib/shape/label/position/top.d.ts +1 -0
- package/lib/shape/label/position/top.js +6 -0
- package/lib/shape/label/position/top.js.map +1 -0
- package/lib/shape/label/position/topLeft.d.ts +1 -0
- package/lib/shape/label/position/topLeft.js +6 -0
- package/lib/shape/label/position/topLeft.js.map +1 -0
- package/lib/shape/label/position/topRight.d.ts +1 -0
- package/lib/shape/label/position/topRight.js +6 -0
- package/lib/shape/label/position/topRight.js.map +1 -0
- package/lib/shape/line/curve.js +22 -11
- package/lib/shape/line/curve.js.map +1 -1
- package/lib/shape/line/line.js +5 -1
- package/lib/shape/line/line.js.map +1 -1
- package/lib/shape/line/smooth.js +5 -1
- package/lib/shape/line/smooth.js.map +1 -1
- package/lib/shape/lineXY/line.js +2 -2
- package/lib/shape/lineXY/line.js.map +1 -1
- package/lib/shape/link/arc.js +2 -2
- package/lib/shape/link/arc.js.map +1 -1
- package/lib/shape/link/link.js +2 -2
- package/lib/shape/link/link.js.map +1 -1
- package/lib/shape/link/smooth.js +2 -2
- package/lib/shape/link/smooth.js.map +1 -1
- package/lib/shape/link/vhv.js +2 -2
- package/lib/shape/link/vhv.js.map +1 -1
- package/lib/shape/point/color.js +1 -1
- package/lib/shape/point/color.js.map +1 -1
- package/lib/shape/polygon/polygon.js +3 -3
- package/lib/shape/polygon/polygon.js.map +1 -1
- package/lib/shape/polygon/ribbon.js +3 -3
- package/lib/shape/polygon/ribbon.js.map +1 -1
- package/lib/shape/text/advance.js +3 -3
- package/lib/shape/text/advance.js.map +1 -1
- package/lib/shape/text/badge.js +3 -3
- package/lib/shape/text/badge.js.map +1 -1
- package/lib/shape/text/text.js +1 -1
- package/lib/shape/text/text.js.map +1 -1
- package/lib/shape/utils.d.ts +5 -0
- package/lib/shape/utils.js +15 -2
- package/lib/shape/utils.js.map +1 -1
- package/lib/shape/vector/vector.js +3 -3
- package/lib/shape/vector/vector.js.map +1 -1
- package/lib/spec/composition.d.ts +9 -7
- package/lib/spec/coordinate.d.ts +17 -33
- package/lib/spec/data.d.ts +32 -10
- package/lib/spec/geometry.d.ts +24 -9
- package/lib/spec/interaction.d.ts +81 -27
- package/lib/spec/labelTransform.d.ts +24 -11
- package/lib/spec/scale.d.ts +4 -3
- package/lib/spec/theme.d.ts +5 -2
- package/lib/spec/transform.d.ts +27 -4
- package/lib/spec/utils.d.ts +7 -0
- package/lib/spec/utils.js +3 -0
- package/lib/spec/utils.js.map +1 -0
- package/lib/stdlib/index.js +3 -4
- package/lib/stdlib/index.js.map +1 -1
- package/lib/theme/academy.d.ts +3 -0
- package/lib/theme/academy.js +408 -0
- package/lib/theme/academy.js.map +1 -0
- package/lib/theme/dark.js +163 -100
- package/lib/theme/dark.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +3 -1
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/light.js +177 -101
- package/lib/theme/light.js.map +1 -1
- package/lib/transform/filter.d.ts +7 -0
- package/lib/transform/filter.js +46 -0
- package/lib/transform/filter.js.map +1 -0
- package/lib/transform/groupN.js +2 -0
- package/lib/transform/groupN.js.map +1 -1
- package/lib/transform/index.d.ts +10 -6
- package/lib/transform/index.js +11 -7
- package/lib/transform/index.js.map +1 -1
- package/lib/transform/maybeTooltip.js +3 -1
- package/lib/transform/maybeTooltip.js.map +1 -1
- package/lib/transform/sample.d.ts +8 -0
- package/lib/transform/sample.js +68 -0
- package/lib/transform/sample.js.map +1 -0
- package/lib/transform/{Select.js → select.js} +2 -14
- package/lib/transform/select.js.map +1 -0
- package/lib/transform/{SelectX.js → selectX.js} +3 -3
- package/lib/transform/selectX.js.map +1 -0
- package/lib/transform/{SelectY.js → selectY.js} +3 -3
- package/lib/transform/selectY.js.map +1 -0
- package/lib/transform/sort.d.ts +1 -1
- package/lib/transform/sort.js +38 -20
- package/lib/transform/sort.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/bounds.d.ts +26 -0
- package/lib/utils/bounds.js +48 -0
- package/lib/utils/bounds.js.map +1 -0
- package/lib/utils/color.d.ts +6 -0
- package/lib/utils/color.js +11 -0
- package/lib/utils/color.js.map +1 -0
- package/lib/utils/coordinate.d.ts +5 -0
- package/lib/utils/coordinate.js +37 -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/helper.d.ts +2 -0
- package/lib/utils/helper.js +12 -2
- package/lib/utils/helper.js.map +1 -1
- package/lib/utils/scale.d.ts +3 -0
- package/lib/utils/scale.js +36 -0
- package/lib/utils/scale.js.map +1 -0
- package/lib/utils/selection.d.ts +1 -0
- package/lib/utils/selection.js +5 -2
- package/lib/utils/selection.js.map +1 -1
- package/lib/utils/size.js +1 -1
- package/lib/utils/size.js.map +1 -1
- package/lib/utils/vector.d.ts +1 -1
- package/lib/utils/vector.js +1 -1
- package/package.json +9 -8
- package/src/animation/morphing.ts +35 -10
- package/src/animation/waveIn.ts +0 -1
- package/src/api/chart.ts +78 -37
- package/src/api/composition/base.ts +56 -0
- package/src/api/composition/facetCircle.ts +2 -3
- package/src/api/composition/facetRect.ts +2 -3
- package/src/api/composition/geoPath.ts +6 -9
- package/src/api/composition/geoView.ts +6 -9
- package/src/api/composition/index.ts +2 -0
- package/src/api/composition/repeatMatrix.ts +2 -3
- package/src/api/composition/spaceFlex.ts +2 -3
- package/src/api/composition/spaceLayer.ts +2 -3
- package/src/api/composition/timingKeyframe.ts +2 -3
- package/src/api/composition/view.ts +10 -8
- package/src/api/mark/base.ts +58 -0
- package/src/api/mark/mark.ts +34 -30
- package/src/api/mark/types.ts +5 -2
- package/src/api/node.ts +9 -11
- package/src/api/props.ts +4 -25
- package/src/component/axis.ts +341 -366
- package/src/component/axisArc.ts +16 -0
- package/src/component/axisRadar.ts +72 -0
- package/src/component/axisX.ts +7 -4
- package/src/component/axisY.ts +4 -4
- package/src/component/index.ts +14 -0
- package/src/component/legendCategory.ts +182 -76
- package/src/component/legendContinuous.ts +133 -33
- 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 +41 -0
- package/src/component/scrollbarX.ts +16 -0
- package/src/component/scrollbarY.ts +16 -0
- package/src/component/slider.ts +52 -0
- package/src/component/sliderX.ts +16 -0
- package/src/component/sliderY.ts +16 -0
- package/src/component/title.ts +70 -31
- package/src/component/utils.ts +51 -0
- package/src/composition/facetCircle.ts +2 -2
- package/src/composition/facetRect.ts +6 -6
- package/src/composition/mark.ts +8 -4
- package/src/composition/repeatMatrix.ts +10 -3
- package/src/composition/view.ts +13 -1
- package/src/coordinate/fisheye.ts +1 -1
- package/src/coordinate/index.ts +5 -13
- package/src/coordinate/polar.ts +19 -11
- package/src/coordinate/radar.ts +24 -0
- package/src/coordinate/radial.ts +21 -11
- package/src/coordinate/theta.ts +18 -9
- package/src/coordinate/transpose.ts +1 -1
- package/src/data/filter.ts +3 -3
- package/src/data/fold.ts +6 -10
- package/src/data/index.ts +5 -3
- package/src/data/pick.ts +11 -2
- package/src/data/slice.ts +15 -0
- package/src/data/sort.ts +18 -0
- package/src/geo/geoView.ts +4 -4
- package/src/interaction/action/service/legendItemSelection.ts +1 -2
- package/src/interaction/action/transformer/setItemState.ts +2 -3
- package/src/interaction/index.ts +29 -16
- package/src/interaction/native/brushAxisHighlight.ts +207 -0
- package/src/interaction/native/brushFilter.ts +143 -0
- package/src/interaction/native/brushHighlight.ts +447 -0
- package/src/interaction/native/brushXFilter.ts +10 -0
- package/src/interaction/native/brushXHighlight.ts +13 -0
- package/src/interaction/native/brushYFilter.ts +10 -0
- package/src/interaction/native/brushYHighlight.ts +13 -0
- package/src/interaction/native/elementHighlight.ts +99 -15
- package/src/interaction/native/elementHighlightByColor.ts +3 -20
- package/src/interaction/native/elementHighlightByX.ts +4 -23
- package/src/interaction/native/elementSelect.ts +79 -20
- package/src/interaction/native/elementSelectByColor.ts +3 -16
- package/src/interaction/native/elementSelectByX.ts +3 -16
- package/src/interaction/native/fisheye.ts +6 -4
- package/src/interaction/native/legendFilter.ts +214 -0
- package/src/interaction/native/legendHighlight.ts +100 -0
- package/src/interaction/native/poptip.ts +87 -0
- package/src/interaction/native/sliderFilter.ts +112 -0
- package/src/interaction/native/tooltip.ts +201 -50
- package/src/interaction/native/utils.ts +298 -44
- package/src/label-transform/contrastReverse.ts +56 -0
- package/src/label-transform/index.ts +8 -8
- package/src/label-transform/overflowHide.ts +23 -0
- package/src/label-transform/{dodgeY.ts → overlapDodgeY.ts} +7 -7
- package/src/label-transform/overlapHide.ts +32 -0
- package/src/mark/area.ts +3 -2
- package/src/mark/box.ts +1 -0
- package/src/mark/boxplot.ts +4 -4
- package/src/mark/cell.ts +2 -1
- package/src/mark/connector.ts +1 -0
- package/src/mark/forceGraph.ts +1 -1
- package/src/mark/image.ts +1 -0
- package/src/mark/interval.ts +1 -0
- package/src/mark/line.ts +2 -1
- package/src/mark/lineX.ts +1 -0
- package/src/mark/lineY.ts +1 -0
- package/src/mark/link.ts +1 -0
- package/src/mark/pack.ts +1 -2
- package/src/mark/path.ts +1 -0
- package/src/mark/point.ts +1 -0
- package/src/mark/polygon.ts +1 -0
- package/src/mark/range.ts +1 -0
- package/src/mark/rangeX.ts +1 -0
- package/src/mark/rangeY.ts +1 -0
- package/src/mark/rect.ts +1 -0
- package/src/mark/sankey.ts +1 -1
- package/src/mark/shape.ts +1 -0
- package/src/mark/text.ts +1 -0
- package/src/mark/tree.ts +1 -1
- package/src/mark/treemap.ts +1 -2
- package/src/mark/vector.ts +1 -0
- package/src/mark/wordCloud.ts +1 -1
- package/src/runtime/component.ts +393 -143
- package/src/runtime/coordinate.ts +46 -16
- package/src/runtime/layout.ts +206 -97
- package/src/runtime/mark.ts +7 -3
- package/src/runtime/plot.ts +318 -142
- package/src/runtime/render.ts +33 -72
- package/src/runtime/scale.ts +72 -7
- package/src/runtime/transform.ts +23 -8
- package/src/runtime/types/common.ts +50 -20
- package/src/runtime/types/component.ts +18 -11
- package/src/runtime/types/mark.ts +4 -4
- package/src/runtime/types/options.ts +32 -22
- package/src/runtime/types/scale.ts +20 -0
- package/src/runtime/types/theme.ts +8 -5
- package/src/scale/constant.ts +11 -0
- package/src/scale/index.ts +2 -0
- package/src/shape/area/curve.ts +22 -17
- 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/box/box.ts +6 -6
- package/src/shape/connector/connector.ts +3 -4
- package/src/shape/image/image.ts +2 -2
- package/src/shape/index.ts +7 -2
- package/src/shape/interval/color.ts +97 -58
- package/src/shape/label/label.ts +4 -3
- package/src/shape/label/position/area.ts +39 -0
- package/src/shape/label/position/bottom.ts +1 -0
- package/src/shape/label/position/bottomLeft.ts +1 -0
- package/src/shape/label/position/bottomRight.ts +1 -0
- package/src/shape/label/{position.ts → position/default.ts} +26 -110
- package/src/shape/label/position/index.ts +13 -0
- package/src/shape/label/position/inside.ts +1 -0
- package/src/shape/label/position/left.ts +1 -0
- package/src/shape/label/position/outside.ts +121 -0
- package/src/shape/label/position/right.ts +1 -0
- package/src/shape/label/position/spider.ts +39 -0
- package/src/shape/label/position/surround.ts +40 -0
- package/src/shape/label/position/top.ts +1 -0
- package/src/shape/label/position/topLeft.ts +1 -0
- package/src/shape/label/position/topRight.ts +1 -0
- package/src/shape/line/curve.ts +28 -13
- package/src/shape/line/line.ts +6 -2
- package/src/shape/line/smooth.ts +11 -2
- package/src/shape/lineXY/line.ts +2 -2
- package/src/shape/link/arc.ts +2 -2
- package/src/shape/link/link.ts +2 -2
- package/src/shape/link/smooth.ts +2 -2
- package/src/shape/link/vhv.ts +2 -2
- package/src/shape/point/color.ts +6 -5
- package/src/shape/polygon/polygon.ts +3 -3
- package/src/shape/polygon/ribbon.ts +3 -3
- package/src/shape/text/advance.ts +6 -3
- package/src/shape/text/badge.ts +8 -3
- package/src/shape/text/text.ts +1 -1
- package/src/shape/utils.ts +16 -6
- package/src/shape/vector/vector.ts +3 -3
- package/src/spec/action.ts +0 -1
- package/src/spec/composition.ts +8 -8
- package/src/spec/coordinate.ts +25 -51
- package/src/spec/data.ts +36 -11
- package/src/spec/geometry.ts +29 -14
- package/src/spec/interaction.ts +120 -50
- package/src/spec/labelTransform.ts +29 -11
- package/src/spec/scale.ts +6 -1
- package/src/spec/theme.ts +6 -2
- package/src/spec/transform.ts +47 -3
- package/src/spec/utils.ts +7 -0
- package/src/stdlib/index.ts +75 -27
- package/src/theme/academy.ts +410 -0
- package/src/theme/dark.ts +164 -101
- package/src/theme/index.ts +1 -0
- package/src/theme/light.ts +177 -102
- package/src/transform/filter.ts +48 -0
- package/src/transform/groupN.ts +2 -0
- package/src/transform/index.ts +10 -6
- package/src/transform/maybeTooltip.ts +3 -1
- package/src/transform/sample.ts +80 -0
- package/src/transform/select.ts +1 -2
- package/src/transform/selectX.ts +2 -2
- package/src/transform/selectY.ts +2 -2
- package/src/transform/sort.ts +53 -21
- 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/bounds.ts +52 -0
- package/src/utils/color.ts +12 -0
- package/src/utils/coordinate.ts +41 -0
- package/src/utils/event.ts +0 -26
- package/src/utils/helper.ts +17 -2
- package/src/utils/scale.ts +31 -0
- package/src/utils/selection.ts +7 -2
- package/src/utils/size.ts +1 -1
- package/src/utils/vector.ts +1 -1
- package/esm/coordinate/fisheyeX.d.ts +0 -7
- package/esm/coordinate/fisheyeX.js +0 -6
- package/esm/coordinate/fisheyeX.js.map +0 -1
- package/esm/coordinate/fisheyeY.d.ts +0 -7
- package/esm/coordinate/fisheyeY.js +0 -6
- package/esm/coordinate/fisheyeY.js.map +0 -1
- package/esm/coordinate/reflect.d.ts +0 -7
- package/esm/coordinate/reflect.js +0 -10
- package/esm/coordinate/reflect.js.map +0 -1
- package/esm/coordinate/reflectX.d.ts +0 -7
- package/esm/coordinate/reflectX.js +0 -10
- package/esm/coordinate/reflectX.js.map +0 -1
- package/esm/coordinate/reflectY.d.ts +0 -7
- package/esm/coordinate/reflectY.js +0 -10
- package/esm/coordinate/reflectY.js.map +0 -1
- package/esm/data/subset.d.ts +0 -7
- package/esm/data/subset.js +0 -26
- package/esm/data/subset.js.map +0 -1
- package/esm/geo/d3-projection.js.map +0 -1
- package/esm/label-transform/dodgeY.d.ts +0 -7
- package/esm/label-transform/dodgeY.js.map +0 -1
- package/esm/label-transform/hideOverlap.d.ts +0 -4
- package/esm/label-transform/hideOverlap.js +0 -48
- package/esm/label-transform/hideOverlap.js.map +0 -1
- package/esm/label-transform/spider.d.ts +0 -7
- package/esm/label-transform/spider.js +0 -30
- package/esm/label-transform/spider.js.map +0 -1
- package/esm/label-transform/surround.d.ts +0 -7
- package/esm/label-transform/surround.js +0 -30
- package/esm/label-transform/surround.js.map +0 -1
- package/esm/shape/area/step.d.ts +0 -3
- package/esm/shape/area/step.js.map +0 -1
- package/esm/shape/label/position.d.ts +0 -25
- package/esm/shape/label/position.js +0 -169
- package/esm/shape/label/position.js.map +0 -1
- package/esm/transform/Select.js.map +0 -1
- package/esm/transform/SelectX.js.map +0 -1
- package/esm/transform/SelectY.js.map +0 -1
- package/lib/coordinate/fisheyeX.d.ts +0 -7
- package/lib/coordinate/fisheyeX.js +0 -10
- package/lib/coordinate/fisheyeX.js.map +0 -1
- package/lib/coordinate/fisheyeY.d.ts +0 -7
- package/lib/coordinate/fisheyeY.js +0 -10
- package/lib/coordinate/fisheyeY.js.map +0 -1
- package/lib/coordinate/reflect.d.ts +0 -7
- package/lib/coordinate/reflect.js +0 -14
- package/lib/coordinate/reflect.js.map +0 -1
- package/lib/coordinate/reflectX.d.ts +0 -7
- package/lib/coordinate/reflectX.js +0 -14
- package/lib/coordinate/reflectX.js.map +0 -1
- package/lib/coordinate/reflectY.d.ts +0 -7
- package/lib/coordinate/reflectY.js +0 -14
- package/lib/coordinate/reflectY.js.map +0 -1
- package/lib/data/subset.d.ts +0 -7
- package/lib/data/subset.js +0 -30
- package/lib/data/subset.js.map +0 -1
- package/lib/geo/d3-projection.js.map +0 -1
- package/lib/label-transform/dodgeY.d.ts +0 -7
- package/lib/label-transform/dodgeY.js.map +0 -1
- package/lib/label-transform/hideOverlap.d.ts +0 -4
- package/lib/label-transform/hideOverlap.js +0 -52
- package/lib/label-transform/hideOverlap.js.map +0 -1
- package/lib/label-transform/spider.d.ts +0 -7
- package/lib/label-transform/spider.js +0 -34
- package/lib/label-transform/spider.js.map +0 -1
- package/lib/label-transform/surround.d.ts +0 -7
- package/lib/label-transform/surround.js +0 -34
- package/lib/label-transform/surround.js.map +0 -1
- package/lib/shape/area/step.d.ts +0 -3
- package/lib/shape/area/step.js.map +0 -1
- package/lib/shape/label/position.d.ts +0 -25
- package/lib/shape/label/position.js.map +0 -1
- package/lib/transform/Select.js.map +0 -1
- package/lib/transform/SelectX.js.map +0 -1
- package/lib/transform/SelectY.js.map +0 -1
- package/src/coordinate/fisheyeX.ts +0 -15
- package/src/coordinate/fisheyeY.ts +0 -15
- package/src/coordinate/reflect.ts +0 -15
- package/src/coordinate/reflectX.ts +0 -15
- package/src/coordinate/reflectY.ts +0 -15
- package/src/data/subset.ts +0 -35
- package/src/label-transform/hideOverlap.ts +0 -62
- package/src/label-transform/spider.ts +0 -37
- package/src/label-transform/surround.ts +0 -37
- /package/esm/geo/{d3-projection.d.ts → d3Projection.d.ts} +0 -0
- /package/esm/transform/{Select.d.ts → select.d.ts} +0 -0
- /package/esm/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- /package/esm/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- /package/lib/geo/{d3-projection.d.ts → d3Projection.d.ts} +0 -0
- /package/lib/transform/{Select.d.ts → select.d.ts} +0 -0
- /package/lib/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- /package/lib/transform/{SelectY.d.ts → selectY.d.ts} +0 -0
- /package/src/geo/{d3-projection.ts → d3Projection.ts} +0 -0
package/src/runtime/render.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Canvas as GCanvas, DisplayObject, Group } from '@antv/g';
|
|
2
2
|
import { Renderer as CanvasRenderer } from '@antv/g-canvas';
|
|
3
3
|
import { Plugin as DragAndDropPlugin } from '@antv/g-plugin-dragndrop';
|
|
4
|
-
import {
|
|
4
|
+
import { deepMix } from '@antv/util';
|
|
5
|
+
import EventEmitter from '@antv/event-emitter';
|
|
5
6
|
import { createLibrary } from '../stdlib';
|
|
6
7
|
import { select } from '../utils/selection';
|
|
7
|
-
import {
|
|
8
|
-
import { getChartSize } from '../utils/size';
|
|
8
|
+
import { CHART_LIFE_CIRCLE } from '../utils/event';
|
|
9
9
|
import { G2Context, G2ViewTree } from './types/options';
|
|
10
10
|
import { plot } from './plot';
|
|
11
11
|
|
|
@@ -64,21 +64,19 @@ export function render<T extends G2ViewTree = G2ViewTree>(
|
|
|
64
64
|
callback?: () => void,
|
|
65
65
|
): HTMLElement {
|
|
66
66
|
// Initialize the context if it is not provided.
|
|
67
|
-
const { width = 640, height = 480,
|
|
67
|
+
const { width = 640, height = 480, on } = options;
|
|
68
68
|
const keyed = inferKeys(options);
|
|
69
|
-
const {
|
|
69
|
+
const {
|
|
70
|
+
canvas = Canvas(width, height),
|
|
71
|
+
library = createLibrary(),
|
|
72
|
+
emitter = new EventEmitter(),
|
|
73
|
+
} = context;
|
|
70
74
|
context.canvas = canvas;
|
|
71
75
|
context.library = library;
|
|
72
|
-
|
|
73
|
-
if (autoFit && !context.bindAutoFit) {
|
|
74
|
-
// Bind the autoFit event once.
|
|
75
|
-
bindAutoFit(options, context);
|
|
76
|
-
context.bindAutoFit = true;
|
|
77
|
-
}
|
|
78
|
-
|
|
76
|
+
context.emitter = emitter;
|
|
79
77
|
canvas.resize(width, height);
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
emitter.emit(CHART_LIFE_CIRCLE.BEFORE_RENDER);
|
|
82
80
|
|
|
83
81
|
// Plot the chart and mutate context.
|
|
84
82
|
// Make sure that plot chart after container is ready for every time.
|
|
@@ -87,8 +85,10 @@ export function render<T extends G2ViewTree = G2ViewTree>(
|
|
|
87
85
|
.then(() =>
|
|
88
86
|
plot<T>({ ...keyed, width, height }, selection, library, context),
|
|
89
87
|
)
|
|
90
|
-
.then(
|
|
91
|
-
|
|
88
|
+
.then(() => {
|
|
89
|
+
emitter.emit(CHART_LIFE_CIRCLE.AFTER_RENDER);
|
|
90
|
+
callback?.();
|
|
91
|
+
});
|
|
92
92
|
|
|
93
93
|
// Return the container HTML element wraps the canvas or svg element.
|
|
94
94
|
return normalizeContainer(canvas.getConfig().container);
|
|
@@ -102,22 +102,30 @@ export function renderToMountedElement<T extends G2ViewTree = G2ViewTree>(
|
|
|
102
102
|
// Initialize the context if it is not provided.
|
|
103
103
|
const { width = 640, height = 480, on } = options;
|
|
104
104
|
const keyed = inferKeys(options);
|
|
105
|
-
const {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
const {
|
|
106
|
+
library = createLibrary(),
|
|
107
|
+
group = new Group(),
|
|
108
|
+
emitter = new EventEmitter(),
|
|
109
|
+
} = context;
|
|
110
|
+
|
|
111
|
+
if (!group?.parentElement) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`renderToMountedElement can't render chart to unmounted group.`,
|
|
114
|
+
);
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
const selection = select(group);
|
|
112
118
|
context.group = group;
|
|
113
119
|
context.library = library;
|
|
120
|
+
context.emitter = emitter;
|
|
114
121
|
|
|
115
|
-
|
|
122
|
+
emitter.emit(CHART_LIFE_CIRCLE.BEFORE_RENDER);
|
|
116
123
|
// Plot the chart and mutate context.
|
|
117
124
|
// Make sure that plot chart after container is ready for every time.
|
|
118
|
-
plot<T>({ ...keyed, width, height }, selection, library, context)
|
|
119
|
-
.
|
|
120
|
-
|
|
125
|
+
plot<T>({ ...keyed, width, height }, selection, library, context).then(() => {
|
|
126
|
+
emitter.emit(CHART_LIFE_CIRCLE.AFTER_RENDER);
|
|
127
|
+
callback?.();
|
|
128
|
+
});
|
|
121
129
|
|
|
122
130
|
// Return the Group wraps the canvas or svg element.
|
|
123
131
|
return group;
|
|
@@ -127,15 +135,11 @@ export function destroy<T extends G2ViewTree = G2ViewTree>(
|
|
|
127
135
|
options: T,
|
|
128
136
|
context: G2Context = {},
|
|
129
137
|
) {
|
|
130
|
-
const {
|
|
131
|
-
const { canvas } = context;
|
|
138
|
+
const { canvas, emitter } = context;
|
|
132
139
|
if (canvas) {
|
|
133
140
|
canvas.destroy();
|
|
134
141
|
}
|
|
135
|
-
|
|
136
|
-
// Unbind chart events.
|
|
137
|
-
unbindAutoFit(options, context);
|
|
138
|
-
offEvent(on);
|
|
142
|
+
emitter.off();
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
function normalizeContainer(container: HTMLElement | string): HTMLElement {
|
|
@@ -143,46 +147,3 @@ function normalizeContainer(container: HTMLElement | string): HTMLElement {
|
|
|
143
147
|
? document.getElementById(container)
|
|
144
148
|
: container;
|
|
145
149
|
}
|
|
146
|
-
|
|
147
|
-
const onResize = <T extends G2ViewTree = G2ViewTree>(
|
|
148
|
-
options: T,
|
|
149
|
-
context: G2Context = {},
|
|
150
|
-
) =>
|
|
151
|
-
debounce(() => {
|
|
152
|
-
// Update size.
|
|
153
|
-
const { width, height, autoFit } = options;
|
|
154
|
-
const { canvas } = context;
|
|
155
|
-
const container = canvas.getConfig().container as HTMLElement;
|
|
156
|
-
const { width: adjustedWidth, height: adjustedHeight } = getChartSize(
|
|
157
|
-
container,
|
|
158
|
-
autoFit,
|
|
159
|
-
width,
|
|
160
|
-
height,
|
|
161
|
-
);
|
|
162
|
-
const newOptions = {
|
|
163
|
-
...options,
|
|
164
|
-
width: adjustedWidth,
|
|
165
|
-
height: adjustedHeight,
|
|
166
|
-
};
|
|
167
|
-
if (newOptions.width && newOptions.height) render(newOptions, context);
|
|
168
|
-
}, 300);
|
|
169
|
-
|
|
170
|
-
export function bindAutoFit<T extends G2ViewTree = G2ViewTree>(
|
|
171
|
-
options: T,
|
|
172
|
-
context: G2Context = {},
|
|
173
|
-
) {
|
|
174
|
-
const { autoFit } = options;
|
|
175
|
-
if (autoFit) {
|
|
176
|
-
window.addEventListener('resize', onResize(options, context));
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function unbindAutoFit<T extends G2ViewTree = G2ViewTree>(
|
|
181
|
-
options: T,
|
|
182
|
-
context: G2Context = {},
|
|
183
|
-
) {
|
|
184
|
-
const { autoFit } = options;
|
|
185
|
-
if (autoFit) {
|
|
186
|
-
window.removeEventListener('resize', onResize(options, context));
|
|
187
|
-
}
|
|
188
|
-
}
|
package/src/runtime/scale.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { extent } from 'd3-array';
|
|
|
3
3
|
import * as d3ScaleChromatic from 'd3-scale-chromatic';
|
|
4
4
|
import { upperFirst } from '@antv/util';
|
|
5
5
|
import { firstOf, lastOf, unique } from '../utils/array';
|
|
6
|
-
import { defined, identity } from '../utils/helper';
|
|
6
|
+
import { defined, identity, isStrictObject } from '../utils/helper';
|
|
7
7
|
import { Primitive, G2Theme, G2MarkState, ChannelGroups } from './types/common';
|
|
8
8
|
import {
|
|
9
9
|
G2CoordinateOptions,
|
|
@@ -103,6 +103,20 @@ export function useRelation(
|
|
|
103
103
|
return [conditionalize, deconditionalize];
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
export function useRelationScale(
|
|
107
|
+
options: Record<string, any>,
|
|
108
|
+
library: G2Library,
|
|
109
|
+
) {
|
|
110
|
+
const [useScale] = useLibrary<G2ScaleOptions, ScaleComponent, Scale>(
|
|
111
|
+
'scale',
|
|
112
|
+
library,
|
|
113
|
+
);
|
|
114
|
+
const { relations } = options;
|
|
115
|
+
const [conditionalize] = useRelation(relations);
|
|
116
|
+
const scale = useScale(options);
|
|
117
|
+
return conditionalize(scale);
|
|
118
|
+
}
|
|
119
|
+
|
|
106
120
|
export function syncFacetsScales(states: Map<G2Mark, G2MarkState>[]): void {
|
|
107
121
|
const scales = states
|
|
108
122
|
.flatMap((d) => Array.from(d.values()))
|
|
@@ -155,7 +169,7 @@ function inferScaleType(
|
|
|
155
169
|
): string | ScaleComponent {
|
|
156
170
|
const { type, domain, range } = options;
|
|
157
171
|
if (type !== undefined) return type;
|
|
158
|
-
|
|
172
|
+
if (isObject(values)) return 'identity';
|
|
159
173
|
if (typeof range === 'string') return 'linear';
|
|
160
174
|
if ((domain || range || []).length > 2) return asOrdinalType(name);
|
|
161
175
|
if (domain !== undefined) {
|
|
@@ -220,6 +234,7 @@ function inferScaleRange(
|
|
|
220
234
|
case 'linear':
|
|
221
235
|
case 'time':
|
|
222
236
|
case 'log':
|
|
237
|
+
case 'pow':
|
|
223
238
|
case 'sqrt': {
|
|
224
239
|
const colors = categoricalColors(values, options, domain, theme, library);
|
|
225
240
|
const [r0, r1] = inferRangeQ(name, colors);
|
|
@@ -233,6 +248,8 @@ function inferScaleRange(
|
|
|
233
248
|
}
|
|
234
249
|
case 'sequential':
|
|
235
250
|
return undefined;
|
|
251
|
+
case 'constant':
|
|
252
|
+
return [values[0][0]];
|
|
236
253
|
default:
|
|
237
254
|
return [];
|
|
238
255
|
}
|
|
@@ -275,11 +292,15 @@ function categoricalColors(
|
|
|
275
292
|
);
|
|
276
293
|
const { defaultCategory10: c10, defaultCategory20: c20 } = theme;
|
|
277
294
|
const defaultPalette = unique(values.flat()).length <= c10.length ? c10 : c20;
|
|
278
|
-
const { palette, offset } = options;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
usePalette({ type: palette
|
|
282
|
-
|
|
295
|
+
const { palette = defaultPalette, offset } = options;
|
|
296
|
+
// Built-in palettes have higher priority.
|
|
297
|
+
try {
|
|
298
|
+
return usePalette({ type: palette });
|
|
299
|
+
} catch (e) {
|
|
300
|
+
const colors = interpolatedColors(palette, domain, offset);
|
|
301
|
+
if (colors) return colors;
|
|
302
|
+
throw new Error(`Unknown Component: ${palette} `);
|
|
303
|
+
}
|
|
283
304
|
}
|
|
284
305
|
|
|
285
306
|
function gradientColors(range: string): string[] {
|
|
@@ -446,6 +467,10 @@ function isTemporal(values: Primitive[][]): boolean {
|
|
|
446
467
|
return some(values, (d) => d instanceof Date);
|
|
447
468
|
}
|
|
448
469
|
|
|
470
|
+
function isObject(values: Primitive[][]): boolean {
|
|
471
|
+
return some(values, isStrictObject);
|
|
472
|
+
}
|
|
473
|
+
|
|
449
474
|
function some(values, callback) {
|
|
450
475
|
for (const V of values) {
|
|
451
476
|
if (V.some(callback)) return true;
|
|
@@ -476,3 +501,43 @@ export function isPosition(name: string): boolean {
|
|
|
476
501
|
name === 'exitDuration'
|
|
477
502
|
);
|
|
478
503
|
}
|
|
504
|
+
|
|
505
|
+
export function isValidScale(scale: G2ScaleOptions) {
|
|
506
|
+
if (!scale || !scale.type) return false;
|
|
507
|
+
if (typeof scale.type === 'function') return true;
|
|
508
|
+
const { type, domain, range, interpolator } = scale;
|
|
509
|
+
const isValidDomain = domain && domain.length > 0;
|
|
510
|
+
const isValidRange = range && range.length > 0;
|
|
511
|
+
|
|
512
|
+
if (
|
|
513
|
+
[
|
|
514
|
+
'linear',
|
|
515
|
+
'sqrt',
|
|
516
|
+
'log',
|
|
517
|
+
'time',
|
|
518
|
+
'pow',
|
|
519
|
+
'threshold',
|
|
520
|
+
'quantize',
|
|
521
|
+
'quantile',
|
|
522
|
+
'ordinal',
|
|
523
|
+
'band',
|
|
524
|
+
'point',
|
|
525
|
+
].includes(type) &&
|
|
526
|
+
isValidDomain &&
|
|
527
|
+
isValidRange
|
|
528
|
+
) {
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if (
|
|
533
|
+
['sequential'].includes(type) &&
|
|
534
|
+
isValidDomain &&
|
|
535
|
+
(isValidRange || interpolator)
|
|
536
|
+
) {
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if (['constant', 'identity'].includes(type) && isValidRange) return true;
|
|
541
|
+
|
|
542
|
+
return false;
|
|
543
|
+
}
|
package/src/runtime/transform.ts
CHANGED
|
@@ -77,7 +77,6 @@ export function inferChannelsType(
|
|
|
77
77
|
return [I, { ...mark, encode: typedEncode }];
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
// @todo Move visual property to style instead of flagging visual.
|
|
81
80
|
export function maybeVisualChannel(
|
|
82
81
|
I: number[],
|
|
83
82
|
mark: G2Mark,
|
|
@@ -88,7 +87,7 @@ export function maybeVisualChannel(
|
|
|
88
87
|
const newEncode = mapObject(encode, (channel, name) => {
|
|
89
88
|
const { type } = channel;
|
|
90
89
|
if (type !== 'constant' || isPosition(name)) return channel;
|
|
91
|
-
return { ...channel,
|
|
90
|
+
return { ...channel, constant: true };
|
|
92
91
|
});
|
|
93
92
|
return [I, { ...mark, encode: newEncode }];
|
|
94
93
|
}
|
|
@@ -149,7 +148,7 @@ export function addGuideToScale(
|
|
|
149
148
|
mark: G2Mark,
|
|
150
149
|
context: TransformContext,
|
|
151
150
|
): [number[], G2Mark] {
|
|
152
|
-
const { axis = {}, legend = {} } = mark;
|
|
151
|
+
const { axis = {}, legend = {}, slider = {}, scrollbar = {} } = mark;
|
|
153
152
|
const normalize = (guide: boolean | Record<string, any>, channel: string) => {
|
|
154
153
|
if (typeof guide === 'boolean') return guide ? {} : null;
|
|
155
154
|
const eachGuide = guide[channel];
|
|
@@ -165,11 +164,18 @@ export function addGuideToScale(
|
|
|
165
164
|
...Object.fromEntries(
|
|
166
165
|
axisChannels.map((channel) => [
|
|
167
166
|
channel,
|
|
168
|
-
{
|
|
167
|
+
{
|
|
168
|
+
guide: normalize(axis, channel),
|
|
169
|
+
slider: normalize(slider, channel),
|
|
170
|
+
scrollbar: normalize(scrollbar, channel),
|
|
171
|
+
},
|
|
169
172
|
]),
|
|
170
173
|
),
|
|
171
174
|
color: { guide: normalize(legend, 'color') },
|
|
172
175
|
size: { guide: normalize(legend, 'size') },
|
|
176
|
+
shape: { guide: normalize(legend, 'shape') },
|
|
177
|
+
// fixme: opacity is conflict with DisplayObject.opacity
|
|
178
|
+
// opacity: { guide: normalize(legend, 'opacity') },
|
|
173
179
|
},
|
|
174
180
|
});
|
|
175
181
|
return [I, mark];
|
|
@@ -193,19 +199,28 @@ export function maybeNonAnimate(
|
|
|
193
199
|
}
|
|
194
200
|
|
|
195
201
|
function isTypedChannel(channel): boolean {
|
|
196
|
-
if (
|
|
202
|
+
if (
|
|
203
|
+
typeof channel !== 'object' ||
|
|
204
|
+
channel instanceof Date ||
|
|
205
|
+
channel === null
|
|
206
|
+
) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
197
209
|
const { type } = channel;
|
|
198
210
|
return defined(type);
|
|
199
211
|
}
|
|
200
212
|
|
|
201
213
|
function inferChannelType(data: Record<string, Primitive>[], channel): string {
|
|
202
214
|
if (typeof channel === 'function') return 'transform';
|
|
203
|
-
if (typeof channel === 'string' && data
|
|
204
|
-
return 'field';
|
|
205
|
-
}
|
|
215
|
+
if (typeof channel === 'string' && isField(data, channel)) return 'field';
|
|
206
216
|
return 'constant';
|
|
207
217
|
}
|
|
208
218
|
|
|
219
|
+
function isField(data: Record<string, Primitive>[], value: string): boolean {
|
|
220
|
+
if (!Array.isArray(data)) return false;
|
|
221
|
+
return data.some((d) => d[value] !== undefined);
|
|
222
|
+
}
|
|
223
|
+
|
|
209
224
|
function normalizedDataSource(data) {
|
|
210
225
|
// Return null as a placeholder.
|
|
211
226
|
if (!data) return { type: 'inline', value: null };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Coordinate } from '@antv/coord';
|
|
2
|
-
import { DisplayObject } from '@antv/g';
|
|
2
|
+
import { DisplayObject, TextStyleProps } from '@antv/g';
|
|
3
3
|
import { G2GuideComponentOptions, G2Mark, G2ViewTree } from './options';
|
|
4
4
|
import { LabelTransform, Scale } from './component';
|
|
5
5
|
import { MarkProps } from './mark';
|
|
@@ -8,11 +8,28 @@ import { G2Theme } from './theme';
|
|
|
8
8
|
export type { G2Theme };
|
|
9
9
|
|
|
10
10
|
export type G2Title = {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Height of title, default is 36.
|
|
13
|
+
*/
|
|
14
|
+
size?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Text of title.
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Text of subtitle.
|
|
21
|
+
*/
|
|
12
22
|
subtitle?: string | null;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Align method for title.
|
|
25
|
+
*/
|
|
26
|
+
align?: 'left' | 'center' | 'right';
|
|
27
|
+
/**
|
|
28
|
+
* The vertical spacing between title and subtitle, default is 2.
|
|
29
|
+
*/
|
|
30
|
+
spacing?: number;
|
|
31
|
+
} & WithPrefix<Omit<TextStyleProps, 'x' | 'y' | 'text'>, 'title'> & // G.Text style for title.
|
|
32
|
+
WithPrefix<Omit<TextStyleProps, 'x' | 'y' | 'text'>, 'subtitle'>; // G.Text style for subtitle.
|
|
16
33
|
|
|
17
34
|
export type G2ViewDescriptor = {
|
|
18
35
|
scale: Record<string, Scale>;
|
|
@@ -22,7 +39,8 @@ export type G2ViewDescriptor = {
|
|
|
22
39
|
components: G2GuideComponentOptions[];
|
|
23
40
|
layout: Layout;
|
|
24
41
|
key: string;
|
|
25
|
-
|
|
42
|
+
clip: boolean;
|
|
43
|
+
labelTransform: LabelTransform;
|
|
26
44
|
// @todo More accurate type.
|
|
27
45
|
style: Record<string, any>;
|
|
28
46
|
};
|
|
@@ -58,10 +76,9 @@ export type Primitive = number | string | boolean | Date;
|
|
|
58
76
|
|
|
59
77
|
export type TabularData = Record<string, Primitive>[];
|
|
60
78
|
|
|
61
|
-
export type WithPrefix<
|
|
62
|
-
string
|
|
63
|
-
|
|
64
|
-
: unknown;
|
|
79
|
+
export type WithPrefix<O extends Record<string, any>, P extends string> = {
|
|
80
|
+
[K in keyof O as `${P}${Capitalize<K & string>}`]?: O[K];
|
|
81
|
+
};
|
|
65
82
|
|
|
66
83
|
export type EncodeFunction = (
|
|
67
84
|
data: Record<string, MaybeArray<Primitive>>[],
|
|
@@ -110,18 +127,24 @@ export type BBox = {
|
|
|
110
127
|
height?: number;
|
|
111
128
|
};
|
|
112
129
|
|
|
113
|
-
export type
|
|
130
|
+
export type GuidePrimitivePosition =
|
|
114
131
|
| 'top'
|
|
115
|
-
| 'left'
|
|
116
132
|
| 'bottom'
|
|
133
|
+
| 'left'
|
|
117
134
|
| 'right'
|
|
118
|
-
| 'centerHorizontal'
|
|
119
|
-
| 'centerVertical'
|
|
120
135
|
| 'center'
|
|
121
|
-
| '
|
|
122
|
-
| '
|
|
123
|
-
|
|
124
|
-
| '
|
|
136
|
+
| 'inner'
|
|
137
|
+
| 'outer';
|
|
138
|
+
export type GuideCompositePosition =
|
|
139
|
+
| 'top-left'
|
|
140
|
+
| 'top-right'
|
|
141
|
+
| 'bottom-left'
|
|
142
|
+
| 'bottom-right';
|
|
143
|
+
export type GuideComponentPosition =
|
|
144
|
+
| GuidePrimitivePosition
|
|
145
|
+
| GuideCompositePosition;
|
|
146
|
+
|
|
147
|
+
export type GuideComponentOrientation = 'horizontal' | 'vertical' | number;
|
|
125
148
|
|
|
126
149
|
export type Layout = {
|
|
127
150
|
paddingLeft?: number;
|
|
@@ -145,13 +168,20 @@ export type Layout = {
|
|
|
145
168
|
y?: number;
|
|
146
169
|
};
|
|
147
170
|
|
|
148
|
-
|
|
171
|
+
export type Direction = 'horizontal' | 'vertical' | 'center';
|
|
172
|
+
|
|
173
|
+
export type FlexLayout = {
|
|
174
|
+
flexDirection?: 'row' | 'column';
|
|
175
|
+
justifyContent?: 'flex-start' | 'flex-end' | 'center';
|
|
176
|
+
alignItems?: 'flex-start' | 'flex-end' | 'center';
|
|
177
|
+
};
|
|
178
|
+
|
|
149
179
|
export type SectionArea = [
|
|
150
180
|
x: number,
|
|
151
181
|
y: number,
|
|
152
182
|
width: number,
|
|
153
183
|
height: number,
|
|
154
|
-
direction:
|
|
184
|
+
direction: Direction,
|
|
155
185
|
reverse: boolean,
|
|
156
186
|
comparator: (a: Primitive, b: Primitive) => number,
|
|
157
187
|
];
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import { Coordinate, Transformation } from '@antv/coord';
|
|
1
2
|
import { DisplayObject, IAnimation as GAnimation } from '@antv/g';
|
|
2
|
-
import {
|
|
3
|
+
import { G2ViewTree } from './options';
|
|
3
4
|
import {
|
|
4
|
-
IndexedValue,
|
|
5
5
|
G2Theme,
|
|
6
|
-
|
|
6
|
+
G2ViewInstance,
|
|
7
7
|
GuideComponentPosition,
|
|
8
|
+
GuideComponentOrientation,
|
|
9
|
+
IndexedValue,
|
|
8
10
|
Layout,
|
|
9
|
-
|
|
11
|
+
Vector2,
|
|
10
12
|
} from './common';
|
|
11
|
-
import { G2ViewTree } from './options';
|
|
12
|
-
import { EncodeComponent, Encode } from './encode';
|
|
13
|
-
import { MarkComponent, Mark } from './mark';
|
|
14
|
-
import { TransformComponent, Transform } from './transform';
|
|
15
13
|
import { DataComponent } from './data';
|
|
14
|
+
import { Encode, EncodeComponent } from './encode';
|
|
15
|
+
import { Mark, MarkComponent } from './mark';
|
|
16
|
+
import { Transform, TransformComponent } from './transform';
|
|
16
17
|
|
|
17
18
|
export type G2ComponentNamespaces =
|
|
18
19
|
| 'coordinate'
|
|
@@ -116,9 +117,13 @@ export type ScaleComponent<O = Record<string, unknown>> = G2BaseComponent<
|
|
|
116
117
|
>;
|
|
117
118
|
|
|
118
119
|
export type CoordinateTransform = Transformation[];
|
|
120
|
+
export type CoordinateProps = {
|
|
121
|
+
transform?: boolean;
|
|
122
|
+
};
|
|
119
123
|
export type CoordinateComponent<O = Record<string, unknown>> = G2BaseComponent<
|
|
120
124
|
CoordinateTransform,
|
|
121
|
-
O
|
|
125
|
+
O,
|
|
126
|
+
CoordinateProps
|
|
122
127
|
>;
|
|
123
128
|
|
|
124
129
|
export type Palette = string[];
|
|
@@ -156,15 +161,17 @@ export type ThemeComponent<O = Record<string, unknown>> = G2BaseComponent<
|
|
|
156
161
|
>;
|
|
157
162
|
|
|
158
163
|
export type GuideComponent = (
|
|
159
|
-
|
|
164
|
+
scales: Scale[],
|
|
160
165
|
style: Record<string, any>,
|
|
161
166
|
coordinate: Coordinate,
|
|
162
167
|
theme: G2Theme,
|
|
163
168
|
) => DisplayObject;
|
|
164
169
|
export type GuideComponentProps = {
|
|
165
|
-
defaultPosition
|
|
170
|
+
defaultPosition?: GuideComponentPosition;
|
|
171
|
+
defaultOrientation?: GuideComponentOrientation;
|
|
166
172
|
defaultSize: number;
|
|
167
173
|
defaultOrder: number;
|
|
174
|
+
[key: string]: any;
|
|
168
175
|
};
|
|
169
176
|
export type GuideComponentComponent<O = Record<string, unknown>> =
|
|
170
177
|
G2BaseComponent<GuideComponent, O, GuideComponentProps>;
|
|
@@ -10,20 +10,20 @@ export type MarkOptions = Record<string, any>;
|
|
|
10
10
|
|
|
11
11
|
export type MarkComponent<O extends MarkOptions = MarkOptions> = {
|
|
12
12
|
(options?: O): Mark;
|
|
13
|
-
props
|
|
13
|
+
props?: MarkProps;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type MarkProps = {
|
|
17
|
-
defaultShape
|
|
17
|
+
defaultShape?: string;
|
|
18
18
|
defaultLabelShape?: string;
|
|
19
|
-
channels
|
|
19
|
+
channels?: Channel[];
|
|
20
20
|
preInference?: TransformSpec[];
|
|
21
21
|
postInference?: TransformSpec[];
|
|
22
22
|
composite?: boolean;
|
|
23
23
|
interaction?: {
|
|
24
24
|
shareTooltip?: boolean;
|
|
25
25
|
seriesTooltip?: boolean;
|
|
26
|
-
|
|
26
|
+
crosshairs?: boolean;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -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 = {
|
|
@@ -75,13 +83,15 @@ export type G2View = {
|
|
|
75
83
|
theme?: G2ThemeOptions;
|
|
76
84
|
title?: G2TitleOptions;
|
|
77
85
|
coordinates?: G2CoordinateOptions[];
|
|
86
|
+
coordinate?: Record<string, any>;
|
|
78
87
|
component?: G2GuideComponentOptions[];
|
|
79
|
-
|
|
88
|
+
interaction?: Record<string, any>;
|
|
80
89
|
marks?: G2Mark[];
|
|
81
90
|
frame?: boolean;
|
|
82
91
|
labelTransform?: G2LabelTransformOptions[];
|
|
83
92
|
style?: Record<string, any>;
|
|
84
93
|
tooltip?: boolean;
|
|
94
|
+
clip?: boolean;
|
|
85
95
|
};
|
|
86
96
|
|
|
87
97
|
export type G2Mark = {
|
|
@@ -100,6 +110,8 @@ export type G2Mark = {
|
|
|
100
110
|
facet?: boolean;
|
|
101
111
|
axis?: boolean | Record<string, any>;
|
|
102
112
|
legend?: boolean | Record<string, any>;
|
|
113
|
+
slider?: Record<string, any>;
|
|
114
|
+
scrollbar?: Record<string, any>;
|
|
103
115
|
filter?: (i: number) => boolean;
|
|
104
116
|
children?: G2MarkChildrenCallback;
|
|
105
117
|
dataDomain?: number;
|
|
@@ -107,6 +119,8 @@ export type G2Mark = {
|
|
|
107
119
|
frame?: boolean;
|
|
108
120
|
style?: Record<string, Primitive>;
|
|
109
121
|
labels?: Record<string, any>[];
|
|
122
|
+
interaction?: Record<string, any>;
|
|
123
|
+
coordinate?: Record<string, any>;
|
|
110
124
|
};
|
|
111
125
|
|
|
112
126
|
export type G2MarkChildrenCallback = (
|
|
@@ -178,9 +192,5 @@ export type G2CompositionOptions = G2BaseComponentOptions<CompositionComponent>;
|
|
|
178
192
|
export type G2AdjustOptions = G2BaseComponentOptions<AdjustComponent>;
|
|
179
193
|
export type G2LabelTransformOptions =
|
|
180
194
|
G2BaseComponentOptions<LabelTransformComponent>;
|
|
181
|
-
export type G2TitleOptions = G2Title
|
|
182
|
-
position?: GuideComponentPosition;
|
|
183
|
-
size?: number;
|
|
184
|
-
zIndex?: number;
|
|
185
|
-
};
|
|
195
|
+
export type G2TitleOptions = G2Title;
|
|
186
196
|
export type G2DataOptions = G2BaseComponent<DataComponent>;
|