@antv/g2 5.0.0-beta.1 → 5.0.0-beta.10
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 +8 -4
- 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.d.ts → d3Projection.d.ts} +0 -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 +149 -47
- 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 +2 -2
- package/esm/mark/area.js.map +1 -1
- package/esm/mark/boxplot.js +5 -18
- package/esm/mark/boxplot.js.map +1 -1
- package/esm/mark/cell.js +1 -1
- package/esm/mark/line.js +1 -1
- package/esm/mark/line.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 +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/plot.d.ts +1 -1
- package/esm/runtime/plot.js +155 -69
- 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 +59 -5
- package/esm/runtime/scale.js.map +1 -1
- package/esm/runtime/transform.js +17 -7
- 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 +1 -1
- package/esm/runtime/types/options.d.ts +14 -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/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 +67 -51
- 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/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 +11 -17
- 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.d.ts → select.d.ts} +0 -0
- package/esm/transform/{Select.js → select.js} +2 -14
- package/esm/transform/select.js.map +1 -0
- package/esm/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/esm/transform/{SelectX.js → selectX.js} +3 -3
- package/esm/transform/selectX.js.map +1 -0
- package/esm/transform/{SelectY.d.ts → selectY.d.ts} +0 -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 +8 -4
- 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.d.ts → d3Projection.d.ts} +0 -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 +146 -44
- 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 +2 -2
- package/lib/mark/area.js.map +1 -1
- package/lib/mark/boxplot.js +5 -18
- package/lib/mark/boxplot.js.map +1 -1
- package/lib/mark/cell.js +1 -1
- package/lib/mark/line.js +1 -1
- package/lib/mark/line.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 +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/plot.d.ts +1 -1
- package/lib/runtime/plot.js +152 -66
- 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 +61 -5
- package/lib/runtime/scale.js.map +1 -1
- package/lib/runtime/transform.js +17 -7
- 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 +1 -1
- package/lib/runtime/types/options.d.ts +14 -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/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 +69 -52
- 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/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.d.ts → select.d.ts} +0 -0
- package/lib/transform/{Select.js → select.js} +2 -14
- package/lib/transform/select.js.map +1 -0
- package/lib/transform/{SelectX.d.ts → selectX.d.ts} +0 -0
- package/lib/transform/{SelectX.js → selectX.js} +3 -3
- package/lib/transform/selectX.js.map +1 -0
- package/lib/transform/{SelectY.d.ts → selectY.d.ts} +0 -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 +22 -2
- 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/{d3-projection.ts → d3Projection.ts} +0 -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 +191 -49
- 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 +2 -2
- package/src/mark/boxplot.ts +3 -1
- package/src/mark/cell.ts +1 -1
- package/src/mark/line.ts +1 -1
- package/src/mark/pack.ts +0 -1
- package/src/mark/treemap.ts +0 -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/plot.ts +253 -118
- package/src/runtime/render.ts +33 -72
- package/src/runtime/scale.ts +70 -7
- package/src/runtime/transform.ts +22 -6
- package/src/runtime/types/common.ts +50 -20
- package/src/runtime/types/component.ts +18 -11
- package/src/runtime/types/mark.ts +1 -1
- package/src/runtime/types/options.ts +30 -22
- package/src/runtime/types/scale.ts +20 -0
- package/src/runtime/types/theme.ts +8 -5
- 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 +95 -60
- 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/theme.ts +6 -2
- package/src/spec/transform.ts +47 -3
- package/src/spec/utils.ts +7 -0
- package/src/stdlib/index.ts +73 -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/src/theme/light.ts
CHANGED
|
@@ -2,30 +2,13 @@ import { ThemeComponent as TC, Theme } from '../runtime';
|
|
|
2
2
|
|
|
3
3
|
export type LightOptions = Theme;
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
65: '#595959',
|
|
10
|
-
45: '#8C8C8C',
|
|
11
|
-
25: '#BFBFBF',
|
|
12
|
-
15: '#D9D9D9',
|
|
13
|
-
6: '#F0F0F0',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const WHITE_COLORS = {
|
|
17
|
-
100: '#FFFFFF',
|
|
18
|
-
95: '#F2F2F2',
|
|
19
|
-
85: '#D9D9D9',
|
|
20
|
-
65: '#A6A6A6',
|
|
21
|
-
45: '#737373',
|
|
22
|
-
25: '#404040',
|
|
23
|
-
15: '#262626',
|
|
24
|
-
6: '#0F0F0F',
|
|
5
|
+
const COLORS = {
|
|
6
|
+
BLACK: '#000',
|
|
7
|
+
WHITE: '#fff',
|
|
8
|
+
STROKE: '#416180',
|
|
25
9
|
};
|
|
26
10
|
|
|
27
11
|
const BACKGROUND_COLOR = 'transparent';
|
|
28
|
-
const STROKE_COLOR = '#416180';
|
|
29
12
|
|
|
30
13
|
/**
|
|
31
14
|
* Default theme.
|
|
@@ -37,12 +20,22 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
37
20
|
defaultCategory10: 'category10',
|
|
38
21
|
defaultCategory20: 'category20',
|
|
39
22
|
defaultSize: 1,
|
|
40
|
-
elementActiveStroke:
|
|
23
|
+
elementActiveStroke: COLORS.BLACK,
|
|
41
24
|
enter: {
|
|
42
25
|
duration: 300,
|
|
43
26
|
fill: 'both',
|
|
44
27
|
delay: 0,
|
|
45
28
|
},
|
|
29
|
+
update: {
|
|
30
|
+
duration: 300,
|
|
31
|
+
fill: 'both',
|
|
32
|
+
delay: 0,
|
|
33
|
+
},
|
|
34
|
+
exit: {
|
|
35
|
+
duration: 300,
|
|
36
|
+
fill: 'both',
|
|
37
|
+
delay: 0,
|
|
38
|
+
},
|
|
46
39
|
// --- Theme of area style
|
|
47
40
|
viewFill: BACKGROUND_COLOR,
|
|
48
41
|
plotFill: 'transparent',
|
|
@@ -64,19 +57,16 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
64
57
|
},
|
|
65
58
|
hollow: {
|
|
66
59
|
r: 3,
|
|
67
|
-
fill: '',
|
|
68
60
|
strokeOpacity: 0.95,
|
|
69
61
|
lineWidth: 1,
|
|
70
62
|
},
|
|
71
63
|
plus: {
|
|
72
64
|
r: 3,
|
|
73
|
-
fill: '',
|
|
74
65
|
strokeOpacity: 0.95,
|
|
75
66
|
lineWidth: 3,
|
|
76
67
|
},
|
|
77
68
|
diamond: {
|
|
78
69
|
r: 3,
|
|
79
|
-
fill: '',
|
|
80
70
|
strokeOpacity: 0.95,
|
|
81
71
|
lineWidth: 1,
|
|
82
72
|
},
|
|
@@ -103,6 +93,16 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
103
93
|
},
|
|
104
94
|
},
|
|
105
95
|
cell: {
|
|
96
|
+
cell: {
|
|
97
|
+
fillOpacity: 0.95,
|
|
98
|
+
},
|
|
99
|
+
hollow: {
|
|
100
|
+
fill: '',
|
|
101
|
+
strokeOpacity: 1,
|
|
102
|
+
lineWidth: 2,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
rect: {
|
|
106
106
|
rect: {
|
|
107
107
|
fillOpacity: 0.95,
|
|
108
108
|
},
|
|
@@ -126,20 +126,20 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
126
126
|
box: {
|
|
127
127
|
box: {
|
|
128
128
|
fillOpacity: 0.95,
|
|
129
|
-
stroke:
|
|
129
|
+
stroke: COLORS.BLACK,
|
|
130
130
|
lineWidth: 1,
|
|
131
131
|
},
|
|
132
132
|
},
|
|
133
133
|
text: {
|
|
134
134
|
text: {
|
|
135
|
-
// fill:
|
|
135
|
+
// fill: COLORS.BLACK,fillOpacity: 0.65,
|
|
136
136
|
fill: '#1D2129',
|
|
137
137
|
fontSize: 12,
|
|
138
138
|
strokeWidth: 0,
|
|
139
|
-
connectorStroke:
|
|
139
|
+
connectorStroke: COLORS.STROKE,
|
|
140
140
|
connectorStrokeOpacity: 0.45,
|
|
141
141
|
connectorLineWidth: 1,
|
|
142
|
-
backgroundFill:
|
|
142
|
+
backgroundFill: COLORS.STROKE,
|
|
143
143
|
backgroundFillOpacity: 0.15,
|
|
144
144
|
backgroundPadding: [2, 4],
|
|
145
145
|
startMarkerSymbol: 'circle',
|
|
@@ -154,48 +154,48 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
154
154
|
fontSize: 10,
|
|
155
155
|
textAlign: 'center',
|
|
156
156
|
textBaseline: 'middle',
|
|
157
|
-
markerFill:
|
|
157
|
+
markerFill: COLORS.STROKE,
|
|
158
158
|
markerFillOpacity: 0.25,
|
|
159
159
|
markerStrokeOpacity: 0,
|
|
160
160
|
},
|
|
161
161
|
},
|
|
162
162
|
lineX: {
|
|
163
163
|
line: {
|
|
164
|
-
stroke:
|
|
164
|
+
stroke: COLORS.STROKE,
|
|
165
165
|
strokeOpacity: 0.45,
|
|
166
166
|
lineWidth: 1,
|
|
167
167
|
},
|
|
168
168
|
},
|
|
169
169
|
lineY: {
|
|
170
170
|
line: {
|
|
171
|
-
stroke:
|
|
171
|
+
stroke: COLORS.STROKE,
|
|
172
172
|
strokeOpacity: 0.45,
|
|
173
173
|
lineWidth: 1,
|
|
174
174
|
},
|
|
175
175
|
},
|
|
176
176
|
rangeX: {
|
|
177
177
|
range: {
|
|
178
|
-
fill:
|
|
178
|
+
fill: COLORS.STROKE,
|
|
179
179
|
fillOpacity: 0.15,
|
|
180
180
|
lineWidth: 0,
|
|
181
181
|
},
|
|
182
182
|
},
|
|
183
183
|
rangeY: {
|
|
184
184
|
range: {
|
|
185
|
-
fill:
|
|
185
|
+
fill: COLORS.STROKE,
|
|
186
186
|
fillOpacity: 0.15,
|
|
187
187
|
lineWidth: 0,
|
|
188
188
|
},
|
|
189
189
|
},
|
|
190
190
|
connector: {
|
|
191
191
|
connector: {
|
|
192
|
-
stroke:
|
|
192
|
+
stroke: COLORS.STROKE,
|
|
193
193
|
strokeOpacity: 0.45,
|
|
194
194
|
lineWidth: 1,
|
|
195
195
|
connectLength1: 12,
|
|
196
196
|
endMarker: true,
|
|
197
197
|
endMarkerSize: 6,
|
|
198
|
-
endMarkerFill:
|
|
198
|
+
endMarkerFill: COLORS.STROKE,
|
|
199
199
|
endMarkerFillOpacity: 0.95,
|
|
200
200
|
},
|
|
201
201
|
},
|
|
@@ -205,7 +205,7 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
205
205
|
line: { lineWidth: 3 },
|
|
206
206
|
},
|
|
207
207
|
interval: {
|
|
208
|
-
rect: { stroke:
|
|
208
|
+
rect: { stroke: COLORS.BLACK },
|
|
209
209
|
},
|
|
210
210
|
area: {
|
|
211
211
|
area: { fillOpacity: 0.5 },
|
|
@@ -221,93 +221,158 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
221
221
|
},
|
|
222
222
|
axis: {
|
|
223
223
|
// axis title
|
|
224
|
-
titleFill:
|
|
225
|
-
titleFillOpacity:
|
|
224
|
+
titleFill: COLORS.BLACK,
|
|
225
|
+
titleFillOpacity: 0.65,
|
|
226
226
|
titleFontSize: 12,
|
|
227
227
|
titleFontWeight: 'normal',
|
|
228
228
|
titleSpacing: 12,
|
|
229
229
|
// axis line
|
|
230
|
-
lineStroke:
|
|
230
|
+
lineStroke: COLORS.BLACK,
|
|
231
231
|
lineStrokeOpacity: 0.45,
|
|
232
232
|
lineLineWidth: 0.5,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
lineArrow: null,
|
|
234
|
+
// axis tick line
|
|
235
|
+
tickStroke: COLORS.BLACK,
|
|
236
|
+
tickStrokeOpacity: 0.25,
|
|
237
|
+
tickLineWidth: 1,
|
|
238
|
+
tickLength: 4,
|
|
237
239
|
// axis label
|
|
238
|
-
labelFill:
|
|
239
|
-
labelFillOpacity:
|
|
240
|
+
labelFill: COLORS.BLACK,
|
|
241
|
+
labelFillOpacity: 0.65,
|
|
240
242
|
labelFontSize: 12,
|
|
241
243
|
labelFontWeight: 'lighter',
|
|
242
244
|
labelSpacing: 8, // spacing between label and it's tick
|
|
245
|
+
labelAlign: 'horizontal',
|
|
243
246
|
// axis grid
|
|
244
|
-
gridStroke:
|
|
245
|
-
gridStrokeOpacity:
|
|
247
|
+
gridStroke: COLORS.BLACK,
|
|
248
|
+
gridStrokeOpacity: 0.05,
|
|
246
249
|
gridLineWidth: 0.5,
|
|
247
250
|
gridLineDash: [0, 0],
|
|
251
|
+
titleTransformOrigin: 'center',
|
|
252
|
+
},
|
|
253
|
+
axisTop: {
|
|
254
|
+
titlePosition: 'top',
|
|
255
|
+
titleSpacing: 0,
|
|
256
|
+
titleTextBaseline: 'middle',
|
|
257
|
+
labelSpacing: 8,
|
|
258
|
+
labelDirection: 'negative',
|
|
259
|
+
tickDirection: 'negative',
|
|
260
|
+
gridDirection: 'positive',
|
|
261
|
+
},
|
|
262
|
+
axisBottom: {
|
|
263
|
+
titleSpacing: 10,
|
|
264
|
+
titleTextBaseline: 'bottom',
|
|
265
|
+
labelSpacing: 12,
|
|
266
|
+
labelDirection: 'positive',
|
|
267
|
+
tickDirection: 'positive',
|
|
268
|
+
gridDirection: 'negative',
|
|
269
|
+
},
|
|
270
|
+
axisLeft: {
|
|
271
|
+
titleTextBaseline: 'middle',
|
|
272
|
+
titleSpacing: 10,
|
|
273
|
+
titlePosition: 'left',
|
|
274
|
+
titleTransformOrigin: 'center',
|
|
275
|
+
titleTransform: `translate(50%, 0) rotate(-90)`,
|
|
276
|
+
labelSpacing: 4,
|
|
277
|
+
labelDirection: 'positive',
|
|
278
|
+
labelAutoRotate: false,
|
|
279
|
+
tickDirection: 'positive',
|
|
280
|
+
gridDirection: 'negative',
|
|
281
|
+
},
|
|
282
|
+
axisRight: {
|
|
283
|
+
titleTextBaseline: 'top',
|
|
284
|
+
titleSpacing: 0,
|
|
285
|
+
titlePosition: 'right',
|
|
286
|
+
titleTransformOrigin: 'center',
|
|
287
|
+
titleTransform: `translate(-50%, 0) rotate(-90)`,
|
|
288
|
+
labelSpacing: 4,
|
|
289
|
+
labelDirection: 'negative',
|
|
290
|
+
tickDirection: 'negative',
|
|
291
|
+
gridDirection: 'positive',
|
|
292
|
+
},
|
|
293
|
+
axisLinear: {
|
|
294
|
+
titlePosition: 'top',
|
|
295
|
+
titleSpacing: 0,
|
|
296
|
+
gridDirection: 'negative',
|
|
297
|
+
gridConnect: 'arc',
|
|
298
|
+
gridType: 'surround',
|
|
299
|
+
girdClosed: true,
|
|
300
|
+
},
|
|
301
|
+
axisRadar: {
|
|
302
|
+
titlePosition: 'start',
|
|
303
|
+
showTick: false,
|
|
304
|
+
showLabel: false,
|
|
305
|
+
gridType: 'surround',
|
|
306
|
+
girdClosed: true,
|
|
307
|
+
gridStrokeOpacity: 0.3,
|
|
248
308
|
},
|
|
249
309
|
legend: {
|
|
250
310
|
padding: 8,
|
|
251
|
-
// legend title
|
|
252
311
|
showTitle: false,
|
|
253
|
-
titleFill:
|
|
312
|
+
titleFill: COLORS.BLACK,
|
|
313
|
+
titleFillOpacity: 0.45,
|
|
254
314
|
titleFontSize: 12,
|
|
255
|
-
titleLineHeight: 21,
|
|
256
315
|
titleFontWeight: 'normal',
|
|
257
316
|
titleSpacing: 4,
|
|
258
317
|
// legend marker
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
itemLabelFill:
|
|
264
|
-
itemLabelFillOpacity:
|
|
318
|
+
// itemMarkerFill: DEFAULT_COLOR,
|
|
319
|
+
itemMarkerFillOpacity: 1,
|
|
320
|
+
itemMarkerSize: 8,
|
|
321
|
+
itemSpacing: [5, 8],
|
|
322
|
+
itemLabelFill: COLORS.BLACK,
|
|
323
|
+
itemLabelFillOpacity: 0.65,
|
|
265
324
|
itemLabelFontSize: 12,
|
|
266
325
|
itemLabelFontWeight: 'normal',
|
|
267
|
-
itemValueFill:
|
|
268
|
-
itemValueFillOpacity: 0.
|
|
326
|
+
itemValueFill: COLORS.BLACK,
|
|
327
|
+
itemValueFillOpacity: 0.65,
|
|
269
328
|
itemValueFontSize: 12,
|
|
270
329
|
itemValueFontWeight: 'normal',
|
|
271
330
|
itemBackgroundFill: 'transparent',
|
|
272
331
|
// [todo] rename legend navigator
|
|
273
|
-
navButtonFill:
|
|
274
|
-
navButtonFillOpacity:
|
|
275
|
-
navPageNumFill:
|
|
332
|
+
navButtonFill: COLORS.BLACK,
|
|
333
|
+
navButtonFillOpacity: 0.65,
|
|
334
|
+
navPageNumFill: COLORS.BLACK,
|
|
335
|
+
navPageNumFillOpacity: 0.45,
|
|
276
336
|
navPageNumFontSize: 12,
|
|
277
337
|
// others
|
|
278
338
|
backgroundFill: 'transparent',
|
|
279
339
|
},
|
|
280
340
|
continuousLegend: {
|
|
281
|
-
labelFill:
|
|
341
|
+
labelFill: COLORS.BLACK,
|
|
342
|
+
labelFillOpacity: 0.45,
|
|
282
343
|
labelFontSize: 12,
|
|
283
|
-
labelLineHeight: 12,
|
|
284
344
|
labelFontWeight: 'normal',
|
|
285
345
|
handleWidth: 10,
|
|
286
346
|
handleHeight: 12,
|
|
287
|
-
handleMarkerFill:
|
|
288
|
-
|
|
347
|
+
handleMarkerFill: COLORS.BLACK,
|
|
348
|
+
handleMarkerFillOpacity: 0.6,
|
|
349
|
+
handleMarkerStroke: COLORS.BLACK,
|
|
350
|
+
handleMarkerStrokeOpacity: 0.25,
|
|
289
351
|
handleMarkerLineWidth: 1,
|
|
290
|
-
handleLabelFill:
|
|
352
|
+
handleLabelFill: COLORS.BLACK,
|
|
353
|
+
handleLabelFillOpacity: 0.45,
|
|
291
354
|
handleLabelFontSize: 12,
|
|
292
|
-
handleLabelLineHeight: 12,
|
|
293
355
|
handleLabelFontWeight: 'normal',
|
|
356
|
+
labelShowTick: true,
|
|
357
|
+
labelSpacing: 8,
|
|
294
358
|
// [todo] legend rail
|
|
295
359
|
},
|
|
296
360
|
label: {
|
|
297
|
-
fill:
|
|
361
|
+
fill: COLORS.BLACK,
|
|
298
362
|
fillOpacity: 0.65,
|
|
299
363
|
fontSize: 12,
|
|
300
364
|
fontWeight: 'normal',
|
|
301
365
|
stroke: null,
|
|
302
366
|
offset: 12,
|
|
303
|
-
connectorStroke:
|
|
367
|
+
connectorStroke: COLORS.BLACK,
|
|
304
368
|
connectorStrokeOpacity: 0.45,
|
|
305
369
|
connectorLineWidth: 1,
|
|
370
|
+
connectorLength: 12,
|
|
306
371
|
connectorLength2: 8,
|
|
307
372
|
connectorDistance: 4,
|
|
308
373
|
},
|
|
309
374
|
innerLabel: {
|
|
310
|
-
fill:
|
|
375
|
+
fill: COLORS.WHITE,
|
|
311
376
|
fontSize: 12,
|
|
312
377
|
fillOpacity: 0.85,
|
|
313
378
|
fontWeight: 'normal',
|
|
@@ -315,38 +380,48 @@ export const Light: TC<LightOptions> = (options) => {
|
|
|
315
380
|
offset: 0,
|
|
316
381
|
},
|
|
317
382
|
slider: {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
383
|
+
trackSize: 16,
|
|
384
|
+
backgroundFill: COLORS.STROKE,
|
|
385
|
+
backgroundFillOpacity: 1,
|
|
386
|
+
selectionFill: DEFAULT_COLOR,
|
|
387
|
+
selectionFillOpacity: 0.15,
|
|
388
|
+
handleIconSize: 10,
|
|
389
|
+
handleIconFill: '#f7f7f7',
|
|
390
|
+
handleIconFillOpacity: 1,
|
|
391
|
+
handleIconStroke: COLORS.BLACK,
|
|
392
|
+
handleIconStrokeOpacity: 0.25,
|
|
393
|
+
handleIconLineWidth: 1,
|
|
394
|
+
handleIconRadius: 2,
|
|
395
|
+
handleLabelFill: COLORS.BLACK,
|
|
396
|
+
handleLabelFillOpacity: 0.45,
|
|
397
|
+
handleLabelFontSize: 12,
|
|
398
|
+
handleLabelFontWeight: 'normal',
|
|
399
|
+
},
|
|
400
|
+
scrollbar: {
|
|
401
|
+
padding: [2, 2, 2, 2],
|
|
402
|
+
trackSize: 10,
|
|
403
|
+
isRound: true,
|
|
404
|
+
slidable: true,
|
|
405
|
+
scrollable: true,
|
|
406
|
+
trackFill: '#e5e5e5',
|
|
407
|
+
trackFillOpacity: 0,
|
|
408
|
+
trackStroke: 'none',
|
|
409
|
+
thumbFill: '#000',
|
|
410
|
+
thumbFillOpacity: 0.15,
|
|
411
|
+
thumbStroke: 'none',
|
|
412
|
+
thumbHighlightedFillOpacity: 0.2,
|
|
413
|
+
},
|
|
337
414
|
title: {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
fontWeight: 'normal',
|
|
349
|
-
textBaseline: 'top',
|
|
415
|
+
titleFill: COLORS.BLACK,
|
|
416
|
+
titleFillOpacity: 0.85,
|
|
417
|
+
titleFontSize: 14,
|
|
418
|
+
titleFontWeight: 'bold',
|
|
419
|
+
titleTextBaseline: 'top',
|
|
420
|
+
subtitleFill: COLORS.BLACK,
|
|
421
|
+
subtitleFillOpacity: 0.65,
|
|
422
|
+
subtitleFontSize: 12,
|
|
423
|
+
subtitleFontWeight: 'normal',
|
|
424
|
+
subtitleTextBaseline: 'top',
|
|
350
425
|
},
|
|
351
426
|
};
|
|
352
427
|
return Object.assign({}, defaultOptions, options);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { deepMix } from '@antv/util';
|
|
2
|
+
import { TransformComponent as TC } from '../runtime';
|
|
3
|
+
import { FilterTransform } from '../spec';
|
|
4
|
+
import { defined } from '../utils/helper';
|
|
5
|
+
import { columnOf } from './utils/helper';
|
|
6
|
+
|
|
7
|
+
export type FilterOptions = Omit<FilterTransform, 'type'>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The Filter transform filter channels.
|
|
11
|
+
*/
|
|
12
|
+
export const Filter: TC<FilterOptions> = (options = {}) => {
|
|
13
|
+
return (I, mark) => {
|
|
14
|
+
const { encode } = mark;
|
|
15
|
+
const filters = Object.entries(options)
|
|
16
|
+
.map(([key, value]) => {
|
|
17
|
+
const [V] = columnOf(encode, key);
|
|
18
|
+
// Skip empty channel.
|
|
19
|
+
if (!V) return null;
|
|
20
|
+
if (typeof value === 'function') return (i) => value(V[i]);
|
|
21
|
+
const expectedValues = Array.isArray(value) ? value : [value];
|
|
22
|
+
// Skip empty expected values.
|
|
23
|
+
if (expectedValues.length === 0) return null;
|
|
24
|
+
return (i) => expectedValues.includes(V[i]);
|
|
25
|
+
})
|
|
26
|
+
.filter(defined);
|
|
27
|
+
|
|
28
|
+
// Skip empty filters.
|
|
29
|
+
if (filters.length === 0) return [I, mark];
|
|
30
|
+
|
|
31
|
+
// Filter index and channels.
|
|
32
|
+
const totalFilter = (i) => filters.every((f) => f(i));
|
|
33
|
+
const FI = I.filter(totalFilter);
|
|
34
|
+
const newIndex = FI.map((_, i) => i);
|
|
35
|
+
const newEncodes = Object.entries(encode).map(([key, encode]) => {
|
|
36
|
+
return [
|
|
37
|
+
key,
|
|
38
|
+
{
|
|
39
|
+
...encode,
|
|
40
|
+
value: newIndex.map((i) => encode.value[FI[i]]),
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
});
|
|
44
|
+
return [I, deepMix({}, mark, { encode: Object.fromEntries(newEncodes) })];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
Filter.props = {};
|
package/src/transform/groupN.ts
CHANGED
|
@@ -94,6 +94,8 @@ export const GroupN: TC<GroupNOptions> = (options = {}) => {
|
|
|
94
94
|
return (I, mark) => {
|
|
95
95
|
const { data, encode } = mark;
|
|
96
96
|
const groups = groupBy(I, mark);
|
|
97
|
+
if (!groups) return [I, mark];
|
|
98
|
+
|
|
97
99
|
const outputs = Object.entries(rest).map(([channel, reducer]) => {
|
|
98
100
|
const [reducerFunction, formatter] = normalizeReducer(reducer);
|
|
99
101
|
const [V, field] = columnOf(encode, channel);
|
package/src/transform/index.ts
CHANGED
|
@@ -24,9 +24,9 @@ export { Jitter } from './jitter';
|
|
|
24
24
|
export { JitterX } from './jitterX';
|
|
25
25
|
export { SymmetryY } from './symmetryY';
|
|
26
26
|
export { DiffY } from './diffY';
|
|
27
|
-
export { Select } from './
|
|
28
|
-
export { SelectX } from './
|
|
29
|
-
export { SelectY } from './
|
|
27
|
+
export { Select } from './select';
|
|
28
|
+
export { SelectX } from './selectX';
|
|
29
|
+
export { SelectY } from './selectY';
|
|
30
30
|
export { GroupX } from './groupX';
|
|
31
31
|
export { GroupY } from './groupY';
|
|
32
32
|
export { Group } from './group';
|
|
@@ -38,6 +38,8 @@ export { FlexX } from './flexX';
|
|
|
38
38
|
export { Pack } from './pack';
|
|
39
39
|
export { BinX } from './binX';
|
|
40
40
|
export { Bin } from './bin';
|
|
41
|
+
export { Sample } from './sample';
|
|
42
|
+
export { Filter } from './filter';
|
|
41
43
|
|
|
42
44
|
export type { MaybeZeroY1Options } from './maybeZeroY1';
|
|
43
45
|
export type { MaybeStackYOptions } from './maybeStackY';
|
|
@@ -65,9 +67,9 @@ export type { JitterOptions } from './jitter';
|
|
|
65
67
|
export type { JitterXOptions } from './jitterX';
|
|
66
68
|
export type { SymmetryYOptions } from './symmetryY';
|
|
67
69
|
export type { DiffYOptions } from './diffY';
|
|
68
|
-
export type { SelectOptions } from './
|
|
69
|
-
export type { SelectXOptions } from './
|
|
70
|
-
export type { SelectYOptions } from './
|
|
70
|
+
export type { SelectOptions } from './select';
|
|
71
|
+
export type { SelectXOptions } from './selectX';
|
|
72
|
+
export type { SelectYOptions } from './selectY';
|
|
71
73
|
export type { GroupXOptions } from './groupX';
|
|
72
74
|
export type { GroupYOptions } from './groupY';
|
|
73
75
|
export type { GroupOptions } from './group';
|
|
@@ -79,3 +81,5 @@ export type { FlexXOptions } from './flexX';
|
|
|
79
81
|
export type { PackOptions } from './pack';
|
|
80
82
|
export type { BinXOptions } from './binX';
|
|
81
83
|
export type { BinOptions } from './bin';
|
|
84
|
+
export type { SampleOptions } from './sample';
|
|
85
|
+
export type { FilterOptions } from './filter';
|
|
@@ -25,7 +25,9 @@ export const MaybeTooltip: TC<MaybeTooltipOptions> = (options) => {
|
|
|
25
25
|
const E = [[key, column(V)]];
|
|
26
26
|
// Only show channel with field.
|
|
27
27
|
if (V && fv !== null) {
|
|
28
|
-
|
|
28
|
+
const T = V.map((v) => ({ value: v, field: fv }));
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
E.push([`tooltip${index === 0 ? '' : index}`, column(T, fv)]);
|
|
29
31
|
index++;
|
|
30
32
|
}
|
|
31
33
|
return E;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// @ts-ignore medianIndex exist in d3-array@3.2.0, but @types/d3-array Expired.
|
|
2
|
+
import { maxIndex, minIndex, medianIndex } from 'd3-array';
|
|
3
|
+
import { TransformComponent as TC, Primitive } from '../runtime';
|
|
4
|
+
import { SampleTransform, SampleFunction } from '../spec';
|
|
5
|
+
import { createGroups } from './utils/order';
|
|
6
|
+
import { columnOf } from './utils/helper';
|
|
7
|
+
import { lttb } from './utils/lttb';
|
|
8
|
+
|
|
9
|
+
export type SampleOptions = Omit<SampleTransform, 'type'>;
|
|
10
|
+
|
|
11
|
+
function normalizeSample(
|
|
12
|
+
strategy: SampleTransform['strategy'],
|
|
13
|
+
): SampleFunction {
|
|
14
|
+
if (typeof strategy === 'function') return strategy;
|
|
15
|
+
if (strategy === 'lttb') return lttb;
|
|
16
|
+
|
|
17
|
+
const strategies = {
|
|
18
|
+
first: (f: number[]) => [f[0]],
|
|
19
|
+
last: (f: number[]) => [f[f.length - 1]],
|
|
20
|
+
min: (f: number[], X: number[], Y: number[]) => [
|
|
21
|
+
f[minIndex(f, (i) => Y[i])],
|
|
22
|
+
],
|
|
23
|
+
max: (f: number[], X: number[], Y: number[]) => [
|
|
24
|
+
f[maxIndex(f, (i) => Y[i])],
|
|
25
|
+
],
|
|
26
|
+
median: (f: number[], X: number[], Y: number[]) => [
|
|
27
|
+
f[medianIndex(f, (i) => Y[i])],
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
const sampleFunction = strategies[strategy] || strategies.median;
|
|
31
|
+
return (I: number[], X: number[], Y: number[], thresholds: number) => {
|
|
32
|
+
// Sepreate group to frames, then sample each frame.
|
|
33
|
+
// Keep more data as possible.
|
|
34
|
+
const frameSize = Math.max(1, Math.floor(I.length / thresholds));
|
|
35
|
+
const frames = getFrames(I, frameSize);
|
|
36
|
+
return frames.flatMap((frame) => sampleFunction(frame, X, Y));
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Split the array into frame with each frameSize.
|
|
42
|
+
*/
|
|
43
|
+
function getFrames(I: Primitive[], frameSize: number): number[][] {
|
|
44
|
+
const size = I.length;
|
|
45
|
+
const frames = [];
|
|
46
|
+
let i = 0;
|
|
47
|
+
while (i < size) {
|
|
48
|
+
frames.push(I.slice(i, (i += frameSize)));
|
|
49
|
+
}
|
|
50
|
+
return frames;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The sample transform groups marks with specified groupBy fields, and
|
|
55
|
+
* sample data for each group when data.length >= threshold(default = 2000).
|
|
56
|
+
*/
|
|
57
|
+
export const Sample: TC<SampleOptions> = (options = {}) => {
|
|
58
|
+
const {
|
|
59
|
+
strategy = 'median',
|
|
60
|
+
thresholds = 2000,
|
|
61
|
+
groupBy = ['series', 'color'],
|
|
62
|
+
} = options;
|
|
63
|
+
const sampleFunction = normalizeSample(strategy);
|
|
64
|
+
|
|
65
|
+
return (I, mark) => {
|
|
66
|
+
const { encode } = mark;
|
|
67
|
+
const groups = createGroups(groupBy, I, mark);
|
|
68
|
+
const [X] = columnOf(encode, 'x');
|
|
69
|
+
const [Y] = columnOf(encode, 'y');
|
|
70
|
+
|
|
71
|
+
return [
|
|
72
|
+
groups.flatMap((g) =>
|
|
73
|
+
sampleFunction(g, X as number[], Y as number[], thresholds),
|
|
74
|
+
),
|
|
75
|
+
mark,
|
|
76
|
+
];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
Sample.props = {};
|
package/src/transform/select.ts
CHANGED
|
@@ -39,11 +39,10 @@ function normalizeSelector(selector: Selector): SelectorFunction {
|
|
|
39
39
|
* pull a single or multiple values out of each series.
|
|
40
40
|
*/
|
|
41
41
|
export const Select: TC<SelectOptions> = (options = {}) => {
|
|
42
|
-
const { groupBy = 'series',
|
|
42
|
+
const { groupBy = 'series', channel, selector } = options;
|
|
43
43
|
return (I, mark) => {
|
|
44
44
|
const { encode } = mark;
|
|
45
45
|
const groups = createGroups(groupBy, I, mark);
|
|
46
|
-
const [channel, selector] = Object.entries(rest)[0];
|
|
47
46
|
const [V] = columnOf(encode, channel);
|
|
48
47
|
const selectFunction = normalizeSelector(selector);
|
|
49
48
|
return [groups.flatMap((GI) => selectFunction(GI, V as number[])), mark];
|
package/src/transform/selectX.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransformComponent as TC } from '../runtime';
|
|
2
2
|
import { SelectXTransform } from '../spec';
|
|
3
|
-
import { Select } from './
|
|
3
|
+
import { Select } from './select';
|
|
4
4
|
|
|
5
5
|
export type SelectXOptions = Omit<SelectXTransform, 'type'>;
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ export type SelectXOptions = Omit<SelectXTransform, 'type'>;
|
|
|
9
9
|
*/
|
|
10
10
|
export const SelectX: TC<SelectXOptions> = (options = {}) => {
|
|
11
11
|
const { selector, ...rest } = options;
|
|
12
|
-
return Select({
|
|
12
|
+
return Select({ channel: 'x', selector, ...rest });
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
SelectX.props = {};
|