echarts 4.0.1 → 4.1.0
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/.jshintrc-dist +70 -0
- package/KEYS +74 -0
- package/LICENSE +223 -29
- package/NOTICE +5 -0
- package/README.md +22 -8
- package/build/addHeader.js +113 -0
- package/build/amd2common.js +19 -0
- package/build/build.js +19 -0
- package/build/config.js +25 -1
- package/build/mangleString.js +19 -0
- package/build/optimize.js +19 -0
- package/build/pre-publish.js +26 -3
- package/build/preamble.js +20 -0
- package/build/rollup-plugin-ec-lang.js +20 -0
- package/build/rollup-plugin-ec-remove-dev.js +19 -0
- package/dist/echarts-en.common.js +7106 -1621
- package/dist/echarts-en.common.min.js +21 -1
- package/dist/echarts-en.js +13949 -4217
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +21 -1
- package/dist/echarts-en.simple.js +5206 -1375
- package/dist/echarts-en.simple.min.js +21 -1
- package/dist/echarts.common.js +7106 -1621
- package/dist/echarts.common.min.js +21 -1
- package/dist/echarts.js +13949 -4217
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +21 -1
- package/dist/echarts.simple.js +5206 -1375
- package/dist/echarts.simple.min.js +21 -1
- package/dist/extension/bmap.js +76 -0
- package/dist/extension/bmap.js.map +1 -1
- package/dist/extension/bmap.min.js +20 -0
- package/dist/extension/dataTool.js +95 -0
- package/dist/extension/dataTool.js.map +1 -1
- package/dist/extension/dataTool.min.js +20 -0
- package/echarts.all.js +19 -0
- package/echarts.blank.js +19 -0
- package/echarts.common.js +19 -0
- package/echarts.simple.js +19 -0
- package/extension/bmap/BMapCoordSys.js +19 -0
- package/extension/bmap/BMapModel.js +18 -0
- package/extension/bmap/BMapView.js +18 -0
- package/extension/bmap/bmap.js +19 -0
- package/extension/dataTool/gexf.js +18 -0
- package/extension/dataTool/index.js +19 -0
- package/extension/dataTool/prepareBoxplotData.js +19 -0
- package/extension/dataTool/quantile.js +19 -0
- package/extension/echarts.js +19 -0
- package/extension/webpack.config.js +19 -0
- package/extension-src/bmap/BMapCoordSys.js +19 -0
- package/extension-src/bmap/BMapModel.js +19 -0
- package/extension-src/bmap/BMapView.js +19 -0
- package/extension-src/bmap/bmap.js +19 -0
- package/extension-src/dataTool/gexf.js +19 -0
- package/extension-src/dataTool/index.js +19 -0
- package/extension-src/dataTool/prepareBoxplotData.js +19 -0
- package/extension-src/dataTool/quantile.js +19 -0
- package/index.common.js +19 -0
- package/index.js +19 -0
- package/index.simple.js +19 -0
- package/lib/CoordinateSystem.js +18 -0
- package/lib/ExtensionAPI.js +18 -0
- package/lib/action/createDataSelectAction.js +18 -0
- package/lib/action/geoRoam.js +19 -0
- package/lib/action/roamHelper.js +19 -0
- package/lib/chart/bar/BarSeries.js +42 -1
- package/lib/chart/bar/BarView.js +120 -15
- package/lib/chart/bar/BaseBarSeries.js +22 -0
- package/lib/chart/bar/PictorialBarSeries.js +18 -0
- package/lib/chart/bar/PictorialBarView.js +19 -0
- package/lib/chart/bar/barItemStyle.js +18 -0
- package/lib/chart/bar/helper.js +18 -0
- package/lib/chart/bar.js +28 -7
- package/lib/chart/boxplot/BoxplotSeries.js +35 -1
- package/lib/chart/boxplot/BoxplotView.js +128 -21
- package/lib/chart/boxplot/boxplotLayout.js +70 -63
- package/lib/chart/boxplot/boxplotVisual.js +18 -0
- package/lib/chart/boxplot.js +18 -0
- package/lib/chart/candlestick/CandlestickSeries.js +38 -4
- package/lib/chart/candlestick/CandlestickView.js +236 -22
- package/lib/chart/candlestick/candlestickLayout.js +143 -83
- package/lib/chart/candlestick/candlestickVisual.js +59 -14
- package/lib/chart/candlestick/preprocessor.js +18 -0
- package/lib/chart/candlestick.js +18 -0
- package/lib/chart/chord/ChordSeries.js +18 -0
- package/lib/chart/chord/ChordView.js +18 -0
- package/lib/chart/chord/Ribbon.js +18 -0
- package/lib/chart/chord/chordCircularLayout.js +19 -0
- package/lib/chart/chord.js +18 -0
- package/lib/chart/custom.js +20 -2
- package/lib/chart/effectScatter/EffectScatterSeries.js +18 -0
- package/lib/chart/effectScatter/EffectScatterView.js +18 -0
- package/lib/chart/effectScatter.js +18 -0
- package/lib/chart/funnel/FunnelSeries.js +19 -0
- package/lib/chart/funnel/FunnelView.js +19 -0
- package/lib/chart/funnel/funnelLayout.js +18 -0
- package/lib/chart/funnel.js +18 -0
- package/lib/chart/gauge/GaugeSeries.js +18 -0
- package/lib/chart/gauge/GaugeView.js +18 -0
- package/lib/chart/gauge/PointerPath.js +18 -0
- package/lib/chart/graph/GraphSeries.js +25 -1
- package/lib/chart/graph/GraphView.js +18 -0
- package/lib/chart/graph/adjustEdge.js +18 -0
- package/lib/chart/graph/backwardCompat.js +18 -0
- package/lib/chart/graph/categoryFilter.js +18 -0
- package/lib/chart/graph/categoryVisual.js +18 -0
- package/lib/chart/graph/circularLayout.js +18 -0
- package/lib/chart/graph/circularLayoutHelper.js +18 -0
- package/lib/chart/graph/createView.js +18 -0
- package/lib/chart/graph/edgeVisual.js +18 -0
- package/lib/chart/graph/forceHelper.js +18 -0
- package/lib/chart/graph/forceLayout.js +18 -0
- package/lib/chart/graph/graphAction.js +19 -0
- package/lib/chart/graph/simpleLayout.js +18 -0
- package/lib/chart/graph/simpleLayoutHelper.js +18 -0
- package/lib/chart/graph.js +18 -0
- package/lib/chart/heatmap/HeatmapLayer.js +19 -0
- package/lib/chart/heatmap/HeatmapSeries.js +21 -1
- package/lib/chart/heatmap/HeatmapView.js +18 -0
- package/lib/chart/helper/EffectLine.js +19 -0
- package/lib/chart/helper/EffectPolyline.js +19 -0
- package/lib/chart/helper/EffectSymbol.js +19 -0
- package/lib/chart/helper/LargeLineDraw.js +18 -0
- package/lib/chart/helper/LargeSymbolDraw.js +18 -0
- package/lib/chart/helper/Line.js +31 -13
- package/lib/chart/helper/LineDraw.js +26 -1
- package/lib/chart/helper/LinePath.js +19 -0
- package/lib/chart/helper/Polyline.js +19 -0
- package/lib/chart/helper/Symbol.js +63 -12
- package/lib/chart/helper/SymbolDraw.js +65 -18
- package/lib/chart/helper/createGraphFromNodeEdge.js +27 -3
- package/lib/chart/helper/createGraphFromNodeMatrix.js +19 -0
- package/lib/chart/helper/createListFromArray.js +33 -8
- package/lib/chart/helper/createListSimply.js +19 -0
- package/lib/chart/helper/createRenderPlanner.js +22 -3
- package/lib/chart/helper/labelHelper.js +19 -0
- package/lib/chart/helper/treeHelper.js +18 -0
- package/lib/chart/helper/whiskerBoxCommon.js +20 -21
- package/lib/chart/line/LineSeries.js +32 -11
- package/lib/chart/line/LineView.js +165 -102
- package/lib/chart/line/helper.js +117 -0
- package/lib/chart/line/lineAnimationDiff.js +31 -32
- package/lib/chart/line/poly.js +136 -0
- package/lib/chart/line.js +18 -0
- package/lib/chart/lines/LinesSeries.js +25 -6
- package/lib/chart/lines/LinesView.js +20 -1
- package/lib/chart/lines/linesLayout.js +19 -1
- package/lib/chart/lines/linesVisual.js +18 -0
- package/lib/chart/lines.js +18 -0
- package/lib/chart/map/MapSeries.js +45 -8
- package/lib/chart/map/MapView.js +18 -0
- package/lib/chart/map/backwardCompat.js +18 -0
- package/lib/chart/map/mapDataStatistic.js +18 -0
- package/lib/chart/map/mapSymbolLayout.js +18 -0
- package/lib/chart/map/mapVisual.js +18 -0
- package/lib/chart/map.js +18 -0
- package/lib/chart/parallel/ParallelSeries.js +20 -7
- package/lib/chart/parallel/ParallelView.js +86 -55
- package/lib/chart/parallel/parallelVisual.js +38 -15
- package/lib/chart/parallel.js +18 -0
- package/lib/chart/pictorialBar.js +18 -0
- package/lib/chart/pie/PieSeries.js +39 -2
- package/lib/chart/pie/PieView.js +19 -0
- package/lib/chart/pie/labelLayout.js +18 -0
- package/lib/chart/pie/pieLayout.js +19 -1
- package/lib/chart/pie.js +18 -0
- package/lib/chart/radar/RadarSeries.js +21 -2
- package/lib/chart/radar/RadarView.js +18 -0
- package/lib/chart/radar/backwardCompat.js +18 -0
- package/lib/chart/radar/radarLayout.js +19 -1
- package/lib/chart/radar.js +18 -0
- package/lib/chart/sankey/SankeySeries.js +26 -0
- package/lib/chart/sankey/SankeyView.js +62 -10
- package/lib/chart/sankey/sankeyAction.js +34 -0
- package/lib/chart/sankey/sankeyLayout.js +68 -19
- package/lib/chart/sankey/sankeyVisual.js +49 -19
- package/lib/chart/sankey.js +20 -0
- package/lib/chart/scatter/ScatterSeries.js +20 -2
- package/lib/chart/scatter/ScatterView.js +18 -0
- package/lib/chart/scatter.js +18 -0
- package/lib/chart/sunburst/SunburstPiece.js +70 -19
- package/lib/chart/sunburst/SunburstSeries.js +18 -0
- package/lib/chart/sunburst/SunburstView.js +39 -20
- package/lib/chart/sunburst/sunburstAction.js +19 -0
- package/lib/chart/sunburst/sunburstLayout.js +18 -0
- package/lib/chart/sunburst.js +18 -0
- package/lib/chart/themeRiver/ThemeRiverSeries.js +19 -1
- package/lib/chart/themeRiver/ThemeRiverView.js +19 -0
- package/lib/chart/themeRiver/themeRiverLayout.js +19 -0
- package/lib/chart/themeRiver/themeRiverVisual.js +19 -0
- package/lib/chart/themeRiver.js +18 -0
- package/lib/chart/tree/TreeSeries.js +40 -3
- package/lib/chart/tree/TreeView.js +32 -6
- package/lib/chart/tree/layoutHelper.js +19 -0
- package/lib/chart/tree/traversalHelper.js +19 -0
- package/lib/chart/tree/treeAction.js +18 -0
- package/lib/chart/tree/treeLayout.js +137 -0
- package/lib/chart/tree.js +20 -5
- package/lib/chart/treemap/Breadcrumb.js +19 -0
- package/lib/chart/treemap/TreemapSeries.js +18 -0
- package/lib/chart/treemap/TreemapView.js +18 -0
- package/lib/chart/treemap/helper.js +18 -0
- package/lib/chart/treemap/treemapAction.js +19 -0
- package/lib/chart/treemap/treemapLayout.js +18 -0
- package/lib/chart/treemap/treemapVisual.js +18 -0
- package/lib/chart/treemap.js +18 -0
- package/lib/component/axis/AngleAxisView.js +59 -27
- package/lib/component/axis/AxisBuilder.js +59 -73
- package/lib/component/axis/AxisView.js +19 -0
- package/lib/component/axis/CartesianAxisView.js +71 -39
- package/lib/component/axis/ParallelAxisView.js +18 -0
- package/lib/component/axis/RadiusAxisView.js +26 -4
- package/lib/component/axis/SingleAxisView.js +25 -14
- package/lib/component/axis/parallelAxisAction.js +19 -0
- package/lib/component/axisPointer/AxisPointerModel.js +18 -0
- package/lib/component/axisPointer/AxisPointerView.js +18 -0
- package/lib/component/axisPointer/BaseAxisPointer.js +19 -0
- package/lib/component/axisPointer/CartesianAxisPointer.js +20 -2
- package/lib/component/axisPointer/PolarAxisPointer.js +19 -1
- package/lib/component/axisPointer/SingleAxisPointer.js +19 -1
- package/lib/component/axisPointer/axisTrigger.js +20 -1
- package/lib/component/axisPointer/findPointFromSeries.js +19 -0
- package/lib/component/axisPointer/globalListener.js +19 -0
- package/lib/component/axisPointer/modelHelper.js +20 -1
- package/lib/component/axisPointer/viewHelper.js +20 -0
- package/lib/component/axisPointer.js +18 -0
- package/lib/component/brush/BrushModel.js +25 -1
- package/lib/component/brush/BrushView.js +23 -0
- package/lib/component/brush/brushAction.js +19 -0
- package/lib/component/brush/preprocessor.js +18 -0
- package/lib/component/brush/selector.js +18 -0
- package/lib/component/brush/visualEncoding.js +18 -0
- package/lib/component/brush.js +19 -0
- package/lib/component/calendar/CalendarView.js +18 -0
- package/lib/component/dataZoom/AxisProxy.js +42 -23
- package/lib/component/dataZoom/DataZoomModel.js +18 -0
- package/lib/component/dataZoom/DataZoomView.js +18 -0
- package/lib/component/dataZoom/InsideZoomModel.js +18 -0
- package/lib/component/dataZoom/InsideZoomView.js +36 -13
- package/lib/component/dataZoom/SelectZoomModel.js +18 -0
- package/lib/component/dataZoom/SelectZoomView.js +18 -0
- package/lib/component/dataZoom/SliderZoomModel.js +18 -0
- package/lib/component/dataZoom/SliderZoomView.js +29 -6
- package/lib/component/dataZoom/dataZoomAction.js +18 -0
- package/lib/component/dataZoom/dataZoomProcessor.js +23 -1
- package/lib/component/dataZoom/helper.js +18 -0
- package/lib/component/dataZoom/history.js +18 -0
- package/lib/component/dataZoom/roams.js +19 -18
- package/lib/component/dataZoom/typeDefaulter.js +18 -0
- package/lib/component/dataset.js +56 -3
- package/lib/component/geo/GeoView.js +18 -0
- package/lib/component/geo.js +18 -0
- package/lib/component/graphic.js +18 -0
- package/lib/component/gridSimple.js +18 -0
- package/lib/component/helper/BrushController.js +18 -0
- package/lib/component/helper/BrushTargetManager.js +18 -0
- package/lib/component/helper/MapDraw.js +18 -0
- package/lib/component/helper/RoamController.js +19 -0
- package/lib/component/helper/brushHelper.js +18 -0
- package/lib/component/helper/cursorHelper.js +18 -0
- package/lib/component/helper/interactionMutex.js +18 -0
- package/lib/component/helper/listComponent.js +19 -0
- package/lib/component/helper/roamHelper.js +19 -0
- package/lib/component/helper/selectableMixin.js +21 -16
- package/lib/component/helper/sliderMove.js +19 -0
- package/lib/component/legend/LegendModel.js +25 -6
- package/lib/component/legend/LegendView.js +41 -12
- package/lib/component/legend/ScrollableLegendModel.js +19 -0
- package/lib/component/legend/ScrollableLegendView.js +19 -0
- package/lib/component/legend/legendAction.js +18 -0
- package/lib/component/legend/legendFilter.js +18 -0
- package/lib/component/legend/scrollableLegendAction.js +19 -0
- package/lib/component/legend.js +18 -0
- package/lib/component/markArea.js +18 -0
- package/lib/component/markLine.js +18 -0
- package/lib/component/markPoint.js +18 -0
- package/lib/component/marker/MarkAreaModel.js +18 -0
- package/lib/component/marker/MarkAreaView.js +20 -2
- package/lib/component/marker/MarkLineModel.js +18 -0
- package/lib/component/marker/MarkLineView.js +20 -2
- package/lib/component/marker/MarkPointModel.js +18 -0
- package/lib/component/marker/MarkPointView.js +20 -4
- package/lib/component/marker/MarkerModel.js +19 -1
- package/lib/component/marker/MarkerView.js +18 -0
- package/lib/component/marker/markerHelper.js +58 -17
- package/lib/component/parallel.js +18 -0
- package/lib/component/polar.js +18 -0
- package/lib/component/radar/RadarView.js +22 -4
- package/lib/component/singleAxis.js +18 -0
- package/lib/component/timeline/SliderTimelineModel.js +18 -0
- package/lib/component/timeline/SliderTimelineView.js +42 -33
- package/lib/component/timeline/TimelineAxis.js +24 -35
- package/lib/component/timeline/TimelineModel.js +18 -0
- package/lib/component/timeline/TimelineView.js +18 -0
- package/lib/component/timeline/preprocessor.js +18 -0
- package/lib/component/timeline/timelineAction.js +18 -0
- package/lib/component/timeline/typeDefaulter.js +18 -0
- package/lib/component/timeline.js +19 -0
- package/lib/component/title.js +19 -0
- package/lib/component/toolbox/ToolboxModel.js +20 -2
- package/lib/component/toolbox/ToolboxView.js +18 -0
- package/lib/component/toolbox/feature/Brush.js +18 -0
- package/lib/component/toolbox/feature/DataView.js +18 -0
- package/lib/component/toolbox/feature/DataZoom.js +22 -1
- package/lib/component/toolbox/feature/MagicType.js +18 -0
- package/lib/component/toolbox/feature/Restore.js +18 -0
- package/lib/component/toolbox/feature/SaveAsImage.js +18 -0
- package/lib/component/toolbox/featureManager.js +18 -0
- package/lib/component/tooltip/TooltipContent.js +18 -0
- package/lib/component/tooltip/TooltipModel.js +18 -0
- package/lib/component/tooltip/TooltipView.js +19 -1
- package/lib/component/tooltip.js +18 -0
- package/lib/component/visualMap/ContinuousModel.js +19 -1
- package/lib/component/visualMap/ContinuousView.js +18 -0
- package/lib/component/visualMap/PiecewiseModel.js +20 -1
- package/lib/component/visualMap/PiecewiseView.js +18 -0
- package/lib/component/visualMap/VisualMapModel.js +32 -1
- package/lib/component/visualMap/VisualMapView.js +18 -0
- package/lib/component/visualMap/helper.js +19 -0
- package/lib/component/visualMap/preprocessor.js +18 -0
- package/lib/component/visualMap/typeDefaulter.js +18 -0
- package/lib/component/visualMap/visualEncoding.js +21 -1
- package/lib/component/visualMap/visualMapAction.js +18 -0
- package/lib/component/visualMapContinuous.js +19 -0
- package/lib/component/visualMapPiecewise.js +19 -0
- package/lib/config.js +18 -0
- package/lib/coord/Axis.js +166 -87
- package/lib/coord/View.js +19 -0
- package/lib/coord/axisDefault.js +52 -42
- package/lib/coord/axisHelper.js +136 -89
- package/lib/coord/axisModelCommonMixin.js +18 -8
- package/lib/coord/axisModelCreator.js +26 -3
- package/lib/coord/axisTickLabelBuilder.js +350 -0
- package/lib/coord/calendar/Calendar.js +20 -2
- package/lib/coord/calendar/CalendarModel.js +19 -0
- package/lib/coord/calendar/prepareCustom.js +18 -0
- package/lib/coord/cartesian/Axis2D.js +24 -16
- package/lib/coord/cartesian/AxisModel.js +18 -0
- package/lib/coord/cartesian/Cartesian.js +19 -0
- package/lib/coord/cartesian/Cartesian2D.js +26 -4
- package/lib/coord/cartesian/Grid.js +71 -79
- package/lib/coord/cartesian/GridModel.js +18 -0
- package/lib/{component/axis → coord/cartesian}/cartesianAxisHelper.js +29 -9
- package/lib/coord/cartesian/prepareCustom.js +18 -0
- package/lib/coord/geo/Geo.js +18 -0
- package/lib/coord/geo/GeoModel.js +18 -0
- package/lib/coord/geo/Region.js +19 -0
- package/lib/coord/geo/fix/diaoyuIsland.js +18 -0
- package/lib/coord/geo/fix/geoCoord.js +18 -0
- package/lib/coord/geo/fix/nanhai.js +18 -0
- package/lib/coord/geo/fix/textCoord.js +18 -0
- package/lib/coord/geo/geoCreator.js +19 -0
- package/lib/coord/geo/parseGeoJson.js +19 -0
- package/lib/coord/geo/prepareCustom.js +23 -3
- package/lib/coord/parallel/AxisModel.js +31 -4
- package/lib/coord/parallel/Parallel.js +35 -12
- package/lib/coord/parallel/ParallelAxis.js +19 -0
- package/lib/coord/parallel/ParallelModel.js +18 -0
- package/lib/coord/parallel/parallelCreator.js +19 -0
- package/lib/coord/parallel/parallelPreprocessor.js +18 -0
- package/lib/coord/polar/AngleAxis.js +18 -0
- package/lib/coord/polar/AxisModel.js +18 -0
- package/lib/coord/polar/Polar.js +19 -0
- package/lib/coord/polar/PolarModel.js +18 -0
- package/lib/coord/polar/RadiusAxis.js +18 -0
- package/lib/coord/polar/polarCreator.js +24 -3
- package/lib/coord/polar/prepareCustom.js +18 -0
- package/lib/coord/radar/IndicatorAxis.js +18 -0
- package/lib/coord/radar/Radar.js +18 -0
- package/lib/coord/radar/RadarModel.js +18 -0
- package/lib/coord/single/AxisModel.js +18 -0
- package/lib/coord/single/Single.js +19 -0
- package/lib/coord/single/SingleAxis.js +19 -5
- package/lib/coord/single/prepareCustom.js +18 -0
- package/lib/{component/axis → coord/single}/singleAxisHelper.js +20 -2
- package/lib/coord/single/singleCreator.js +19 -0
- package/lib/data/DataDiffer.js +18 -0
- package/lib/data/Graph.js +19 -0
- package/lib/data/List.js +413 -201
- package/lib/data/OrdinalMeta.js +19 -0
- package/lib/data/Source.js +19 -0
- package/lib/data/Tree.js +19 -0
- package/lib/data/helper/completeDimensions.js +63 -22
- package/lib/data/helper/createDimensions.js +23 -4
- package/lib/data/helper/dataProvider.js +63 -6
- package/lib/data/helper/dataStackHelper.js +162 -0
- package/lib/data/helper/dimensionHelper.js +46 -10
- package/lib/data/helper/linkList.js +19 -0
- package/lib/data/helper/sourceHelper.js +19 -0
- package/lib/data/helper/sourceType.js +18 -0
- package/lib/echarts.js +128 -118
- package/lib/export.js +19 -0
- package/lib/helper.js +41 -0
- package/lib/lang.js +18 -0
- package/lib/langEN.js +18 -0
- package/lib/langFI.js +18 -0
- package/lib/langTH.js +18 -0
- package/lib/layout/barGrid.js +178 -53
- package/lib/layout/barPolar.js +88 -71
- package/lib/layout/points.js +39 -4
- package/lib/loading/default.js +18 -0
- package/lib/model/Component.js +19 -0
- package/lib/model/Global.js +30 -2
- package/lib/model/Model.js +19 -0
- package/lib/model/OptionManager.js +19 -0
- package/lib/model/Series.js +23 -5
- package/lib/model/globalDefault.js +21 -5
- package/lib/model/mixin/areaStyle.js +18 -0
- package/lib/model/mixin/boxLayout.js +18 -0
- package/lib/model/mixin/colorPalette.js +27 -0
- package/lib/model/mixin/dataFormat.js +20 -1
- package/lib/model/mixin/itemStyle.js +18 -0
- package/lib/model/mixin/lineStyle.js +18 -0
- package/lib/model/mixin/makeStyleMapper.js +18 -0
- package/lib/model/mixin/textStyle.js +18 -0
- package/lib/model/referHelper.js +19 -0
- package/lib/preprocessor/backwardCompat.js +18 -0
- package/lib/preprocessor/helper/compatStyle.js +42 -15
- package/lib/processor/dataFilter.js +19 -1
- package/lib/processor/dataSample.js +27 -5
- package/lib/processor/dataStack.js +118 -0
- package/lib/scale/Interval.js +19 -14
- package/lib/scale/Log.js +22 -3
- package/lib/scale/Ordinal.js +27 -2
- package/lib/scale/Scale.js +27 -16
- package/lib/scale/Time.js +18 -0
- package/lib/scale/helper.js +19 -0
- package/lib/stream/Scheduler.js +123 -37
- package/lib/stream/task.js +165 -14
- package/lib/theme/dark.js +18 -0
- package/lib/theme/light.js +18 -0
- package/lib/util/KDTree.js +19 -0
- package/lib/util/animation.js +19 -0
- package/lib/util/array/nest.js +19 -0
- package/lib/util/clazz.js +18 -0
- package/lib/util/component.js +19 -0
- package/lib/util/format.js +36 -11
- package/lib/util/graphic.js +19 -0
- package/lib/util/layout.js +18 -0
- package/lib/util/model.js +33 -6
- package/lib/util/number.js +18 -0
- package/lib/util/quickSelect.js +19 -0
- package/lib/util/symbol.js +18 -0
- package/lib/util/throttle.js +26 -1
- package/lib/view/Chart.js +44 -7
- package/lib/view/Component.js +18 -0
- package/lib/visual/VisualMapping.js +28 -0
- package/lib/visual/aria.js +18 -0
- package/lib/visual/dataColor.js +19 -1
- package/lib/visual/seriesColor.js +19 -1
- package/lib/visual/symbol.js +28 -2
- package/lib/visual/visualDefault.js +19 -0
- package/lib/visual/visualSolution.js +24 -3
- package/licenses/LICENSE-d3 +27 -0
- package/licenses/LICENSE-zrender +29 -0
- package/map/js/china-contour.js +19 -0
- package/map/js/china.js +19 -0
- package/map/js/province/anhui.js +19 -0
- package/map/js/province/aomen.js +19 -0
- package/map/js/province/beijing.js +19 -0
- package/map/js/province/chongqing.js +19 -0
- package/map/js/province/fujian.js +19 -0
- package/map/js/province/gansu.js +19 -0
- package/map/js/province/guangdong.js +19 -0
- package/map/js/province/guangxi.js +19 -0
- package/map/js/province/guizhou.js +19 -0
- package/map/js/province/hainan.js +19 -0
- package/map/js/province/hebei.js +19 -0
- package/map/js/province/heilongjiang.js +19 -0
- package/map/js/province/henan.js +19 -0
- package/map/js/province/hubei.js +19 -0
- package/map/js/province/hunan.js +19 -0
- package/map/js/province/jiangsu.js +19 -0
- package/map/js/province/jiangxi.js +19 -0
- package/map/js/province/jilin.js +19 -0
- package/map/js/province/liaoning.js +19 -0
- package/map/js/province/neimenggu.js +19 -0
- package/map/js/province/ningxia.js +19 -0
- package/map/js/province/qinghai.js +19 -0
- package/map/js/province/shandong.js +19 -0
- package/map/js/province/shanghai.js +19 -0
- package/map/js/province/shanxi.js +19 -0
- package/map/js/province/shanxi1.js +19 -0
- package/map/js/province/sichuan.js +19 -0
- package/map/js/province/taiwan.js +19 -0
- package/map/js/province/tianjin.js +19 -0
- package/map/js/province/xianggang.js +19 -0
- package/map/js/province/xinjiang.js +19 -0
- package/map/js/province/xizang.js +19 -0
- package/map/js/province/yunnan.js +19 -0
- package/map/js/province/zhejiang.js +19 -0
- package/map/js/world.js +19 -0
- package/package.json +3 -3
- package/src/CoordinateSystem.js +19 -0
- package/src/ExtensionAPI.js +19 -0
- package/src/action/createDataSelectAction.js +19 -0
- package/src/action/geoRoam.js +19 -0
- package/src/action/roamHelper.js +19 -0
- package/src/chart/bar/BarSeries.js +44 -1
- package/src/chart/bar/BarView.js +128 -17
- package/src/chart/bar/BaseBarSeries.js +24 -0
- package/src/chart/bar/PictorialBarSeries.js +19 -0
- package/src/chart/bar/PictorialBarView.js +19 -0
- package/src/chart/bar/barItemStyle.js +19 -0
- package/src/chart/bar/helper.js +20 -1
- package/src/chart/bar.js +28 -7
- package/src/chart/boxplot/BoxplotSeries.js +26 -1
- package/src/chart/boxplot/BoxplotView.js +152 -21
- package/src/chart/boxplot/boxplotLayout.js +75 -71
- package/src/chart/boxplot/boxplotVisual.js +19 -0
- package/src/chart/boxplot.js +19 -0
- package/src/chart/candlestick/CandlestickSeries.js +35 -4
- package/src/chart/candlestick/CandlestickView.js +272 -24
- package/src/chart/candlestick/candlestickLayout.js +151 -97
- package/src/chart/candlestick/candlestickVisual.js +66 -17
- package/src/chart/candlestick/preprocessor.js +19 -0
- package/src/chart/candlestick.js +19 -0
- package/src/chart/chord/ChordSeries.js +19 -0
- package/src/chart/chord/ChordView.js +19 -0
- package/src/chart/chord/Ribbon.js +19 -0
- package/src/chart/chord/chordCircularLayout.js +19 -0
- package/src/chart/chord.js +19 -0
- package/src/chart/custom.js +23 -6
- package/src/chart/effectScatter/EffectScatterSeries.js +19 -0
- package/src/chart/effectScatter/EffectScatterView.js +19 -0
- package/src/chart/effectScatter.js +19 -0
- package/src/chart/funnel/FunnelSeries.js +19 -0
- package/src/chart/funnel/FunnelView.js +19 -0
- package/src/chart/funnel/funnelLayout.js +19 -0
- package/src/chart/funnel.js +19 -0
- package/src/chart/gauge/GaugeSeries.js +19 -0
- package/src/chart/gauge/GaugeView.js +19 -0
- package/src/chart/gauge/PointerPath.js +19 -0
- package/src/chart/gauge.js +19 -0
- package/src/chart/graph/GraphSeries.js +27 -0
- package/src/chart/graph/GraphView.js +19 -0
- package/src/chart/graph/adjustEdge.js +19 -0
- package/src/chart/graph/backwardCompat.js +19 -0
- package/src/chart/graph/categoryFilter.js +19 -0
- package/src/chart/graph/categoryVisual.js +19 -0
- package/src/chart/graph/circularLayout.js +19 -0
- package/src/chart/graph/circularLayoutHelper.js +19 -0
- package/src/chart/graph/createView.js +19 -0
- package/src/chart/graph/edgeVisual.js +19 -0
- package/src/chart/graph/forceHelper.js +19 -0
- package/src/chart/graph/forceLayout.js +19 -0
- package/src/chart/graph/graphAction.js +19 -0
- package/src/chart/graph/simpleLayout.js +19 -0
- package/src/chart/graph/simpleLayoutHelper.js +19 -0
- package/src/chart/graph.js +19 -0
- package/src/chart/heatmap/HeatmapLayer.js +19 -0
- package/src/chart/heatmap/HeatmapSeries.js +22 -1
- package/src/chart/heatmap/HeatmapView.js +19 -0
- package/src/chart/heatmap.js +19 -0
- package/src/chart/helper/EffectLine.js +19 -0
- package/src/chart/helper/EffectPolyline.js +19 -0
- package/src/chart/helper/EffectSymbol.js +19 -0
- package/src/chart/helper/LargeLineDraw.js +20 -0
- package/src/chart/helper/LargeSymbolDraw.js +19 -0
- package/src/chart/helper/Line.js +38 -16
- package/src/chart/helper/LineDraw.js +27 -0
- package/src/chart/helper/LinePath.js +19 -0
- package/src/chart/helper/Polyline.js +19 -0
- package/src/chart/helper/Symbol.js +68 -15
- package/src/chart/helper/SymbolDraw.js +61 -18
- package/src/chart/helper/createGraphFromNodeEdge.js +29 -6
- package/src/chart/helper/createGraphFromNodeMatrix.js +19 -0
- package/src/chart/helper/createListFromArray.js +32 -7
- package/src/chart/helper/createListSimply.js +19 -0
- package/src/chart/helper/createRenderPlanner.js +22 -3
- package/src/chart/helper/labelHelper.js +19 -0
- package/src/chart/helper/treeHelper.js +19 -0
- package/src/chart/helper/whiskerBoxCommon.js +19 -24
- package/src/chart/line/LineSeries.js +35 -11
- package/src/chart/line/LineView.js +174 -105
- package/src/chart/line/helper.js +106 -0
- package/src/chart/line/lineAnimationDiff.js +32 -39
- package/src/chart/line/poly.js +149 -0
- package/src/chart/line.js +19 -0
- package/src/chart/lines/LinesSeries.js +27 -7
- package/src/chart/lines/LinesView.js +21 -1
- package/src/chart/lines/linesLayout.js +20 -1
- package/src/chart/lines/linesVisual.js +19 -0
- package/src/chart/lines.js +19 -0
- package/src/chart/map/MapSeries.js +42 -5
- package/src/chart/map/MapView.js +19 -0
- package/src/chart/map/backwardCompat.js +19 -0
- package/src/chart/map/mapDataStatistic.js +19 -0
- package/src/chart/map/mapSymbolLayout.js +19 -0
- package/src/chart/map/mapVisual.js +19 -0
- package/src/chart/map.js +19 -0
- package/src/chart/parallel/ParallelSeries.js +21 -7
- package/src/chart/parallel/ParallelView.js +90 -58
- package/src/chart/parallel/parallelVisual.js +39 -14
- package/src/chart/parallel.js +19 -0
- package/src/chart/pictorialBar.js +19 -0
- package/src/chart/pie/PieSeries.js +37 -2
- package/src/chart/pie/PieView.js +19 -0
- package/src/chart/pie/labelLayout.js +19 -0
- package/src/chart/pie/pieLayout.js +20 -1
- package/src/chart/pie.js +19 -0
- package/src/chart/radar/RadarSeries.js +21 -2
- package/src/chart/radar/RadarView.js +19 -0
- package/src/chart/radar/backwardCompat.js +19 -0
- package/src/chart/radar/radarLayout.js +20 -1
- package/src/chart/radar.js +19 -0
- package/src/chart/sankey/SankeySeries.js +28 -0
- package/src/chart/sankey/SankeyView.js +62 -11
- package/src/chart/sankey/sankeyAction.js +31 -0
- package/src/chart/sankey/sankeyLayout.js +71 -17
- package/src/chart/sankey/sankeyVisual.js +49 -25
- package/src/chart/sankey.js +20 -0
- package/src/chart/scatter/ScatterSeries.js +21 -2
- package/src/chart/scatter/ScatterView.js +19 -0
- package/src/chart/scatter.js +19 -0
- package/src/chart/sunburst/SunburstPiece.js +72 -20
- package/src/chart/sunburst/SunburstSeries.js +19 -0
- package/src/chart/sunburst/SunburstView.js +39 -17
- package/src/chart/sunburst/sunburstAction.js +19 -0
- package/src/chart/sunburst/sunburstLayout.js +19 -0
- package/src/chart/sunburst.js +19 -0
- package/src/chart/themeRiver/ThemeRiverSeries.js +19 -1
- package/src/chart/themeRiver/ThemeRiverView.js +19 -0
- package/src/chart/themeRiver/themeRiverLayout.js +19 -0
- package/src/chart/themeRiver/themeRiverVisual.js +19 -0
- package/src/chart/themeRiver.js +19 -0
- package/src/chart/tree/TreeSeries.js +38 -2
- package/src/chart/tree/TreeView.js +31 -5
- package/src/chart/tree/layoutHelper.js +19 -0
- package/src/chart/tree/traversalHelper.js +19 -0
- package/src/chart/tree/treeAction.js +19 -0
- package/src/chart/tree/treeLayout.js +128 -0
- package/src/chart/tree.js +21 -4
- package/src/chart/treemap/Breadcrumb.js +19 -0
- package/src/chart/treemap/TreemapSeries.js +19 -0
- package/src/chart/treemap/TreemapView.js +19 -0
- package/src/chart/treemap/helper.js +19 -0
- package/src/chart/treemap/treemapAction.js +19 -0
- package/src/chart/treemap/treemapLayout.js +19 -0
- package/src/chart/treemap/treemapVisual.js +19 -0
- package/src/chart/treemap.js +19 -0
- package/src/component/angleAxis.js +19 -0
- package/src/component/axis/AngleAxisView.js +62 -25
- package/src/component/axis/AxisBuilder.js +68 -94
- package/src/component/axis/AxisView.js +19 -0
- package/src/component/axis/CartesianAxisView.js +69 -54
- package/src/component/axis/ParallelAxisView.js +19 -0
- package/src/component/axis/RadiusAxisView.js +26 -4
- package/src/component/axis/SingleAxisView.js +26 -18
- package/src/component/axis/parallelAxisAction.js +19 -0
- package/src/component/axis.js +19 -0
- package/src/component/axisPointer/AxisPointerModel.js +19 -0
- package/src/component/axisPointer/AxisPointerView.js +19 -0
- package/src/component/axisPointer/BaseAxisPointer.js +19 -0
- package/src/component/axisPointer/CartesianAxisPointer.js +21 -2
- package/src/component/axisPointer/PolarAxisPointer.js +20 -1
- package/src/component/axisPointer/SingleAxisPointer.js +20 -1
- package/src/component/axisPointer/axisTrigger.js +21 -1
- package/src/component/axisPointer/findPointFromSeries.js +19 -0
- package/src/component/axisPointer/globalListener.js +19 -0
- package/src/component/axisPointer/modelHelper.js +21 -1
- package/src/component/axisPointer/viewHelper.js +20 -0
- package/src/component/axisPointer.js +19 -0
- package/src/component/brush/BrushModel.js +26 -1
- package/src/component/brush/BrushView.js +24 -0
- package/src/component/brush/brushAction.js +19 -0
- package/src/component/brush/preprocessor.js +19 -0
- package/src/component/brush/selector.js +19 -0
- package/src/component/brush/visualEncoding.js +19 -0
- package/src/component/brush.js +19 -0
- package/src/component/calendar/CalendarView.js +19 -0
- package/src/component/calendar.js +19 -0
- package/src/component/dataZoom/AxisProxy.js +42 -20
- package/src/component/dataZoom/DataZoomModel.js +19 -0
- package/src/component/dataZoom/DataZoomView.js +19 -0
- package/src/component/dataZoom/InsideZoomModel.js +19 -0
- package/src/component/dataZoom/InsideZoomView.js +37 -10
- package/src/component/dataZoom/SelectZoomModel.js +19 -0
- package/src/component/dataZoom/SelectZoomView.js +19 -0
- package/src/component/dataZoom/SliderZoomModel.js +19 -0
- package/src/component/dataZoom/SliderZoomView.js +30 -5
- package/src/component/dataZoom/dataZoomAction.js +19 -0
- package/src/component/dataZoom/dataZoomProcessor.js +24 -1
- package/src/component/dataZoom/helper.js +19 -0
- package/src/component/dataZoom/history.js +19 -0
- package/src/component/dataZoom/roams.js +20 -15
- package/src/component/dataZoom/typeDefaulter.js +19 -0
- package/src/component/dataZoom.js +19 -0
- package/src/component/dataZoomInside.js +19 -0
- package/src/component/dataZoomSelect.js +19 -0
- package/src/component/dataset.js +63 -3
- package/src/component/geo/GeoView.js +19 -0
- package/src/component/geo.js +19 -0
- package/src/component/graphic.js +19 -0
- package/src/component/grid.js +19 -0
- package/src/component/gridSimple.js +19 -0
- package/src/component/helper/BrushController.js +19 -0
- package/src/component/helper/BrushTargetManager.js +19 -0
- package/src/component/helper/MapDraw.js +19 -0
- package/src/component/helper/RoamController.js +19 -0
- package/src/component/helper/brushHelper.js +19 -0
- package/src/component/helper/cursorHelper.js +19 -0
- package/src/component/helper/interactionMutex.js +19 -0
- package/src/component/helper/listComponent.js +19 -0
- package/src/component/helper/roamHelper.js +19 -0
- package/src/component/helper/selectableMixin.js +22 -12
- package/src/component/helper/sliderMove.js +19 -0
- package/src/component/legend/LegendModel.js +25 -6
- package/src/component/legend/LegendView.js +51 -13
- package/src/component/legend/ScrollableLegendModel.js +19 -0
- package/src/component/legend/ScrollableLegendView.js +19 -0
- package/src/component/legend/legendAction.js +19 -0
- package/src/component/legend/legendFilter.js +19 -0
- package/src/component/legend/scrollableLegendAction.js +19 -0
- package/src/component/legend.js +19 -0
- package/src/component/legendScroll.js +19 -0
- package/src/component/markArea.js +19 -0
- package/src/component/markLine.js +19 -0
- package/src/component/markPoint.js +19 -0
- package/src/component/marker/MarkAreaModel.js +19 -0
- package/src/component/marker/MarkAreaView.js +22 -3
- package/src/component/marker/MarkLineModel.js +19 -0
- package/src/component/marker/MarkLineView.js +22 -3
- package/src/component/marker/MarkPointModel.js +19 -0
- package/src/component/marker/MarkPointView.js +21 -3
- package/src/component/marker/MarkerModel.js +20 -1
- package/src/component/marker/MarkerView.js +19 -0
- package/src/component/marker/markerHelper.js +60 -20
- package/src/component/parallel.js +19 -0
- package/src/component/parallelAxis.js +19 -0
- package/src/component/polar.js +19 -0
- package/src/component/radar/RadarView.js +23 -4
- package/src/component/radar.js +19 -0
- package/src/component/radiusAxis.js +19 -0
- package/src/component/singleAxis.js +19 -0
- package/src/component/timeline/SliderTimelineModel.js +19 -0
- package/src/component/timeline/SliderTimelineView.js +41 -33
- package/src/component/timeline/TimelineAxis.js +25 -43
- package/src/component/timeline/TimelineModel.js +19 -0
- package/src/component/timeline/TimelineView.js +19 -0
- package/src/component/timeline/preprocessor.js +19 -0
- package/src/component/timeline/timelineAction.js +19 -0
- package/src/component/timeline/typeDefaulter.js +19 -0
- package/src/component/timeline.js +19 -0
- package/src/component/title.js +19 -0
- package/src/component/toolbox/ToolboxModel.js +21 -2
- package/src/component/toolbox/ToolboxView.js +19 -0
- package/src/component/toolbox/feature/Brush.js +19 -0
- package/src/component/toolbox/feature/DataView.js +19 -0
- package/src/component/toolbox/feature/DataZoom.js +22 -0
- package/src/component/toolbox/feature/MagicType.js +19 -0
- package/src/component/toolbox/feature/Restore.js +19 -0
- package/src/component/toolbox/feature/SaveAsImage.js +19 -0
- package/src/component/toolbox/featureManager.js +19 -0
- package/src/component/toolbox.js +19 -0
- package/src/component/tooltip/TooltipContent.js +19 -0
- package/src/component/tooltip/TooltipModel.js +19 -0
- package/src/component/tooltip/TooltipView.js +20 -1
- package/src/component/tooltip.js +19 -0
- package/src/component/visualMap/ContinuousModel.js +20 -1
- package/src/component/visualMap/ContinuousView.js +19 -0
- package/src/component/visualMap/PiecewiseModel.js +20 -1
- package/src/component/visualMap/PiecewiseView.js +19 -0
- package/src/component/visualMap/VisualMapModel.js +31 -3
- package/src/component/visualMap/VisualMapView.js +19 -0
- package/src/component/visualMap/helper.js +19 -0
- package/src/component/visualMap/preprocessor.js +19 -0
- package/src/component/visualMap/typeDefaulter.js +19 -0
- package/src/component/visualMap/visualEncoding.js +23 -1
- package/src/component/visualMap/visualMapAction.js +19 -0
- package/src/component/visualMap.js +19 -0
- package/src/component/visualMapContinuous.js +19 -0
- package/src/component/visualMapPiecewise.js +19 -0
- package/src/config.js +19 -0
- package/src/coord/Axis.js +159 -100
- package/src/coord/View.js +19 -0
- package/src/coord/axisDefault.js +68 -41
- package/src/coord/axisHelper.js +142 -93
- package/src/coord/axisModelCommonMixin.js +19 -11
- package/src/coord/axisModelCreator.js +25 -2
- package/src/coord/axisTickLabelBuilder.js +369 -0
- package/src/coord/calendar/Calendar.js +24 -2
- package/src/coord/calendar/CalendarModel.js +19 -0
- package/src/coord/calendar/prepareCustom.js +20 -1
- package/src/coord/cartesian/Axis2D.js +25 -18
- package/src/coord/cartesian/AxisModel.js +19 -0
- package/src/coord/cartesian/Cartesian.js +19 -0
- package/src/coord/cartesian/Cartesian2D.js +27 -4
- package/src/coord/cartesian/Grid.js +65 -76
- package/src/coord/cartesian/GridModel.js +19 -0
- package/src/{component/axis → coord/cartesian}/cartesianAxisHelper.js +28 -9
- package/src/coord/cartesian/prepareCustom.js +19 -0
- package/src/coord/geo/Geo.js +19 -0
- package/src/coord/geo/GeoModel.js +19 -0
- package/src/coord/geo/Region.js +19 -0
- package/src/coord/geo/fix/diaoyuIsland.js +19 -0
- package/src/coord/geo/fix/geoCoord.js +19 -0
- package/src/coord/geo/fix/nanhai.js +19 -0
- package/src/coord/geo/fix/textCoord.js +19 -0
- package/src/coord/geo/geoCreator.js +19 -0
- package/src/coord/geo/parseGeoJson.js +19 -0
- package/src/coord/geo/prepareCustom.js +24 -3
- package/src/coord/parallel/AxisModel.js +32 -3
- package/src/coord/parallel/Parallel.js +38 -12
- package/src/coord/parallel/ParallelAxis.js +19 -0
- package/src/coord/parallel/ParallelModel.js +19 -0
- package/src/coord/parallel/parallelCreator.js +19 -0
- package/src/coord/parallel/parallelPreprocessor.js +19 -0
- package/src/coord/polar/AngleAxis.js +19 -0
- package/src/coord/polar/AxisModel.js +19 -0
- package/src/coord/polar/Polar.js +19 -0
- package/src/coord/polar/PolarModel.js +19 -0
- package/src/coord/polar/RadiusAxis.js +19 -0
- package/src/coord/polar/polarCreator.js +26 -3
- package/src/coord/polar/prepareCustom.js +19 -0
- package/src/coord/radar/IndicatorAxis.js +19 -0
- package/src/coord/radar/Radar.js +19 -0
- package/src/coord/radar/RadarModel.js +19 -0
- package/src/coord/single/AxisModel.js +19 -0
- package/src/coord/single/Single.js +19 -0
- package/src/coord/single/SingleAxis.js +19 -5
- package/src/coord/single/prepareCustom.js +19 -0
- package/src/{component/axis → coord/single}/singleAxisHelper.js +21 -4
- package/src/coord/single/singleCreator.js +19 -0
- package/src/data/DataDiffer.js +19 -0
- package/src/data/Graph.js +20 -1
- package/src/data/List.js +412 -207
- package/src/data/OrdinalMeta.js +19 -0
- package/src/data/Source.js +19 -0
- package/src/data/Tree.js +19 -0
- package/src/data/helper/completeDimensions.js +62 -29
- package/src/data/helper/createDimensions.js +23 -4
- package/src/data/helper/dataProvider.js +61 -6
- package/src/data/helper/dataStackHelper.js +162 -0
- package/src/data/helper/dimensionHelper.js +49 -10
- package/src/data/helper/linkList.js +19 -0
- package/src/data/helper/sourceHelper.js +19 -0
- package/src/data/helper/sourceType.js +19 -0
- package/src/echarts.js +127 -114
- package/src/export.js +19 -0
- package/src/helper.js +30 -1
- package/src/lang.js +19 -0
- package/src/langEN.js +19 -0
- package/src/langFI.js +19 -0
- package/src/langTH.js +19 -0
- package/src/layout/barGrid.js +174 -64
- package/src/layout/barPolar.js +81 -66
- package/src/layout/points.js +32 -4
- package/src/loading/default.js +19 -0
- package/src/model/Component.js +19 -0
- package/src/model/Global.js +29 -2
- package/src/model/Model.js +19 -0
- package/src/model/OptionManager.js +19 -0
- package/src/model/Series.js +23 -5
- package/src/model/globalDefault.js +23 -5
- package/src/model/mixin/areaStyle.js +19 -0
- package/src/model/mixin/boxLayout.js +19 -0
- package/src/model/mixin/colorPalette.js +26 -0
- package/src/model/mixin/dataFormat.js +20 -1
- package/src/model/mixin/itemStyle.js +19 -0
- package/src/model/mixin/lineStyle.js +19 -0
- package/src/model/mixin/makeStyleMapper.js +19 -0
- package/src/model/mixin/textStyle.js +19 -0
- package/src/model/referHelper.js +19 -0
- package/src/preprocessor/backwardCompat.js +19 -0
- package/src/preprocessor/helper/compatStyle.js +45 -15
- package/src/processor/dataFilter.js +20 -1
- package/src/processor/dataSample.js +29 -3
- package/src/processor/dataStack.js +129 -0
- package/src/scale/Interval.js +19 -12
- package/src/scale/Log.js +22 -3
- package/src/scale/Ordinal.js +28 -2
- package/src/scale/Scale.js +27 -13
- package/src/scale/Time.js +19 -0
- package/src/scale/helper.js +19 -0
- package/src/stream/Scheduler.js +124 -32
- package/src/stream/task.js +166 -16
- package/src/theme/dark.js +19 -0
- package/src/theme/light.js +19 -0
- package/src/util/KDTree.js +19 -0
- package/src/util/animation.js +19 -0
- package/src/util/array/nest.js +19 -0
- package/src/util/clazz.js +19 -0
- package/src/util/component.js +19 -0
- package/src/util/format.js +47 -20
- package/src/util/graphic.js +19 -0
- package/src/util/layout.js +19 -0
- package/src/util/model.js +33 -5
- package/src/util/number.js +19 -0
- package/src/util/quickSelect.js +19 -0
- package/src/util/symbol.js +19 -0
- package/src/util/throttle.js +27 -0
- package/src/view/Chart.js +48 -10
- package/src/view/Component.js +19 -0
- package/src/visual/VisualMapping.js +29 -0
- package/src/visual/aria.js +19 -0
- package/src/visual/dataColor.js +21 -1
- package/src/visual/seriesColor.js +20 -1
- package/src/visual/symbol.js +34 -2
- package/src/visual/visualDefault.js +19 -0
- package/src/visual/visualSolution.js +23 -3
- package/theme/dark.js +19 -0
- package/theme/infographic.js +19 -0
- package/theme/macarons.js +19 -0
- package/theme/roma.js +19 -0
- package/theme/shine.js +19 -0
- package/theme/vintage.js +19 -0
- package/build/rollup-plugin-ec-dev.js +0 -38
- package/lib/chart/helper/WhiskerBoxDraw.js +0 -201
- package/lib/chart/tree/commonLayout.js +0 -108
- package/lib/chart/tree/orthogonalLayout.js +0 -9
- package/lib/chart/tree/radialLayout.js +0 -9
- package/lib/component/dataset/DatasetModel.js +0 -29
- package/src/chart/helper/WhiskerBoxDraw.js +0 -213
- package/src/chart/tree/commonLayout.js +0 -96
- package/src/chart/tree/orthogonalLayout.js +0 -7
- package/src/chart/tree/radialLayout.js +0 -7
- package/src/component/dataset/DatasetModel.js +0 -31
package/src/data/List.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
1
20
|
/**
|
|
2
21
|
* List for data storage
|
|
3
22
|
* @module echarts/data/List
|
|
@@ -14,27 +33,28 @@ import {summarizeDimensions} from './helper/dimensionHelper';
|
|
|
14
33
|
var isObject = zrUtil.isObject;
|
|
15
34
|
|
|
16
35
|
var UNDEFINED = 'undefined';
|
|
17
|
-
var globalObj = typeof window === UNDEFINED ? global : window;
|
|
18
36
|
|
|
19
37
|
// Use prefix to avoid index to be the same as otherIdList[idx],
|
|
20
38
|
// which will cause weird udpate animation.
|
|
21
39
|
var ID_PREFIX = 'e\0\0';
|
|
22
40
|
|
|
23
41
|
var dataCtors = {
|
|
24
|
-
'float': typeof
|
|
25
|
-
? Array :
|
|
26
|
-
'int': typeof
|
|
27
|
-
? Array :
|
|
42
|
+
'float': typeof Float64Array === UNDEFINED
|
|
43
|
+
? Array : Float64Array,
|
|
44
|
+
'int': typeof Int32Array === UNDEFINED
|
|
45
|
+
? Array : Int32Array,
|
|
28
46
|
// Ordinal data type can be string or int
|
|
29
47
|
'ordinal': Array,
|
|
30
48
|
'number': Array,
|
|
31
49
|
'time': Array
|
|
32
50
|
};
|
|
33
51
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is
|
|
53
|
+
// different from the Ctor of typed array.
|
|
54
|
+
var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;
|
|
55
|
+
var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;
|
|
37
56
|
|
|
57
|
+
function getIndicesCtor(list) {
|
|
38
58
|
// The possible max value in this._indicies is always this._rawCount despite of filtering.
|
|
39
59
|
return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;
|
|
40
60
|
}
|
|
@@ -46,21 +66,29 @@ function cloneChunk(originalChunk) {
|
|
|
46
66
|
}
|
|
47
67
|
|
|
48
68
|
var TRANSFERABLE_PROPERTIES = [
|
|
49
|
-
'
|
|
50
|
-
'_rawData', '
|
|
51
|
-
'
|
|
69
|
+
'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',
|
|
70
|
+
'_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter',
|
|
71
|
+
'_count', '_rawCount', '_nameDimIdx', '_idDimIdx'
|
|
72
|
+
];
|
|
73
|
+
var CLONE_PROPERTIES = [
|
|
74
|
+
'_extent', '_approximateExtent', '_rawExtent'
|
|
52
75
|
];
|
|
53
76
|
|
|
54
|
-
function transferProperties(
|
|
55
|
-
zrUtil.each(TRANSFERABLE_PROPERTIES.concat(
|
|
56
|
-
if (
|
|
57
|
-
|
|
77
|
+
function transferProperties(target, source) {
|
|
78
|
+
zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {
|
|
79
|
+
if (source.hasOwnProperty(propName)) {
|
|
80
|
+
target[propName] = source[propName];
|
|
58
81
|
}
|
|
59
82
|
});
|
|
60
83
|
|
|
61
|
-
|
|
62
|
-
}
|
|
84
|
+
target.__wrappedMethods = source.__wrappedMethods;
|
|
63
85
|
|
|
86
|
+
zrUtil.each(CLONE_PROPERTIES, function (propName) {
|
|
87
|
+
target[propName] = zrUtil.clone(source[propName]);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
target._calculationInfo = zrUtil.extend(source._calculationInfo);
|
|
91
|
+
}
|
|
64
92
|
|
|
65
93
|
|
|
66
94
|
|
|
@@ -75,6 +103,7 @@ function transferProperties(a, b) {
|
|
|
75
103
|
* Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
|
|
76
104
|
* Spetial fields: {
|
|
77
105
|
* ordinalMeta: <module:echarts/data/OrdinalMeta>
|
|
106
|
+
* createInvertedIndices: <boolean>
|
|
78
107
|
* }
|
|
79
108
|
* @param {module:echarts/model/Model} hostModel
|
|
80
109
|
*/
|
|
@@ -84,29 +113,21 @@ var List = function (dimensions, hostModel) {
|
|
|
84
113
|
|
|
85
114
|
var dimensionInfos = {};
|
|
86
115
|
var dimensionNames = [];
|
|
116
|
+
var invertedIndicesMap = {};
|
|
117
|
+
|
|
87
118
|
for (var i = 0; i < dimensions.length; i++) {
|
|
88
|
-
|
|
89
|
-
var dimensionInfo =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
dimensionInfo = {
|
|
93
|
-
name: dimensionName,
|
|
94
|
-
coordDim: dimensionName,
|
|
95
|
-
coordDimIndex: 0,
|
|
96
|
-
stackable: false,
|
|
97
|
-
// Type can be 'float', 'int', 'number'
|
|
98
|
-
// Default is float64
|
|
99
|
-
type: 'float'
|
|
100
|
-
};
|
|
119
|
+
// Use the original dimensions[i], where other flag props may exists.
|
|
120
|
+
var dimensionInfo = dimensions[i];
|
|
121
|
+
|
|
122
|
+
if (zrUtil.isString(dimensionInfo)) {
|
|
123
|
+
dimensionInfo = {name: dimensionInfo};
|
|
101
124
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
dimensionInfo.coordDimIndex = 0;
|
|
109
|
-
}
|
|
125
|
+
|
|
126
|
+
var dimensionName = dimensionInfo.name;
|
|
127
|
+
dimensionInfo.type = dimensionInfo.type || 'float';
|
|
128
|
+
if (!dimensionInfo.coordDim) {
|
|
129
|
+
dimensionInfo.coordDim = dimensionName;
|
|
130
|
+
dimensionInfo.coordDimIndex = 0;
|
|
110
131
|
}
|
|
111
132
|
|
|
112
133
|
dimensionInfo.otherDims = dimensionInfo.otherDims || {};
|
|
@@ -114,6 +135,10 @@ var List = function (dimensions, hostModel) {
|
|
|
114
135
|
dimensionInfos[dimensionName] = dimensionInfo;
|
|
115
136
|
|
|
116
137
|
dimensionInfo.index = i;
|
|
138
|
+
|
|
139
|
+
if (dimensionInfo.createInvertedIndices) {
|
|
140
|
+
invertedIndicesMap[dimensionName] = [];
|
|
141
|
+
}
|
|
117
142
|
}
|
|
118
143
|
|
|
119
144
|
/**
|
|
@@ -172,11 +197,6 @@ var List = function (dimensions, hostModel) {
|
|
|
172
197
|
*/
|
|
173
198
|
this._optionModels = [];
|
|
174
199
|
|
|
175
|
-
/**
|
|
176
|
-
* @param {module:echarts/data/List}
|
|
177
|
-
*/
|
|
178
|
-
this.stackedOn = null;
|
|
179
|
-
|
|
180
200
|
/**
|
|
181
201
|
* Global visual properties after visual coding
|
|
182
202
|
* @type {Object}
|
|
@@ -268,6 +288,18 @@ var List = function (dimensions, hostModel) {
|
|
|
268
288
|
* @private
|
|
269
289
|
*/
|
|
270
290
|
this._dimensionsSummary = summarizeDimensions(this);
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @type {Object.<Array|TypedArray>}
|
|
294
|
+
* @private
|
|
295
|
+
*/
|
|
296
|
+
this._invertedIndicesMap = invertedIndicesMap;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @type {Object}
|
|
300
|
+
* @private
|
|
301
|
+
*/
|
|
302
|
+
this._calculationInfo = {};
|
|
271
303
|
};
|
|
272
304
|
|
|
273
305
|
var listProto = List.prototype;
|
|
@@ -295,7 +327,7 @@ listProto.getDimension = function (dim) {
|
|
|
295
327
|
};
|
|
296
328
|
|
|
297
329
|
/**
|
|
298
|
-
* Get type and
|
|
330
|
+
* Get type and calculation info of particular dimension
|
|
299
331
|
* @param {string|number} dim
|
|
300
332
|
* Dimension can be concrete names like x, y, z, lng, lat, angle, radius
|
|
301
333
|
* Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
|
|
@@ -314,19 +346,25 @@ listProto.getDimensionsOnCoord = function () {
|
|
|
314
346
|
|
|
315
347
|
/**
|
|
316
348
|
* @param {string} coordDim
|
|
317
|
-
* @param {number
|
|
349
|
+
* @param {number} [idx] A coordDim may map to more than one data dim.
|
|
318
350
|
* If idx is `true`, return a array of all mapped dims.
|
|
351
|
+
* If idx is not specified, return the first dim not extra.
|
|
319
352
|
* @return {string|Array.<string>} concrete data dim.
|
|
320
353
|
* If idx is number, and not found, return null/undefined.
|
|
321
|
-
* If idx is `true`, and not found, return empty array.
|
|
354
|
+
* If idx is `true`, and not found, return empty array (always return array).
|
|
322
355
|
*/
|
|
323
356
|
listProto.mapDimension = function (coordDim, idx) {
|
|
324
|
-
var
|
|
357
|
+
var dimensionsSummary = this._dimensionsSummary;
|
|
358
|
+
|
|
359
|
+
if (idx == null) {
|
|
360
|
+
return dimensionsSummary.encodeFirstDimNotExtra[coordDim];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
var dims = dimensionsSummary.encode[coordDim];
|
|
325
364
|
return idx === true
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
: null;
|
|
365
|
+
// always return array if idx is `true`
|
|
366
|
+
? (dims || []).slice()
|
|
367
|
+
: (dims && dims[idx]);
|
|
330
368
|
};
|
|
331
369
|
|
|
332
370
|
/**
|
|
@@ -419,6 +457,7 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
419
457
|
var rawData = this._rawData;
|
|
420
458
|
var storage = this._storage;
|
|
421
459
|
var dimensions = this.dimensions;
|
|
460
|
+
var dimLen = dimensions.length;
|
|
422
461
|
var dimensionInfoMap = this._dimensionInfos;
|
|
423
462
|
var nameList = this._nameList;
|
|
424
463
|
var idList = this._idList;
|
|
@@ -428,10 +467,10 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
428
467
|
|
|
429
468
|
var chunkCount = this._chunkCount;
|
|
430
469
|
var lastChunkIndex = chunkCount - 1;
|
|
431
|
-
for (var i = 0; i <
|
|
470
|
+
for (var i = 0; i < dimLen; i++) {
|
|
432
471
|
var dim = dimensions[i];
|
|
433
472
|
if (!rawExtent[dim]) {
|
|
434
|
-
rawExtent[dim] =
|
|
473
|
+
rawExtent[dim] = getInitialExtent();
|
|
435
474
|
}
|
|
436
475
|
|
|
437
476
|
var dimInfo = dimensionInfoMap[dim];
|
|
@@ -464,9 +503,10 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
464
503
|
this._chunkCount = storage[dim].length;
|
|
465
504
|
}
|
|
466
505
|
|
|
506
|
+
var dataItem = new Array(dimLen);
|
|
467
507
|
for (var idx = start; idx < end; idx++) {
|
|
468
508
|
// NOTICE: Try not to write things into dataItem
|
|
469
|
-
|
|
509
|
+
dataItem = rawData.getItem(idx, dataItem);
|
|
470
510
|
// Each data item is value
|
|
471
511
|
// [1, 2]
|
|
472
512
|
// 2
|
|
@@ -477,18 +517,19 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
477
517
|
var chunkOffset = idx % chunkSize;
|
|
478
518
|
|
|
479
519
|
// Store the data by dimensions
|
|
480
|
-
for (var k = 0; k <
|
|
520
|
+
for (var k = 0; k < dimLen; k++) {
|
|
481
521
|
var dim = dimensions[k];
|
|
482
522
|
var dimStorage = storage[dim][chunkIndex];
|
|
483
523
|
// PENDING NULL is empty or zero
|
|
484
524
|
var val = this._dimValueGetter(dataItem, dim, idx, k);
|
|
485
525
|
dimStorage[chunkOffset] = val;
|
|
486
526
|
|
|
487
|
-
|
|
488
|
-
|
|
527
|
+
var dimRawExtent = rawExtent[dim];
|
|
528
|
+
if (val < dimRawExtent[0]) {
|
|
529
|
+
dimRawExtent[0] = val;
|
|
489
530
|
}
|
|
490
|
-
if (val >
|
|
491
|
-
|
|
531
|
+
if (val > dimRawExtent[1]) {
|
|
532
|
+
dimRawExtent[1] = val;
|
|
492
533
|
}
|
|
493
534
|
}
|
|
494
535
|
|
|
@@ -497,15 +538,25 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
497
538
|
if (!rawData.pure) {
|
|
498
539
|
var name = nameList[idx];
|
|
499
540
|
|
|
500
|
-
if (dataItem &&
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
else if (dataItem.name != null) {
|
|
541
|
+
if (dataItem && name == null) {
|
|
542
|
+
// If dataItem is {name: ...}, it has highest priority.
|
|
543
|
+
// That is appropriate for many common cases.
|
|
544
|
+
if (dataItem.name != null) {
|
|
505
545
|
// There is no other place to persistent dataItem.name,
|
|
506
546
|
// so save it to nameList.
|
|
507
547
|
nameList[idx] = name = dataItem.name;
|
|
508
548
|
}
|
|
549
|
+
else if (nameDimIdx != null) {
|
|
550
|
+
var nameDim = dimensions[nameDimIdx];
|
|
551
|
+
var nameDimChunk = storage[nameDim][chunkIndex];
|
|
552
|
+
if (nameDimChunk) {
|
|
553
|
+
name = nameDimChunk[chunkOffset];
|
|
554
|
+
var ordinalMeta = dimensionInfoMap[nameDim].ordinalMeta;
|
|
555
|
+
if (ordinalMeta && ordinalMeta.categories.length) {
|
|
556
|
+
name = ordinalMeta.categories[name];
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
509
560
|
}
|
|
510
561
|
|
|
511
562
|
// Try using the id in option
|
|
@@ -534,45 +585,52 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
534
585
|
|
|
535
586
|
// Reset data extent
|
|
536
587
|
this._extent = {};
|
|
588
|
+
|
|
589
|
+
prepareInvertedIndex(this);
|
|
537
590
|
};
|
|
538
591
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
var
|
|
546
|
-
var dim = this.dimensions[nameDimIdx];
|
|
547
|
-
var ordinalMeta = this._dimensionInfos[dim].ordinalMeta;
|
|
592
|
+
function prepareInvertedIndex(list) {
|
|
593
|
+
var invertedIndicesMap = list._invertedIndicesMap;
|
|
594
|
+
zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {
|
|
595
|
+
var dimInfo = list._dimensionInfos[dim];
|
|
596
|
+
|
|
597
|
+
// Currently, only dimensions that has ordinalMeta can create inverted indices.
|
|
598
|
+
var ordinalMeta = dimInfo.ordinalMeta;
|
|
548
599
|
if (ordinalMeta) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
600
|
+
invertedIndices = invertedIndicesMap[dim] = new CtorUint32Array(
|
|
601
|
+
ordinalMeta.categories.length
|
|
602
|
+
);
|
|
603
|
+
// The default value of TypedArray is 0. To avoid miss
|
|
604
|
+
// mapping to 0, we should set it as NaN.
|
|
605
|
+
for (var i = 0; i < invertedIndices.length; i++) {
|
|
606
|
+
invertedIndices[i] = NaN;
|
|
607
|
+
}
|
|
608
|
+
for (var i = 0; i < list._count; i++) {
|
|
609
|
+
// Only support the case that all values are distinct.
|
|
610
|
+
invertedIndices[list.get(dim, i)] = i;
|
|
611
|
+
}
|
|
554
612
|
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
613
|
+
});
|
|
614
|
+
}
|
|
557
615
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
var chunkSize = this._chunkSize;
|
|
616
|
+
function getRawValueFromStore(list, dimIndex, rawIndex) {
|
|
617
|
+
var val;
|
|
618
|
+
if (dimIndex != null) {
|
|
619
|
+
var chunkSize = list._chunkSize;
|
|
563
620
|
var chunkIndex = Math.floor(rawIndex / chunkSize);
|
|
564
621
|
var chunkOffset = rawIndex % chunkSize;
|
|
565
|
-
var dim =
|
|
566
|
-
var
|
|
567
|
-
if (
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
622
|
+
var dim = list.dimensions[dimIndex];
|
|
623
|
+
var chunk = list._storage[dim][chunkIndex];
|
|
624
|
+
if (chunk) {
|
|
625
|
+
val = chunk[chunkOffset];
|
|
626
|
+
var ordinalMeta = list._dimensionInfos[dim].ordinalMeta;
|
|
627
|
+
if (ordinalMeta && ordinalMeta.categories.length) {
|
|
628
|
+
val = ordinalMeta.categories[val];
|
|
629
|
+
}
|
|
573
630
|
}
|
|
574
631
|
}
|
|
575
|
-
|
|
632
|
+
return val;
|
|
633
|
+
}
|
|
576
634
|
|
|
577
635
|
/**
|
|
578
636
|
* @return {number}
|
|
@@ -582,17 +640,32 @@ listProto.count = function () {
|
|
|
582
640
|
};
|
|
583
641
|
|
|
584
642
|
listProto.getIndices = function () {
|
|
585
|
-
|
|
586
|
-
var Ctor = this._indices.constructor;
|
|
587
|
-
return new Ctor(this._indices.buffer, 0, this._count);
|
|
588
|
-
}
|
|
643
|
+
var newIndices;
|
|
589
644
|
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
645
|
+
var indices = this._indices;
|
|
646
|
+
if (indices) {
|
|
647
|
+
var Ctor = indices.constructor;
|
|
648
|
+
var thisCount = this._count;
|
|
649
|
+
// `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.
|
|
650
|
+
if (Ctor === Array) {
|
|
651
|
+
newIndices = new Ctor(thisCount);
|
|
652
|
+
for (var i = 0; i < thisCount; i++) {
|
|
653
|
+
newIndices[i] = indices[i];
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
newIndices = new Ctor(indices.buffer, 0, thisCount);
|
|
658
|
+
}
|
|
594
659
|
}
|
|
595
|
-
|
|
660
|
+
else {
|
|
661
|
+
var Ctor = getIndicesCtor(this);
|
|
662
|
+
var newIndices = new Ctor(this.count());
|
|
663
|
+
for (var i = 0; i < newIndices.length; i++) {
|
|
664
|
+
newIndices[i] = i;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
return newIndices;
|
|
596
669
|
};
|
|
597
670
|
|
|
598
671
|
/**
|
|
@@ -602,7 +675,7 @@ listProto.getIndices = function () {
|
|
|
602
675
|
* @param {boolean} stack
|
|
603
676
|
* @return {number}
|
|
604
677
|
*/
|
|
605
|
-
listProto.get = function (dim, idx
|
|
678
|
+
listProto.get = function (dim, idx /*, stack */) {
|
|
606
679
|
if (!(idx >= 0 && idx < this._count)) {
|
|
607
680
|
return NaN;
|
|
608
681
|
}
|
|
@@ -620,29 +693,53 @@ listProto.get = function (dim, idx, stack) {
|
|
|
620
693
|
var chunkStore = storage[dim][chunkIndex];
|
|
621
694
|
var value = chunkStore[chunkOffset];
|
|
622
695
|
// FIXME ordinal data type is not stackable
|
|
623
|
-
if (stack) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
696
|
+
// if (stack) {
|
|
697
|
+
// var dimensionInfo = this._dimensionInfos[dim];
|
|
698
|
+
// if (dimensionInfo && dimensionInfo.stackable) {
|
|
699
|
+
// var stackedOn = this.stackedOn;
|
|
700
|
+
// while (stackedOn) {
|
|
701
|
+
// // Get no stacked data of stacked on
|
|
702
|
+
// var stackedValue = stackedOn.get(dim, idx);
|
|
703
|
+
// // Considering positive stack, negative stack and empty data
|
|
704
|
+
// if ((value >= 0 && stackedValue > 0) // Positive stack
|
|
705
|
+
// || (value <= 0 && stackedValue < 0) // Negative stack
|
|
706
|
+
// ) {
|
|
707
|
+
// value += stackedValue;
|
|
708
|
+
// }
|
|
709
|
+
// stackedOn = stackedOn.stackedOn;
|
|
710
|
+
// }
|
|
711
|
+
// }
|
|
712
|
+
// }
|
|
640
713
|
|
|
641
714
|
return value;
|
|
642
715
|
};
|
|
643
716
|
|
|
644
|
-
|
|
645
|
-
|
|
717
|
+
/**
|
|
718
|
+
* @param {string} dim concrete dim
|
|
719
|
+
* @param {number} rawIndex
|
|
720
|
+
* @return {number|string}
|
|
721
|
+
*/
|
|
722
|
+
listProto.getByRawIndex = function (dim, rawIdx) {
|
|
723
|
+
if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {
|
|
724
|
+
return NaN;
|
|
725
|
+
}
|
|
726
|
+
var dimStore = this._storage[dim];
|
|
727
|
+
if (!dimStore) {
|
|
728
|
+
// TODO Warn ?
|
|
729
|
+
return NaN;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
var chunkIndex = Math.floor(rawIdx / this._chunkSize);
|
|
733
|
+
var chunkOffset = rawIdx % this._chunkSize;
|
|
734
|
+
var chunkStore = dimStore[chunkIndex];
|
|
735
|
+
return chunkStore[chunkOffset];
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* FIXME Use `get` on chrome maybe slow(in filterSelf and selectRange).
|
|
740
|
+
* Hack a much simpler _getFast
|
|
741
|
+
* @private
|
|
742
|
+
*/
|
|
646
743
|
listProto._getFast = function (dim, rawIdx) {
|
|
647
744
|
var chunkIndex = Math.floor(rawIdx / this._chunkSize);
|
|
648
745
|
var chunkOffset = rawIdx % this._chunkSize;
|
|
@@ -654,20 +751,19 @@ listProto._getFast = function (dim, rawIdx) {
|
|
|
654
751
|
* Get value for multi dimensions.
|
|
655
752
|
* @param {Array.<string>} [dimensions] If ignored, using all dimensions.
|
|
656
753
|
* @param {number} idx
|
|
657
|
-
* @param {boolean} stack
|
|
658
754
|
* @return {number}
|
|
659
755
|
*/
|
|
660
|
-
listProto.getValues = function (dimensions, idx
|
|
756
|
+
listProto.getValues = function (dimensions, idx /*, stack */) {
|
|
661
757
|
var values = [];
|
|
662
758
|
|
|
663
759
|
if (!zrUtil.isArray(dimensions)) {
|
|
664
|
-
stack = idx;
|
|
760
|
+
// stack = idx;
|
|
665
761
|
idx = dimensions;
|
|
666
762
|
dimensions = this.dimensions;
|
|
667
763
|
}
|
|
668
764
|
|
|
669
765
|
for (var i = 0, len = dimensions.length; i < len; i++) {
|
|
670
|
-
values.push(this.get(dimensions[i], idx
|
|
766
|
+
values.push(this.get(dimensions[i], idx /*, stack */));
|
|
671
767
|
}
|
|
672
768
|
|
|
673
769
|
return values;
|
|
@@ -701,13 +797,13 @@ listProto.hasValue = function (idx) {
|
|
|
701
797
|
* @param {string} dim
|
|
702
798
|
* @param {boolean} stack
|
|
703
799
|
*/
|
|
704
|
-
listProto.getDataExtent = function (dim
|
|
800
|
+
listProto.getDataExtent = function (dim /*, stack */) {
|
|
705
801
|
// Make sure use concrete dim as cache name.
|
|
706
802
|
dim = this.getDimension(dim);
|
|
707
803
|
var dimData = this._storage[dim];
|
|
708
|
-
var initialExtent =
|
|
804
|
+
var initialExtent = getInitialExtent();
|
|
709
805
|
|
|
710
|
-
stack = (stack || false) && this.
|
|
806
|
+
// stack = !!((stack || false) && this.getCalculationInfo(dim));
|
|
711
807
|
|
|
712
808
|
if (!dimData) {
|
|
713
809
|
return initialExtent;
|
|
@@ -715,18 +811,19 @@ listProto.getDataExtent = function (dim, stack) {
|
|
|
715
811
|
|
|
716
812
|
// Make more strict checkings to ensure hitting cache.
|
|
717
813
|
var currEnd = this.count();
|
|
718
|
-
var cacheName = [dim, !!stack].join('_');
|
|
814
|
+
// var cacheName = [dim, !!stack].join('_');
|
|
815
|
+
// var cacheName = dim;
|
|
719
816
|
|
|
720
817
|
// Consider the most cases when using data zoom, `getDataExtent`
|
|
721
818
|
// happened before filtering. We cache raw extent, which is not
|
|
722
819
|
// necessary to be cleared and recalculated when restore data.
|
|
723
|
-
var useRaw = !this._indices && !stack;
|
|
820
|
+
var useRaw = !this._indices; // && !stack;
|
|
724
821
|
var dimExtent;
|
|
725
822
|
|
|
726
823
|
if (useRaw) {
|
|
727
824
|
return this._rawExtent[dim].slice();
|
|
728
825
|
}
|
|
729
|
-
dimExtent = this._extent[
|
|
826
|
+
dimExtent = this._extent[dim];
|
|
730
827
|
if (dimExtent) {
|
|
731
828
|
return dimExtent.slice();
|
|
732
829
|
}
|
|
@@ -736,14 +833,15 @@ listProto.getDataExtent = function (dim, stack) {
|
|
|
736
833
|
var max = dimExtent[1];
|
|
737
834
|
|
|
738
835
|
for (var i = 0; i < currEnd; i++) {
|
|
739
|
-
var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i));
|
|
836
|
+
// var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i));
|
|
837
|
+
var value = this._getFast(dim, this.getRawIndex(i));
|
|
740
838
|
value < min && (min = value);
|
|
741
839
|
value > max && (max = value);
|
|
742
840
|
}
|
|
743
841
|
|
|
744
842
|
dimExtent = [min, max];
|
|
745
843
|
|
|
746
|
-
this._extent[
|
|
844
|
+
this._extent[dim] = dimExtent;
|
|
747
845
|
|
|
748
846
|
return dimExtent;
|
|
749
847
|
};
|
|
@@ -754,32 +852,44 @@ listProto.getDataExtent = function (dim, stack) {
|
|
|
754
852
|
* extent calculation will cost more than 10ms and the cache will
|
|
755
853
|
* be erased because of the filtering.
|
|
756
854
|
*/
|
|
757
|
-
listProto.getApproximateExtent = function (dim
|
|
855
|
+
listProto.getApproximateExtent = function (dim /*, stack */) {
|
|
758
856
|
dim = this.getDimension(dim);
|
|
759
|
-
return this._approximateExtent[dim] || this.getDataExtent(dim
|
|
857
|
+
return this._approximateExtent[dim] || this.getDataExtent(dim /*, stack */);
|
|
760
858
|
};
|
|
761
859
|
|
|
762
|
-
listProto.setApproximateExtent = function (extent, dim
|
|
860
|
+
listProto.setApproximateExtent = function (extent, dim /*, stack */) {
|
|
763
861
|
dim = this.getDimension(dim);
|
|
764
862
|
this._approximateExtent[dim] = extent.slice();
|
|
765
863
|
};
|
|
766
864
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
865
|
+
/**
|
|
866
|
+
* @param {string} key
|
|
867
|
+
* @return {*}
|
|
868
|
+
*/
|
|
869
|
+
listProto.getCalculationInfo = function (key) {
|
|
870
|
+
return this._calculationInfo[key];
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* @param {string|Object} key or k-v object
|
|
875
|
+
* @param {*} [value]
|
|
876
|
+
*/
|
|
877
|
+
listProto.setCalculationInfo = function (key, value) {
|
|
878
|
+
isObject(key)
|
|
879
|
+
? zrUtil.extend(this._calculationInfo, key)
|
|
880
|
+
: (this._calculationInfo[key] = value);
|
|
770
881
|
};
|
|
771
882
|
|
|
772
883
|
/**
|
|
773
884
|
* Get sum of data in one dimension
|
|
774
885
|
* @param {string} dim
|
|
775
|
-
* @param {boolean} stack
|
|
776
886
|
*/
|
|
777
|
-
listProto.getSum = function (dim
|
|
887
|
+
listProto.getSum = function (dim /*, stack */) {
|
|
778
888
|
var dimData = this._storage[dim];
|
|
779
889
|
var sum = 0;
|
|
780
890
|
if (dimData) {
|
|
781
891
|
for (var i = 0, len = this.count(); i < len; i++) {
|
|
782
|
-
var value = this.get(dim, i
|
|
892
|
+
var value = this.get(dim, i /*, stack */);
|
|
783
893
|
if (!isNaN(value)) {
|
|
784
894
|
sum += value;
|
|
785
895
|
}
|
|
@@ -789,26 +899,76 @@ listProto.getSum = function (dim, stack) {
|
|
|
789
899
|
};
|
|
790
900
|
|
|
791
901
|
/**
|
|
792
|
-
*
|
|
793
|
-
* @param {
|
|
794
|
-
* @param {number} value
|
|
795
|
-
* @return {number}
|
|
902
|
+
* Get median of data in one dimension
|
|
903
|
+
* @param {string} dim
|
|
796
904
|
*/
|
|
905
|
+
listProto.getMedian = function (dim /*, stack */) {
|
|
906
|
+
var dimDataArray = [];
|
|
907
|
+
// map all data of one dimension
|
|
908
|
+
this.each(dim, function (val, idx) {
|
|
909
|
+
if (!isNaN(val)) {
|
|
910
|
+
dimDataArray.push(val);
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
// TODO
|
|
915
|
+
// Use quick select?
|
|
916
|
+
|
|
917
|
+
// immutability & sort
|
|
918
|
+
var sortedDimDataArray = [].concat(dimDataArray).sort(function(a, b) {
|
|
919
|
+
return a - b;
|
|
920
|
+
});
|
|
921
|
+
var len = this.count();
|
|
922
|
+
// calculate median
|
|
923
|
+
return len === 0 ? 0 :
|
|
924
|
+
len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] :
|
|
925
|
+
(sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
// /**
|
|
929
|
+
// * Retreive the index with given value
|
|
930
|
+
// * @param {string} dim Concrete dimension.
|
|
931
|
+
// * @param {number} value
|
|
932
|
+
// * @return {number}
|
|
933
|
+
// */
|
|
934
|
+
// Currently incorrect: should return dataIndex but not rawIndex.
|
|
935
|
+
// Do not fix it until this method is to be used somewhere.
|
|
797
936
|
// FIXME Precision of float value
|
|
798
|
-
listProto.indexOf = function (dim, value) {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
937
|
+
// listProto.indexOf = function (dim, value) {
|
|
938
|
+
// var storage = this._storage;
|
|
939
|
+
// var dimData = storage[dim];
|
|
940
|
+
// var chunkSize = this._chunkSize;
|
|
941
|
+
// if (dimData) {
|
|
942
|
+
// for (var i = 0, len = this.count(); i < len; i++) {
|
|
943
|
+
// var chunkIndex = Math.floor(i / chunkSize);
|
|
944
|
+
// var chunkOffset = i % chunkSize;
|
|
945
|
+
// if (dimData[chunkIndex][chunkOffset] === value) {
|
|
946
|
+
// return i;
|
|
947
|
+
// }
|
|
948
|
+
// }
|
|
949
|
+
// }
|
|
950
|
+
// return -1;
|
|
951
|
+
// };
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* Only support the dimension which inverted index created.
|
|
955
|
+
* Do not support other cases until required.
|
|
956
|
+
* @param {string} concrete dim
|
|
957
|
+
* @param {number|string} value
|
|
958
|
+
* @return {number} rawIndex
|
|
959
|
+
*/
|
|
960
|
+
listProto.rawIndexOf = function (dim, value) {
|
|
961
|
+
var invertedIndices = dim && this._invertedIndicesMap[dim];
|
|
962
|
+
if (__DEV__) {
|
|
963
|
+
if (!invertedIndices) {
|
|
964
|
+
throw new Error('Do not supported yet');
|
|
809
965
|
}
|
|
810
966
|
}
|
|
811
|
-
|
|
967
|
+
var rawIndex = invertedIndices[value];
|
|
968
|
+
if (rawIndex == null || isNaN(rawIndex)) {
|
|
969
|
+
return -1;
|
|
970
|
+
}
|
|
971
|
+
return rawIndex;
|
|
812
972
|
};
|
|
813
973
|
|
|
814
974
|
/**
|
|
@@ -872,11 +1032,10 @@ listProto.indexOfRawIndex = function (rawIndex) {
|
|
|
872
1032
|
* Retreive the index of nearest value
|
|
873
1033
|
* @param {string} dim
|
|
874
1034
|
* @param {number} value
|
|
875
|
-
* @param {boolean} stack If given value is after stacked
|
|
876
1035
|
* @param {number} [maxDistance=Infinity]
|
|
877
1036
|
* @return {Array.<number>} Considere multiple points has the same value.
|
|
878
1037
|
*/
|
|
879
|
-
listProto.indicesOfNearest = function (dim, value,
|
|
1038
|
+
listProto.indicesOfNearest = function (dim, value, maxDistance) {
|
|
880
1039
|
var storage = this._storage;
|
|
881
1040
|
var dimData = storage[dim];
|
|
882
1041
|
var nearestIndices = [];
|
|
@@ -892,7 +1051,7 @@ listProto.indicesOfNearest = function (dim, value, stack, maxDistance) {
|
|
|
892
1051
|
var minDist = Number.MAX_VALUE;
|
|
893
1052
|
var minDiff = -1;
|
|
894
1053
|
for (var i = 0, len = this.count(); i < len; i++) {
|
|
895
|
-
var diff = value - this.get(dim, i
|
|
1054
|
+
var diff = value - this.get(dim, i /*, stack */);
|
|
896
1055
|
var dist = Math.abs(diff);
|
|
897
1056
|
if (diff <= maxDistance && dist <= minDist) {
|
|
898
1057
|
// For the case of two data are same on xAxis, which has sequence data.
|
|
@@ -954,7 +1113,7 @@ listProto.getRawDataItem = function (idx) {
|
|
|
954
1113
|
listProto.getName = function (idx) {
|
|
955
1114
|
var rawIndex = this.getRawIndex(idx);
|
|
956
1115
|
return this._nameList[rawIndex]
|
|
957
|
-
|| this.
|
|
1116
|
+
|| getRawValueFromStore(this, this._nameDimIdx, rawIndex)
|
|
958
1117
|
|| '';
|
|
959
1118
|
};
|
|
960
1119
|
|
|
@@ -970,7 +1129,7 @@ listProto.getId = function (idx) {
|
|
|
970
1129
|
function getId(list, rawIndex) {
|
|
971
1130
|
var id = list._idList[rawIndex];
|
|
972
1131
|
if (id == null) {
|
|
973
|
-
id = list.
|
|
1132
|
+
id = getRawValueFromStore(list, list._idDimIdx, rawIndex);
|
|
974
1133
|
}
|
|
975
1134
|
if (id == null) {
|
|
976
1135
|
// FIXME Check the usage in graph, should not use prefix.
|
|
@@ -1000,7 +1159,6 @@ function validateDimensions(list, dims) {
|
|
|
1000
1159
|
* Data iteration
|
|
1001
1160
|
* @param {string|Array.<string>}
|
|
1002
1161
|
* @param {Function} cb
|
|
1003
|
-
* @param {boolean} [stack=false]
|
|
1004
1162
|
* @param {*} [context=this]
|
|
1005
1163
|
*
|
|
1006
1164
|
* @example
|
|
@@ -1008,7 +1166,7 @@ function validateDimensions(list, dims) {
|
|
|
1008
1166
|
* list.each(['x', 'y'], function (x, y, idx) {});
|
|
1009
1167
|
* list.each(function (idx) {})
|
|
1010
1168
|
*/
|
|
1011
|
-
listProto.each = function (dims, cb,
|
|
1169
|
+
listProto.each = function (dims, cb, context, contextCompat) {
|
|
1012
1170
|
'use strict';
|
|
1013
1171
|
|
|
1014
1172
|
if (!this._count) {
|
|
@@ -1016,12 +1174,15 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1016
1174
|
}
|
|
1017
1175
|
|
|
1018
1176
|
if (typeof dims === 'function') {
|
|
1019
|
-
|
|
1020
|
-
|
|
1177
|
+
contextCompat = context;
|
|
1178
|
+
context = cb;
|
|
1021
1179
|
cb = dims;
|
|
1022
1180
|
dims = [];
|
|
1023
1181
|
}
|
|
1024
1182
|
|
|
1183
|
+
// contextCompat just for compat echarts3
|
|
1184
|
+
context = context || contextCompat || this;
|
|
1185
|
+
|
|
1025
1186
|
dims = zrUtil.map(normalizeDimensions(dims), this.getDimension, this);
|
|
1026
1187
|
|
|
1027
1188
|
if (__DEV__) {
|
|
@@ -1030,8 +1191,6 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1030
1191
|
|
|
1031
1192
|
var dimSize = dims.length;
|
|
1032
1193
|
|
|
1033
|
-
context = context || this;
|
|
1034
|
-
|
|
1035
1194
|
for (var i = 0; i < this.count(); i++) {
|
|
1036
1195
|
// Simple optimization
|
|
1037
1196
|
switch (dimSize) {
|
|
@@ -1039,16 +1198,16 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1039
1198
|
cb.call(context, i);
|
|
1040
1199
|
break;
|
|
1041
1200
|
case 1:
|
|
1042
|
-
cb.call(context, this.get(dims[0], i
|
|
1201
|
+
cb.call(context, this.get(dims[0], i), i);
|
|
1043
1202
|
break;
|
|
1044
1203
|
case 2:
|
|
1045
|
-
cb.call(context, this.get(dims[0], i
|
|
1204
|
+
cb.call(context, this.get(dims[0], i), this.get(dims[1], i), i);
|
|
1046
1205
|
break;
|
|
1047
1206
|
default:
|
|
1048
1207
|
var k = 0;
|
|
1049
1208
|
var value = [];
|
|
1050
1209
|
for (; k < dimSize; k++) {
|
|
1051
|
-
value[k] = this.get(dims[k], i
|
|
1210
|
+
value[k] = this.get(dims[k], i);
|
|
1052
1211
|
}
|
|
1053
1212
|
// Index
|
|
1054
1213
|
value[k] = i;
|
|
@@ -1061,10 +1220,9 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1061
1220
|
* Data filter
|
|
1062
1221
|
* @param {string|Array.<string>}
|
|
1063
1222
|
* @param {Function} cb
|
|
1064
|
-
* @param {boolean} [stack=false]
|
|
1065
1223
|
* @param {*} [context=this]
|
|
1066
1224
|
*/
|
|
1067
|
-
listProto.filterSelf = function (dimensions, cb,
|
|
1225
|
+
listProto.filterSelf = function (dimensions, cb, context, contextCompat) {
|
|
1068
1226
|
'use strict';
|
|
1069
1227
|
|
|
1070
1228
|
if (!this._count) {
|
|
@@ -1072,14 +1230,14 @@ listProto.filterSelf = function (dimensions, cb, stack, context) {
|
|
|
1072
1230
|
}
|
|
1073
1231
|
|
|
1074
1232
|
if (typeof dimensions === 'function') {
|
|
1075
|
-
|
|
1076
|
-
|
|
1233
|
+
contextCompat = context;
|
|
1234
|
+
context = cb;
|
|
1077
1235
|
cb = dimensions;
|
|
1078
1236
|
dimensions = [];
|
|
1079
1237
|
}
|
|
1080
|
-
stack = stack || false;
|
|
1081
1238
|
|
|
1082
|
-
|
|
1239
|
+
// contextCompat just for compat echarts3
|
|
1240
|
+
context = context || contextCompat || this;
|
|
1083
1241
|
|
|
1084
1242
|
dimensions = zrUtil.map(
|
|
1085
1243
|
normalizeDimensions(dimensions), this.getDimension, this
|
|
@@ -1107,12 +1265,12 @@ listProto.filterSelf = function (dimensions, cb, stack, context) {
|
|
|
1107
1265
|
keep = cb.call(context, i);
|
|
1108
1266
|
}
|
|
1109
1267
|
else if (dimSize === 1) {
|
|
1110
|
-
var val =
|
|
1268
|
+
var val = this._getFast(dim0, rawIdx);
|
|
1111
1269
|
keep = cb.call(context, val, i);
|
|
1112
1270
|
}
|
|
1113
1271
|
else {
|
|
1114
1272
|
for (var k = 0; k < dimSize; k++) {
|
|
1115
|
-
value[k] =
|
|
1273
|
+
value[k] = this._getFast(dim0, rawIdx);
|
|
1116
1274
|
}
|
|
1117
1275
|
value[k] = i;
|
|
1118
1276
|
keep = cb.apply(context, value);
|
|
@@ -1139,15 +1297,13 @@ listProto.filterSelf = function (dimensions, cb, stack, context) {
|
|
|
1139
1297
|
* Select data in range. (For optimization of filter)
|
|
1140
1298
|
* (Manually inline code, support 5 million data filtering in data zoom.)
|
|
1141
1299
|
*/
|
|
1142
|
-
listProto.selectRange = function (range
|
|
1300
|
+
listProto.selectRange = function (range) {
|
|
1143
1301
|
'use strict';
|
|
1144
1302
|
|
|
1145
1303
|
if (!this._count) {
|
|
1146
1304
|
return;
|
|
1147
1305
|
}
|
|
1148
1306
|
|
|
1149
|
-
stack = stack || false;
|
|
1150
|
-
|
|
1151
1307
|
var dimensions = [];
|
|
1152
1308
|
for (var dim in range) {
|
|
1153
1309
|
if (range.hasOwnProperty(dim)) {
|
|
@@ -1175,7 +1331,7 @@ listProto.selectRange = function (range, stack) {
|
|
|
1175
1331
|
var max = range[dim0][1];
|
|
1176
1332
|
|
|
1177
1333
|
var quickFinished = false;
|
|
1178
|
-
if (!this._indices
|
|
1334
|
+
if (!this._indices) {
|
|
1179
1335
|
// Extreme optimization for common case. About 2x faster in chrome.
|
|
1180
1336
|
var idx = 0;
|
|
1181
1337
|
if (dimSize === 1) {
|
|
@@ -1185,7 +1341,14 @@ listProto.selectRange = function (range, stack) {
|
|
|
1185
1341
|
var len = Math.min(this._count - k * this._chunkSize, this._chunkSize);
|
|
1186
1342
|
for (var i = 0; i < len; i++) {
|
|
1187
1343
|
var val = chunkStorage[i];
|
|
1188
|
-
|
|
1344
|
+
// NaN will not be filtered. Consider the case, in line chart, empty
|
|
1345
|
+
// value indicates the line should be broken. But for the case like
|
|
1346
|
+
// scatter plot, a data item with empty value will not be rendered,
|
|
1347
|
+
// but the axis extent may be effected if some other dim of the data
|
|
1348
|
+
// item has value. Fortunately it is not a significant negative effect.
|
|
1349
|
+
if (
|
|
1350
|
+
(val >= min && val <= max) || isNaN(val)
|
|
1351
|
+
) {
|
|
1189
1352
|
newIndices[offset++] = idx;
|
|
1190
1353
|
}
|
|
1191
1354
|
idx++;
|
|
@@ -1205,7 +1368,14 @@ listProto.selectRange = function (range, stack) {
|
|
|
1205
1368
|
for (var i = 0; i < len; i++) {
|
|
1206
1369
|
var val = chunkStorage[i];
|
|
1207
1370
|
var val2 = chunkStorage2[i];
|
|
1208
|
-
|
|
1371
|
+
// Do not filter NaN, see comment above.
|
|
1372
|
+
if ((
|
|
1373
|
+
(val >= min && val <= max) || isNaN(val)
|
|
1374
|
+
)
|
|
1375
|
+
&& (
|
|
1376
|
+
(val2 >= min2 && val2 <= max2) || isNaN(val2)
|
|
1377
|
+
)
|
|
1378
|
+
) {
|
|
1209
1379
|
newIndices[offset++] = idx;
|
|
1210
1380
|
}
|
|
1211
1381
|
idx++;
|
|
@@ -1216,11 +1386,13 @@ listProto.selectRange = function (range, stack) {
|
|
|
1216
1386
|
}
|
|
1217
1387
|
if (!quickFinished) {
|
|
1218
1388
|
if (dimSize === 1) {
|
|
1219
|
-
stack = stack || this.isStacked(dim0);
|
|
1220
1389
|
for (var i = 0; i < originalCount; i++) {
|
|
1221
1390
|
var rawIndex = this.getRawIndex(i);
|
|
1222
|
-
var val =
|
|
1223
|
-
|
|
1391
|
+
var val = this._getFast(dim0, rawIndex);
|
|
1392
|
+
// Do not filter NaN, see comment above.
|
|
1393
|
+
if (
|
|
1394
|
+
(val >= min && val <= max) || isNaN(val)
|
|
1395
|
+
) {
|
|
1224
1396
|
newIndices[offset++] = rawIndex;
|
|
1225
1397
|
}
|
|
1226
1398
|
}
|
|
@@ -1231,7 +1403,8 @@ listProto.selectRange = function (range, stack) {
|
|
|
1231
1403
|
var rawIndex = this.getRawIndex(i);
|
|
1232
1404
|
for (var k = 0; k < dimSize; k++) {
|
|
1233
1405
|
var dimk = dimensions[k];
|
|
1234
|
-
var val =
|
|
1406
|
+
var val = this._getFast(dim, rawIndex);
|
|
1407
|
+
// Do not filter NaN, see comment above.
|
|
1235
1408
|
if (val < range[dimk][0] || val > range[dimk][1]) {
|
|
1236
1409
|
keep = false;
|
|
1237
1410
|
}
|
|
@@ -1260,24 +1433,26 @@ listProto.selectRange = function (range, stack) {
|
|
|
1260
1433
|
* Data mapping to a plain array
|
|
1261
1434
|
* @param {string|Array.<string>} [dimensions]
|
|
1262
1435
|
* @param {Function} cb
|
|
1263
|
-
* @param {boolean} [stack=false]
|
|
1264
1436
|
* @param {*} [context=this]
|
|
1265
1437
|
* @return {Array}
|
|
1266
1438
|
*/
|
|
1267
|
-
listProto.mapArray = function (dimensions, cb,
|
|
1439
|
+
listProto.mapArray = function (dimensions, cb, context, contextCompat) {
|
|
1268
1440
|
'use strict';
|
|
1269
1441
|
|
|
1270
1442
|
if (typeof dimensions === 'function') {
|
|
1271
|
-
|
|
1272
|
-
|
|
1443
|
+
contextCompat = context;
|
|
1444
|
+
context = cb;
|
|
1273
1445
|
cb = dimensions;
|
|
1274
1446
|
dimensions = [];
|
|
1275
1447
|
}
|
|
1276
1448
|
|
|
1449
|
+
// contextCompat just for compat echarts3
|
|
1450
|
+
context = context || contextCompat || this;
|
|
1451
|
+
|
|
1277
1452
|
var result = [];
|
|
1278
1453
|
this.each(dimensions, function () {
|
|
1279
1454
|
result.push(cb && cb.apply(this, arguments));
|
|
1280
|
-
},
|
|
1455
|
+
}, context);
|
|
1281
1456
|
return result;
|
|
1282
1457
|
};
|
|
1283
1458
|
|
|
@@ -1293,14 +1468,22 @@ function cloneListForMapAndSample(original, excludeDimensions) {
|
|
|
1293
1468
|
|
|
1294
1469
|
var storage = list._storage = {};
|
|
1295
1470
|
var originalStorage = original._storage;
|
|
1471
|
+
|
|
1296
1472
|
// Init storage
|
|
1297
1473
|
for (var i = 0; i < allDimensions.length; i++) {
|
|
1298
1474
|
var dim = allDimensions[i];
|
|
1299
1475
|
if (originalStorage[dim]) {
|
|
1300
|
-
|
|
1301
|
-
|
|
1476
|
+
// Notice that we do not reset invertedIndicesMap here, becuase
|
|
1477
|
+
// there is no scenario of mapping or sampling ordinal dimension.
|
|
1478
|
+
if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {
|
|
1479
|
+
storage[dim] = cloneDimStore(originalStorage[dim]);
|
|
1480
|
+
list._rawExtent[dim] = getInitialExtent();
|
|
1481
|
+
list._extent[dim] = null;
|
|
1482
|
+
}
|
|
1483
|
+
else {
|
|
1302
1484
|
// Direct reference for other dimensions
|
|
1303
|
-
|
|
1485
|
+
storage[dim] = originalStorage[dim];
|
|
1486
|
+
}
|
|
1304
1487
|
}
|
|
1305
1488
|
}
|
|
1306
1489
|
return list;
|
|
@@ -1314,17 +1497,23 @@ function cloneDimStore(originalDimStore) {
|
|
|
1314
1497
|
return newDimStore;
|
|
1315
1498
|
}
|
|
1316
1499
|
|
|
1500
|
+
function getInitialExtent() {
|
|
1501
|
+
return [Infinity, -Infinity];
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1317
1504
|
/**
|
|
1318
1505
|
* Data mapping to a new List with given dimensions
|
|
1319
1506
|
* @param {string|Array.<string>} dimensions
|
|
1320
1507
|
* @param {Function} cb
|
|
1321
|
-
* @param {boolean} [stack=false]
|
|
1322
1508
|
* @param {*} [context=this]
|
|
1323
1509
|
* @return {Array}
|
|
1324
1510
|
*/
|
|
1325
|
-
listProto.map = function (dimensions, cb,
|
|
1511
|
+
listProto.map = function (dimensions, cb, context, contextCompat) {
|
|
1326
1512
|
'use strict';
|
|
1327
1513
|
|
|
1514
|
+
// contextCompat just for compat echarts3
|
|
1515
|
+
context = context || contextCompat || this;
|
|
1516
|
+
|
|
1328
1517
|
dimensions = zrUtil.map(
|
|
1329
1518
|
normalizeDimensions(dimensions), this.getDimension, this
|
|
1330
1519
|
);
|
|
@@ -1347,10 +1536,11 @@ listProto.map = function (dimensions, cb, stack, context) {
|
|
|
1347
1536
|
var dimSize = dimensions.length;
|
|
1348
1537
|
var dataCount = this.count();
|
|
1349
1538
|
var values = [];
|
|
1539
|
+
var rawExtent = list._rawExtent;
|
|
1350
1540
|
|
|
1351
1541
|
for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {
|
|
1352
1542
|
for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {
|
|
1353
|
-
values[dimIndex] = this.get(dimensions[dimIndex], dataIndex
|
|
1543
|
+
values[dimIndex] = this.get(dimensions[dimIndex], dataIndex /*, stack */);
|
|
1354
1544
|
}
|
|
1355
1545
|
values[dimSize] = dataIndex;
|
|
1356
1546
|
|
|
@@ -1368,9 +1558,19 @@ listProto.map = function (dimensions, cb, stack, context) {
|
|
|
1368
1558
|
|
|
1369
1559
|
for (var i = 0; i < retValue.length; i++) {
|
|
1370
1560
|
var dim = dimensions[i];
|
|
1561
|
+
var val = retValue[i];
|
|
1562
|
+
var rawExtentOnDim = rawExtent[dim];
|
|
1563
|
+
|
|
1371
1564
|
var dimStore = storage[dim];
|
|
1372
1565
|
if (dimStore) {
|
|
1373
|
-
dimStore[chunkIndex][chunkOffset] =
|
|
1566
|
+
dimStore[chunkIndex][chunkOffset] = val;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
if (val < rawExtentOnDim[0]) {
|
|
1570
|
+
rawExtentOnDim[0] = val;
|
|
1571
|
+
}
|
|
1572
|
+
if (val > rawExtentOnDim[1]) {
|
|
1573
|
+
rawExtentOnDim[1] = val;
|
|
1374
1574
|
}
|
|
1375
1575
|
}
|
|
1376
1576
|
}
|
|
@@ -1396,6 +1596,7 @@ listProto.downSample = function (dimension, rate, sampleValue, sampleIndex) {
|
|
|
1396
1596
|
var dimStore = targetStorage[dimension];
|
|
1397
1597
|
var len = this.count();
|
|
1398
1598
|
var chunkSize = this._chunkSize;
|
|
1599
|
+
var rawExtentOnDim = list._rawExtent[dimension];
|
|
1399
1600
|
|
|
1400
1601
|
var newIndices = new (getIndicesCtor(this))(len);
|
|
1401
1602
|
|
|
@@ -1421,6 +1622,13 @@ listProto.downSample = function (dimension, rate, sampleValue, sampleIndex) {
|
|
|
1421
1622
|
// Only write value on the filtered data
|
|
1422
1623
|
dimStore[sampleChunkIndex][sampleChunkOffset] = value;
|
|
1423
1624
|
|
|
1625
|
+
if (value < rawExtentOnDim[0]) {
|
|
1626
|
+
rawExtentOnDim[0] = value;
|
|
1627
|
+
}
|
|
1628
|
+
if (value > rawExtentOnDim[1]) {
|
|
1629
|
+
rawExtentOnDim[1] = value;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1424
1632
|
newIndices[offset++] = sampleFrameIdx;
|
|
1425
1633
|
}
|
|
1426
1634
|
|
|
@@ -1676,9 +1884,6 @@ listProto.cloneShallow = function (list) {
|
|
|
1676
1884
|
}
|
|
1677
1885
|
list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;
|
|
1678
1886
|
|
|
1679
|
-
list._extent = zrUtil.clone(this._extent);
|
|
1680
|
-
list._approximateExtent = zrUtil.clone(this._approximateExtent);
|
|
1681
|
-
|
|
1682
1887
|
return list;
|
|
1683
1888
|
};
|
|
1684
1889
|
|