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/lib/data/List.js
CHANGED
|
@@ -19,29 +19,49 @@ var _dimensionHelper = require("./helper/dimensionHelper");
|
|
|
19
19
|
|
|
20
20
|
var summarizeDimensions = _dimensionHelper.summarizeDimensions;
|
|
21
21
|
|
|
22
|
+
/*
|
|
23
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
24
|
+
* or more contributor license agreements. See the NOTICE file
|
|
25
|
+
* distributed with this work for additional information
|
|
26
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
27
|
+
* to you under the Apache License, Version 2.0 (the
|
|
28
|
+
* "License"); you may not use this file except in compliance
|
|
29
|
+
* with the License. You may obtain a copy of the License at
|
|
30
|
+
*
|
|
31
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
32
|
+
*
|
|
33
|
+
* Unless required by applicable law or agreed to in writing,
|
|
34
|
+
* software distributed under the License is distributed on an
|
|
35
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
36
|
+
* KIND, either express or implied. See the License for the
|
|
37
|
+
* specific language governing permissions and limitations
|
|
38
|
+
* under the License.
|
|
39
|
+
*/
|
|
40
|
+
|
|
22
41
|
/**
|
|
23
42
|
* List for data storage
|
|
24
43
|
* @module echarts/data/List
|
|
25
44
|
*/
|
|
26
45
|
var isObject = zrUtil.isObject;
|
|
27
|
-
var UNDEFINED = 'undefined';
|
|
28
|
-
var globalObj = typeof window === UNDEFINED ? global : window; // Use prefix to avoid index to be the same as otherIdList[idx],
|
|
46
|
+
var UNDEFINED = 'undefined'; // Use prefix to avoid index to be the same as otherIdList[idx],
|
|
29
47
|
// which will cause weird udpate animation.
|
|
30
48
|
|
|
31
49
|
var ID_PREFIX = 'e\0\0';
|
|
32
50
|
var dataCtors = {
|
|
33
|
-
'float': typeof
|
|
34
|
-
'int': typeof
|
|
51
|
+
'float': typeof Float64Array === UNDEFINED ? Array : Float64Array,
|
|
52
|
+
'int': typeof Int32Array === UNDEFINED ? Array : Int32Array,
|
|
35
53
|
// Ordinal data type can be string or int
|
|
36
54
|
'ordinal': Array,
|
|
37
55
|
'number': Array,
|
|
38
56
|
'time': Array
|
|
39
|
-
};
|
|
57
|
+
}; // Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is
|
|
58
|
+
// different from the Ctor of typed array.
|
|
40
59
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var CtorUint16Array = typeof globalObj.Uint16Array === UNDEFINED ? Array : globalObj.Uint16Array; // The possible max value in this._indicies is always this._rawCount despite of filtering.
|
|
60
|
+
var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;
|
|
61
|
+
var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;
|
|
44
62
|
|
|
63
|
+
function getIndicesCtor(list) {
|
|
64
|
+
// The possible max value in this._indicies is always this._rawCount despite of filtering.
|
|
45
65
|
return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array;
|
|
46
66
|
}
|
|
47
67
|
|
|
@@ -51,15 +71,20 @@ function cloneChunk(originalChunk) {
|
|
|
51
71
|
return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);
|
|
52
72
|
}
|
|
53
73
|
|
|
54
|
-
var TRANSFERABLE_PROPERTIES = ['
|
|
74
|
+
var TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx'];
|
|
75
|
+
var CLONE_PROPERTIES = ['_extent', '_approximateExtent', '_rawExtent'];
|
|
55
76
|
|
|
56
|
-
function transferProperties(
|
|
57
|
-
zrUtil.each(TRANSFERABLE_PROPERTIES.concat(
|
|
58
|
-
if (
|
|
59
|
-
|
|
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];
|
|
60
81
|
}
|
|
61
82
|
});
|
|
62
|
-
|
|
83
|
+
target.__wrappedMethods = source.__wrappedMethods;
|
|
84
|
+
zrUtil.each(CLONE_PROPERTIES, function (propName) {
|
|
85
|
+
target[propName] = zrUtil.clone(source[propName]);
|
|
86
|
+
});
|
|
87
|
+
target._calculationInfo = zrUtil.extend(source._calculationInfo);
|
|
63
88
|
}
|
|
64
89
|
/**
|
|
65
90
|
* @constructor
|
|
@@ -70,6 +95,7 @@ function transferProperties(a, b) {
|
|
|
70
95
|
* Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
|
|
71
96
|
* Spetial fields: {
|
|
72
97
|
* ordinalMeta: <module:echarts/data/OrdinalMeta>
|
|
98
|
+
* createInvertedIndices: <boolean>
|
|
73
99
|
* }
|
|
74
100
|
* @param {module:echarts/model/Model} hostModel
|
|
75
101
|
*/
|
|
@@ -79,37 +105,34 @@ var List = function (dimensions, hostModel) {
|
|
|
79
105
|
dimensions = dimensions || ['x', 'y'];
|
|
80
106
|
var dimensionInfos = {};
|
|
81
107
|
var dimensionNames = [];
|
|
108
|
+
var invertedIndicesMap = {};
|
|
82
109
|
|
|
83
110
|
for (var i = 0; i < dimensions.length; i++) {
|
|
84
|
-
|
|
85
|
-
var dimensionInfo =
|
|
111
|
+
// Use the original dimensions[i], where other flag props may exists.
|
|
112
|
+
var dimensionInfo = dimensions[i];
|
|
86
113
|
|
|
87
|
-
if (
|
|
88
|
-
dimensionName = dimensions[i];
|
|
114
|
+
if (zrUtil.isString(dimensionInfo)) {
|
|
89
115
|
dimensionInfo = {
|
|
90
|
-
name:
|
|
91
|
-
coordDim: dimensionName,
|
|
92
|
-
coordDimIndex: 0,
|
|
93
|
-
stackable: false,
|
|
94
|
-
// Type can be 'float', 'int', 'number'
|
|
95
|
-
// Default is float64
|
|
96
|
-
type: 'float'
|
|
116
|
+
name: dimensionInfo
|
|
97
117
|
};
|
|
98
|
-
}
|
|
99
|
-
dimensionInfo = dimensions[i];
|
|
100
|
-
dimensionName = dimensionInfo.name;
|
|
101
|
-
dimensionInfo.type = dimensionInfo.type || 'float';
|
|
118
|
+
}
|
|
102
119
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
120
|
+
var dimensionName = dimensionInfo.name;
|
|
121
|
+
dimensionInfo.type = dimensionInfo.type || 'float';
|
|
122
|
+
|
|
123
|
+
if (!dimensionInfo.coordDim) {
|
|
124
|
+
dimensionInfo.coordDim = dimensionName;
|
|
125
|
+
dimensionInfo.coordDimIndex = 0;
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
dimensionInfo.otherDims = dimensionInfo.otherDims || {};
|
|
110
129
|
dimensionNames.push(dimensionName);
|
|
111
130
|
dimensionInfos[dimensionName] = dimensionInfo;
|
|
112
131
|
dimensionInfo.index = i;
|
|
132
|
+
|
|
133
|
+
if (dimensionInfo.createInvertedIndices) {
|
|
134
|
+
invertedIndicesMap[dimensionName] = [];
|
|
135
|
+
}
|
|
113
136
|
}
|
|
114
137
|
/**
|
|
115
138
|
* @readOnly
|
|
@@ -168,11 +191,6 @@ var List = function (dimensions, hostModel) {
|
|
|
168
191
|
*/
|
|
169
192
|
|
|
170
193
|
this._optionModels = [];
|
|
171
|
-
/**
|
|
172
|
-
* @param {module:echarts/data/List}
|
|
173
|
-
*/
|
|
174
|
-
|
|
175
|
-
this.stackedOn = null;
|
|
176
194
|
/**
|
|
177
195
|
* Global visual properties after visual coding
|
|
178
196
|
* @type {Object}
|
|
@@ -265,6 +283,18 @@ var List = function (dimensions, hostModel) {
|
|
|
265
283
|
*/
|
|
266
284
|
|
|
267
285
|
this._dimensionsSummary = summarizeDimensions(this);
|
|
286
|
+
/**
|
|
287
|
+
* @type {Object.<Array|TypedArray>}
|
|
288
|
+
* @private
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
this._invertedIndicesMap = invertedIndicesMap;
|
|
292
|
+
/**
|
|
293
|
+
* @type {Object}
|
|
294
|
+
* @private
|
|
295
|
+
*/
|
|
296
|
+
|
|
297
|
+
this._calculationInfo = {};
|
|
268
298
|
};
|
|
269
299
|
|
|
270
300
|
var listProto = List.prototype;
|
|
@@ -291,7 +321,7 @@ listProto.getDimension = function (dim) {
|
|
|
291
321
|
return dim;
|
|
292
322
|
};
|
|
293
323
|
/**
|
|
294
|
-
* Get type and
|
|
324
|
+
* Get type and calculation info of particular dimension
|
|
295
325
|
* @param {string|number} dim
|
|
296
326
|
* Dimension can be concrete names like x, y, z, lng, lat, angle, radius
|
|
297
327
|
* Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
|
|
@@ -312,17 +342,25 @@ listProto.getDimensionsOnCoord = function () {
|
|
|
312
342
|
};
|
|
313
343
|
/**
|
|
314
344
|
* @param {string} coordDim
|
|
315
|
-
* @param {number
|
|
345
|
+
* @param {number} [idx] A coordDim may map to more than one data dim.
|
|
316
346
|
* If idx is `true`, return a array of all mapped dims.
|
|
347
|
+
* If idx is not specified, return the first dim not extra.
|
|
317
348
|
* @return {string|Array.<string>} concrete data dim.
|
|
318
349
|
* If idx is number, and not found, return null/undefined.
|
|
319
|
-
* If idx is `true`, and not found, return empty array.
|
|
350
|
+
* If idx is `true`, and not found, return empty array (always return array).
|
|
320
351
|
*/
|
|
321
352
|
|
|
322
353
|
|
|
323
354
|
listProto.mapDimension = function (coordDim, idx) {
|
|
324
|
-
var
|
|
325
|
-
|
|
355
|
+
var dimensionsSummary = this._dimensionsSummary;
|
|
356
|
+
|
|
357
|
+
if (idx == null) {
|
|
358
|
+
return dimensionsSummary.encodeFirstDimNotExtra[coordDim];
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
var dims = dimensionsSummary.encode[coordDim];
|
|
362
|
+
return idx === true // always return array if idx is `true`
|
|
363
|
+
? (dims || []).slice() : dims && dims[idx];
|
|
326
364
|
};
|
|
327
365
|
/**
|
|
328
366
|
* Initialize from data
|
|
@@ -400,6 +438,7 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
400
438
|
var rawData = this._rawData;
|
|
401
439
|
var storage = this._storage;
|
|
402
440
|
var dimensions = this.dimensions;
|
|
441
|
+
var dimLen = dimensions.length;
|
|
403
442
|
var dimensionInfoMap = this._dimensionInfos;
|
|
404
443
|
var nameList = this._nameList;
|
|
405
444
|
var idList = this._idList;
|
|
@@ -409,11 +448,11 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
409
448
|
var chunkCount = this._chunkCount;
|
|
410
449
|
var lastChunkIndex = chunkCount - 1;
|
|
411
450
|
|
|
412
|
-
for (var i = 0; i <
|
|
451
|
+
for (var i = 0; i < dimLen; i++) {
|
|
413
452
|
var dim = dimensions[i];
|
|
414
453
|
|
|
415
454
|
if (!rawExtent[dim]) {
|
|
416
|
-
rawExtent[dim] =
|
|
455
|
+
rawExtent[dim] = getInitialExtent();
|
|
417
456
|
}
|
|
418
457
|
|
|
419
458
|
var dimInfo = dimensionInfoMap[dim];
|
|
@@ -453,9 +492,11 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
453
492
|
this._chunkCount = storage[dim].length;
|
|
454
493
|
}
|
|
455
494
|
|
|
495
|
+
var dataItem = new Array(dimLen);
|
|
496
|
+
|
|
456
497
|
for (var idx = start; idx < end; idx++) {
|
|
457
498
|
// NOTICE: Try not to write things into dataItem
|
|
458
|
-
|
|
499
|
+
dataItem = rawData.getItem(idx, dataItem); // Each data item is value
|
|
459
500
|
// [1, 2]
|
|
460
501
|
// 2
|
|
461
502
|
// Bar chart, line chart which uses category axis
|
|
@@ -465,20 +506,21 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
465
506
|
var chunkIndex = Math.floor(idx / chunkSize);
|
|
466
507
|
var chunkOffset = idx % chunkSize; // Store the data by dimensions
|
|
467
508
|
|
|
468
|
-
for (var k = 0; k <
|
|
509
|
+
for (var k = 0; k < dimLen; k++) {
|
|
469
510
|
var dim = dimensions[k];
|
|
470
511
|
var dimStorage = storage[dim][chunkIndex]; // PENDING NULL is empty or zero
|
|
471
512
|
|
|
472
513
|
var val = this._dimValueGetter(dataItem, dim, idx, k);
|
|
473
514
|
|
|
474
515
|
dimStorage[chunkOffset] = val;
|
|
516
|
+
var dimRawExtent = rawExtent[dim];
|
|
475
517
|
|
|
476
|
-
if (val <
|
|
477
|
-
|
|
518
|
+
if (val < dimRawExtent[0]) {
|
|
519
|
+
dimRawExtent[0] = val;
|
|
478
520
|
}
|
|
479
521
|
|
|
480
|
-
if (val >
|
|
481
|
-
|
|
522
|
+
if (val > dimRawExtent[1]) {
|
|
523
|
+
dimRawExtent[1] = val;
|
|
482
524
|
}
|
|
483
525
|
} // ??? FIXME not check by pure but sourceFormat?
|
|
484
526
|
// TODO refactor these logic.
|
|
@@ -487,13 +529,25 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
487
529
|
if (!rawData.pure) {
|
|
488
530
|
var name = nameList[idx];
|
|
489
531
|
|
|
490
|
-
if (dataItem &&
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
532
|
+
if (dataItem && name == null) {
|
|
533
|
+
// If dataItem is {name: ...}, it has highest priority.
|
|
534
|
+
// That is appropriate for many common cases.
|
|
535
|
+
if (dataItem.name != null) {
|
|
494
536
|
// There is no other place to persistent dataItem.name,
|
|
495
537
|
// so save it to nameList.
|
|
496
538
|
nameList[idx] = name = dataItem.name;
|
|
539
|
+
} else if (nameDimIdx != null) {
|
|
540
|
+
var nameDim = dimensions[nameDimIdx];
|
|
541
|
+
var nameDimChunk = storage[nameDim][chunkIndex];
|
|
542
|
+
|
|
543
|
+
if (nameDimChunk) {
|
|
544
|
+
name = nameDimChunk[chunkOffset];
|
|
545
|
+
var ordinalMeta = dimensionInfoMap[nameDim].ordinalMeta;
|
|
546
|
+
|
|
547
|
+
if (ordinalMeta && ordinalMeta.categories.length) {
|
|
548
|
+
name = ordinalMeta.categories[name];
|
|
549
|
+
}
|
|
550
|
+
}
|
|
497
551
|
}
|
|
498
552
|
} // Try using the id in option
|
|
499
553
|
// id or name is used on dynamical data, mapping old and new items.
|
|
@@ -525,47 +579,54 @@ listProto._initDataFromProvider = function (start, end) {
|
|
|
525
579
|
this._rawCount = this._count = end; // Reset data extent
|
|
526
580
|
|
|
527
581
|
this._extent = {};
|
|
528
|
-
|
|
529
|
-
|
|
582
|
+
prepareInvertedIndex(this);
|
|
583
|
+
};
|
|
530
584
|
|
|
531
|
-
|
|
532
|
-
var
|
|
585
|
+
function prepareInvertedIndex(list) {
|
|
586
|
+
var invertedIndicesMap = list._invertedIndicesMap;
|
|
587
|
+
zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {
|
|
588
|
+
var dimInfo = list._dimensionInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.
|
|
533
589
|
|
|
534
|
-
|
|
535
|
-
var chunkSize = this._chunkSize;
|
|
536
|
-
var chunkIndex = Math.floor(rawIndex / chunkSize);
|
|
537
|
-
var chunkOffset = rawIndex % chunkSize;
|
|
538
|
-
var dim = this.dimensions[nameDimIdx];
|
|
539
|
-
var ordinalMeta = this._dimensionInfos[dim].ordinalMeta;
|
|
590
|
+
var ordinalMeta = dimInfo.ordinalMeta;
|
|
540
591
|
|
|
541
592
|
if (ordinalMeta) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
var chunk = this._storage[dim][chunkIndex];
|
|
545
|
-
return chunk && chunk[chunkOffset];
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}; // TODO refactor
|
|
593
|
+
invertedIndices = invertedIndicesMap[dim] = new CtorUint32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss
|
|
594
|
+
// mapping to 0, we should set it as NaN.
|
|
549
595
|
|
|
596
|
+
for (var i = 0; i < invertedIndices.length; i++) {
|
|
597
|
+
invertedIndices[i] = NaN;
|
|
598
|
+
}
|
|
550
599
|
|
|
551
|
-
|
|
552
|
-
|
|
600
|
+
for (var i = 0; i < list._count; i++) {
|
|
601
|
+
// Only support the case that all values are distinct.
|
|
602
|
+
invertedIndices[list.get(dim, i)] = i;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
}
|
|
553
607
|
|
|
554
|
-
|
|
555
|
-
|
|
608
|
+
function getRawValueFromStore(list, dimIndex, rawIndex) {
|
|
609
|
+
var val;
|
|
610
|
+
|
|
611
|
+
if (dimIndex != null) {
|
|
612
|
+
var chunkSize = list._chunkSize;
|
|
556
613
|
var chunkIndex = Math.floor(rawIndex / chunkSize);
|
|
557
614
|
var chunkOffset = rawIndex % chunkSize;
|
|
558
|
-
var dim =
|
|
559
|
-
var
|
|
615
|
+
var dim = list.dimensions[dimIndex];
|
|
616
|
+
var chunk = list._storage[dim][chunkIndex];
|
|
560
617
|
|
|
561
|
-
if (
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
618
|
+
if (chunk) {
|
|
619
|
+
val = chunk[chunkOffset];
|
|
620
|
+
var ordinalMeta = list._dimensionInfos[dim].ordinalMeta;
|
|
621
|
+
|
|
622
|
+
if (ordinalMeta && ordinalMeta.categories.length) {
|
|
623
|
+
val = ordinalMeta.categories[val];
|
|
624
|
+
}
|
|
566
625
|
}
|
|
567
626
|
}
|
|
568
|
-
|
|
627
|
+
|
|
628
|
+
return val;
|
|
629
|
+
}
|
|
569
630
|
/**
|
|
570
631
|
* @return {number}
|
|
571
632
|
*/
|
|
@@ -576,19 +637,32 @@ listProto.count = function () {
|
|
|
576
637
|
};
|
|
577
638
|
|
|
578
639
|
listProto.getIndices = function () {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return new Ctor(this._indices.buffer, 0, this._count);
|
|
582
|
-
}
|
|
640
|
+
var newIndices;
|
|
641
|
+
var indices = this._indices;
|
|
583
642
|
|
|
584
|
-
|
|
585
|
-
|
|
643
|
+
if (indices) {
|
|
644
|
+
var Ctor = indices.constructor;
|
|
645
|
+
var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.
|
|
646
|
+
|
|
647
|
+
if (Ctor === Array) {
|
|
648
|
+
newIndices = new Ctor(thisCount);
|
|
586
649
|
|
|
587
|
-
|
|
588
|
-
|
|
650
|
+
for (var i = 0; i < thisCount; i++) {
|
|
651
|
+
newIndices[i] = indices[i];
|
|
652
|
+
}
|
|
653
|
+
} else {
|
|
654
|
+
newIndices = new Ctor(indices.buffer, 0, thisCount);
|
|
655
|
+
}
|
|
656
|
+
} else {
|
|
657
|
+
var Ctor = getIndicesCtor(this);
|
|
658
|
+
var newIndices = new Ctor(this.count());
|
|
659
|
+
|
|
660
|
+
for (var i = 0; i < newIndices.length; i++) {
|
|
661
|
+
newIndices[i] = i;
|
|
662
|
+
}
|
|
589
663
|
}
|
|
590
664
|
|
|
591
|
-
return
|
|
665
|
+
return newIndices;
|
|
592
666
|
};
|
|
593
667
|
/**
|
|
594
668
|
* Get value. Return NaN if idx is out of range.
|
|
@@ -599,7 +673,9 @@ listProto.getIndices = function () {
|
|
|
599
673
|
*/
|
|
600
674
|
|
|
601
675
|
|
|
602
|
-
listProto.get = function (dim, idx
|
|
676
|
+
listProto.get = function (dim, idx
|
|
677
|
+
/*, stack */
|
|
678
|
+
) {
|
|
603
679
|
if (!(idx >= 0 && idx < this._count)) {
|
|
604
680
|
return NaN;
|
|
605
681
|
}
|
|
@@ -616,31 +692,55 @@ listProto.get = function (dim, idx, stack) {
|
|
|
616
692
|
var chunkOffset = idx % this._chunkSize;
|
|
617
693
|
var chunkStore = storage[dim][chunkIndex];
|
|
618
694
|
var value = chunkStore[chunkOffset]; // FIXME ordinal data type is not stackable
|
|
695
|
+
// if (stack) {
|
|
696
|
+
// var dimensionInfo = this._dimensionInfos[dim];
|
|
697
|
+
// if (dimensionInfo && dimensionInfo.stackable) {
|
|
698
|
+
// var stackedOn = this.stackedOn;
|
|
699
|
+
// while (stackedOn) {
|
|
700
|
+
// // Get no stacked data of stacked on
|
|
701
|
+
// var stackedValue = stackedOn.get(dim, idx);
|
|
702
|
+
// // Considering positive stack, negative stack and empty data
|
|
703
|
+
// if ((value >= 0 && stackedValue > 0) // Positive stack
|
|
704
|
+
// || (value <= 0 && stackedValue < 0) // Negative stack
|
|
705
|
+
// ) {
|
|
706
|
+
// value += stackedValue;
|
|
707
|
+
// }
|
|
708
|
+
// stackedOn = stackedOn.stackedOn;
|
|
709
|
+
// }
|
|
710
|
+
// }
|
|
711
|
+
// }
|
|
619
712
|
|
|
620
|
-
|
|
621
|
-
|
|
713
|
+
return value;
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* @param {string} dim concrete dim
|
|
717
|
+
* @param {number} rawIndex
|
|
718
|
+
* @return {number|string}
|
|
719
|
+
*/
|
|
622
720
|
|
|
623
|
-
if (dimensionInfo && dimensionInfo.stackable) {
|
|
624
|
-
var stackedOn = this.stackedOn;
|
|
625
721
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
722
|
+
listProto.getByRawIndex = function (dim, rawIdx) {
|
|
723
|
+
if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {
|
|
724
|
+
return NaN;
|
|
725
|
+
}
|
|
629
726
|
|
|
630
|
-
|
|
631
|
-
value <= 0 && stackedValue < 0 // Negative stack
|
|
632
|
-
) {
|
|
633
|
-
value += stackedValue;
|
|
634
|
-
}
|
|
727
|
+
var dimStore = this._storage[dim];
|
|
635
728
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
729
|
+
if (!dimStore) {
|
|
730
|
+
// TODO Warn ?
|
|
731
|
+
return NaN;
|
|
639
732
|
}
|
|
640
733
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
734
|
+
var chunkIndex = Math.floor(rawIdx / this._chunkSize);
|
|
735
|
+
var chunkOffset = rawIdx % this._chunkSize;
|
|
736
|
+
var chunkStore = dimStore[chunkIndex];
|
|
737
|
+
return chunkStore[chunkOffset];
|
|
738
|
+
};
|
|
739
|
+
/**
|
|
740
|
+
* FIXME Use `get` on chrome maybe slow(in filterSelf and selectRange).
|
|
741
|
+
* Hack a much simpler _getFast
|
|
742
|
+
* @private
|
|
743
|
+
*/
|
|
644
744
|
|
|
645
745
|
|
|
646
746
|
listProto._getFast = function (dim, rawIdx) {
|
|
@@ -653,22 +753,25 @@ listProto._getFast = function (dim, rawIdx) {
|
|
|
653
753
|
* Get value for multi dimensions.
|
|
654
754
|
* @param {Array.<string>} [dimensions] If ignored, using all dimensions.
|
|
655
755
|
* @param {number} idx
|
|
656
|
-
* @param {boolean} stack
|
|
657
756
|
* @return {number}
|
|
658
757
|
*/
|
|
659
758
|
|
|
660
759
|
|
|
661
|
-
listProto.getValues = function (dimensions, idx
|
|
760
|
+
listProto.getValues = function (dimensions, idx
|
|
761
|
+
/*, stack */
|
|
762
|
+
) {
|
|
662
763
|
var values = [];
|
|
663
764
|
|
|
664
765
|
if (!zrUtil.isArray(dimensions)) {
|
|
665
|
-
stack = idx;
|
|
766
|
+
// stack = idx;
|
|
666
767
|
idx = dimensions;
|
|
667
768
|
dimensions = this.dimensions;
|
|
668
769
|
}
|
|
669
770
|
|
|
670
771
|
for (var i = 0, len = dimensions.length; i < len; i++) {
|
|
671
|
-
values.push(this.get(dimensions[i], idx
|
|
772
|
+
values.push(this.get(dimensions[i], idx
|
|
773
|
+
/*, stack */
|
|
774
|
+
));
|
|
672
775
|
}
|
|
673
776
|
|
|
674
777
|
return values;
|
|
@@ -703,31 +806,34 @@ listProto.hasValue = function (idx) {
|
|
|
703
806
|
*/
|
|
704
807
|
|
|
705
808
|
|
|
706
|
-
listProto.getDataExtent = function (dim
|
|
809
|
+
listProto.getDataExtent = function (dim
|
|
810
|
+
/*, stack */
|
|
811
|
+
) {
|
|
707
812
|
// Make sure use concrete dim as cache name.
|
|
708
813
|
dim = this.getDimension(dim);
|
|
709
814
|
var dimData = this._storage[dim];
|
|
710
|
-
var initialExtent =
|
|
711
|
-
stack = (stack || false) && this.isStacked(dim);
|
|
815
|
+
var initialExtent = getInitialExtent(); // stack = !!((stack || false) && this.getCalculationInfo(dim));
|
|
712
816
|
|
|
713
817
|
if (!dimData) {
|
|
714
818
|
return initialExtent;
|
|
715
819
|
} // Make more strict checkings to ensure hitting cache.
|
|
716
820
|
|
|
717
821
|
|
|
718
|
-
var currEnd = this.count();
|
|
719
|
-
var cacheName =
|
|
822
|
+
var currEnd = this.count(); // var cacheName = [dim, !!stack].join('_');
|
|
823
|
+
// var cacheName = dim;
|
|
824
|
+
// Consider the most cases when using data zoom, `getDataExtent`
|
|
720
825
|
// happened before filtering. We cache raw extent, which is not
|
|
721
826
|
// necessary to be cleared and recalculated when restore data.
|
|
722
827
|
|
|
723
|
-
var useRaw = !this._indices && !stack;
|
|
828
|
+
var useRaw = !this._indices; // && !stack;
|
|
829
|
+
|
|
724
830
|
var dimExtent;
|
|
725
831
|
|
|
726
832
|
if (useRaw) {
|
|
727
833
|
return this._rawExtent[dim].slice();
|
|
728
834
|
}
|
|
729
835
|
|
|
730
|
-
dimExtent = this._extent[
|
|
836
|
+
dimExtent = this._extent[dim];
|
|
731
837
|
|
|
732
838
|
if (dimExtent) {
|
|
733
839
|
return dimExtent.slice();
|
|
@@ -738,13 +844,15 @@ listProto.getDataExtent = function (dim, stack) {
|
|
|
738
844
|
var max = dimExtent[1];
|
|
739
845
|
|
|
740
846
|
for (var i = 0; i < currEnd; i++) {
|
|
741
|
-
var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i));
|
|
847
|
+
// var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i));
|
|
848
|
+
var value = this._getFast(dim, this.getRawIndex(i));
|
|
849
|
+
|
|
742
850
|
value < min && (min = value);
|
|
743
851
|
value > max && (max = value);
|
|
744
852
|
}
|
|
745
853
|
|
|
746
854
|
dimExtent = [min, max];
|
|
747
|
-
this._extent[
|
|
855
|
+
this._extent[dim] = dimExtent;
|
|
748
856
|
return dimExtent;
|
|
749
857
|
};
|
|
750
858
|
/**
|
|
@@ -755,34 +863,56 @@ listProto.getDataExtent = function (dim, stack) {
|
|
|
755
863
|
*/
|
|
756
864
|
|
|
757
865
|
|
|
758
|
-
listProto.getApproximateExtent = function (dim
|
|
866
|
+
listProto.getApproximateExtent = function (dim
|
|
867
|
+
/*, stack */
|
|
868
|
+
) {
|
|
759
869
|
dim = this.getDimension(dim);
|
|
760
|
-
return this._approximateExtent[dim] || this.getDataExtent(dim
|
|
870
|
+
return this._approximateExtent[dim] || this.getDataExtent(dim
|
|
871
|
+
/*, stack */
|
|
872
|
+
);
|
|
761
873
|
};
|
|
762
874
|
|
|
763
|
-
listProto.setApproximateExtent = function (extent, dim
|
|
875
|
+
listProto.setApproximateExtent = function (extent, dim
|
|
876
|
+
/*, stack */
|
|
877
|
+
) {
|
|
764
878
|
dim = this.getDimension(dim);
|
|
765
879
|
this._approximateExtent[dim] = extent.slice();
|
|
766
880
|
};
|
|
881
|
+
/**
|
|
882
|
+
* @param {string} key
|
|
883
|
+
* @return {*}
|
|
884
|
+
*/
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
listProto.getCalculationInfo = function (key) {
|
|
888
|
+
return this._calculationInfo[key];
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* @param {string|Object} key or k-v object
|
|
892
|
+
* @param {*} [value]
|
|
893
|
+
*/
|
|
894
|
+
|
|
767
895
|
|
|
768
|
-
listProto.
|
|
769
|
-
|
|
770
|
-
return dimensionInfo && dimensionInfo.stackable && this.stackedOn;
|
|
896
|
+
listProto.setCalculationInfo = function (key, value) {
|
|
897
|
+
isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;
|
|
771
898
|
};
|
|
772
899
|
/**
|
|
773
900
|
* Get sum of data in one dimension
|
|
774
901
|
* @param {string} dim
|
|
775
|
-
* @param {boolean} stack
|
|
776
902
|
*/
|
|
777
903
|
|
|
778
904
|
|
|
779
|
-
listProto.getSum = function (dim
|
|
905
|
+
listProto.getSum = function (dim
|
|
906
|
+
/*, stack */
|
|
907
|
+
) {
|
|
780
908
|
var dimData = this._storage[dim];
|
|
781
909
|
var sum = 0;
|
|
782
910
|
|
|
783
911
|
if (dimData) {
|
|
784
912
|
for (var i = 0, len = this.count(); i < len; i++) {
|
|
785
|
-
var value = this.get(dim, i
|
|
913
|
+
var value = this.get(dim, i
|
|
914
|
+
/*, stack */
|
|
915
|
+
);
|
|
786
916
|
|
|
787
917
|
if (!isNaN(value)) {
|
|
788
918
|
sum += value;
|
|
@@ -793,31 +923,73 @@ listProto.getSum = function (dim, stack) {
|
|
|
793
923
|
return sum;
|
|
794
924
|
};
|
|
795
925
|
/**
|
|
796
|
-
*
|
|
797
|
-
* @param {
|
|
798
|
-
* @param {number} value
|
|
799
|
-
* @return {number}
|
|
926
|
+
* Get median of data in one dimension
|
|
927
|
+
* @param {string} dim
|
|
800
928
|
*/
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
listProto.getMedian = function (dim
|
|
932
|
+
/*, stack */
|
|
933
|
+
) {
|
|
934
|
+
var dimDataArray = []; // map all data of one dimension
|
|
935
|
+
|
|
936
|
+
this.each(dim, function (val, idx) {
|
|
937
|
+
if (!isNaN(val)) {
|
|
938
|
+
dimDataArray.push(val);
|
|
939
|
+
}
|
|
940
|
+
}); // TODO
|
|
941
|
+
// Use quick select?
|
|
942
|
+
// immutability & sort
|
|
943
|
+
|
|
944
|
+
var sortedDimDataArray = [].concat(dimDataArray).sort(function (a, b) {
|
|
945
|
+
return a - b;
|
|
946
|
+
});
|
|
947
|
+
var len = this.count(); // calculate median
|
|
948
|
+
|
|
949
|
+
return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;
|
|
950
|
+
}; // /**
|
|
951
|
+
// * Retreive the index with given value
|
|
952
|
+
// * @param {string} dim Concrete dimension.
|
|
953
|
+
// * @param {number} value
|
|
954
|
+
// * @return {number}
|
|
955
|
+
// */
|
|
956
|
+
// Currently incorrect: should return dataIndex but not rawIndex.
|
|
957
|
+
// Do not fix it until this method is to be used somewhere.
|
|
801
958
|
// FIXME Precision of float value
|
|
959
|
+
// listProto.indexOf = function (dim, value) {
|
|
960
|
+
// var storage = this._storage;
|
|
961
|
+
// var dimData = storage[dim];
|
|
962
|
+
// var chunkSize = this._chunkSize;
|
|
963
|
+
// if (dimData) {
|
|
964
|
+
// for (var i = 0, len = this.count(); i < len; i++) {
|
|
965
|
+
// var chunkIndex = Math.floor(i / chunkSize);
|
|
966
|
+
// var chunkOffset = i % chunkSize;
|
|
967
|
+
// if (dimData[chunkIndex][chunkOffset] === value) {
|
|
968
|
+
// return i;
|
|
969
|
+
// }
|
|
970
|
+
// }
|
|
971
|
+
// }
|
|
972
|
+
// return -1;
|
|
973
|
+
// };
|
|
802
974
|
|
|
975
|
+
/**
|
|
976
|
+
* Only support the dimension which inverted index created.
|
|
977
|
+
* Do not support other cases until required.
|
|
978
|
+
* @param {string} concrete dim
|
|
979
|
+
* @param {number|string} value
|
|
980
|
+
* @return {number} rawIndex
|
|
981
|
+
*/
|
|
803
982
|
|
|
804
|
-
listProto.indexOf = function (dim, value) {
|
|
805
|
-
var storage = this._storage;
|
|
806
|
-
var dimData = storage[dim];
|
|
807
|
-
var chunkSize = this._chunkSize;
|
|
808
983
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
var chunkOffset = i % chunkSize;
|
|
984
|
+
listProto.rawIndexOf = function (dim, value) {
|
|
985
|
+
var invertedIndices = dim && this._invertedIndicesMap[dim];
|
|
986
|
+
var rawIndex = invertedIndices[value];
|
|
813
987
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
}
|
|
988
|
+
if (rawIndex == null || isNaN(rawIndex)) {
|
|
989
|
+
return -1;
|
|
818
990
|
}
|
|
819
991
|
|
|
820
|
-
return
|
|
992
|
+
return rawIndex;
|
|
821
993
|
};
|
|
822
994
|
/**
|
|
823
995
|
* Retreive the index with given name
|
|
@@ -883,13 +1055,12 @@ listProto.indexOfRawIndex = function (rawIndex) {
|
|
|
883
1055
|
* Retreive the index of nearest value
|
|
884
1056
|
* @param {string} dim
|
|
885
1057
|
* @param {number} value
|
|
886
|
-
* @param {boolean} stack If given value is after stacked
|
|
887
1058
|
* @param {number} [maxDistance=Infinity]
|
|
888
1059
|
* @return {Array.<number>} Considere multiple points has the same value.
|
|
889
1060
|
*/
|
|
890
1061
|
|
|
891
1062
|
|
|
892
|
-
listProto.indicesOfNearest = function (dim, value,
|
|
1063
|
+
listProto.indicesOfNearest = function (dim, value, maxDistance) {
|
|
893
1064
|
var storage = this._storage;
|
|
894
1065
|
var dimData = storage[dim];
|
|
895
1066
|
var nearestIndices = [];
|
|
@@ -906,7 +1077,9 @@ listProto.indicesOfNearest = function (dim, value, stack, maxDistance) {
|
|
|
906
1077
|
var minDiff = -1;
|
|
907
1078
|
|
|
908
1079
|
for (var i = 0, len = this.count(); i < len; i++) {
|
|
909
|
-
var diff = value - this.get(dim, i
|
|
1080
|
+
var diff = value - this.get(dim, i
|
|
1081
|
+
/*, stack */
|
|
1082
|
+
);
|
|
910
1083
|
var dist = Math.abs(diff);
|
|
911
1084
|
|
|
912
1085
|
if (diff <= maxDistance && dist <= minDist) {
|
|
@@ -975,7 +1148,7 @@ listProto.getRawDataItem = function (idx) {
|
|
|
975
1148
|
|
|
976
1149
|
listProto.getName = function (idx) {
|
|
977
1150
|
var rawIndex = this.getRawIndex(idx);
|
|
978
|
-
return this._nameList[rawIndex] || this.
|
|
1151
|
+
return this._nameList[rawIndex] || getRawValueFromStore(this, this._nameDimIdx, rawIndex) || '';
|
|
979
1152
|
};
|
|
980
1153
|
/**
|
|
981
1154
|
* @param {number} idx
|
|
@@ -992,7 +1165,7 @@ function getId(list, rawIndex) {
|
|
|
992
1165
|
var id = list._idList[rawIndex];
|
|
993
1166
|
|
|
994
1167
|
if (id == null) {
|
|
995
|
-
id = list.
|
|
1168
|
+
id = getRawValueFromStore(list, list._idDimIdx, rawIndex);
|
|
996
1169
|
}
|
|
997
1170
|
|
|
998
1171
|
if (id == null) {
|
|
@@ -1024,7 +1197,6 @@ function validateDimensions(list, dims) {
|
|
|
1024
1197
|
* Data iteration
|
|
1025
1198
|
* @param {string|Array.<string>}
|
|
1026
1199
|
* @param {Function} cb
|
|
1027
|
-
* @param {boolean} [stack=false]
|
|
1028
1200
|
* @param {*} [context=this]
|
|
1029
1201
|
*
|
|
1030
1202
|
* @example
|
|
@@ -1034,7 +1206,7 @@ function validateDimensions(list, dims) {
|
|
|
1034
1206
|
*/
|
|
1035
1207
|
|
|
1036
1208
|
|
|
1037
|
-
listProto.each = function (dims, cb,
|
|
1209
|
+
listProto.each = function (dims, cb, context, contextCompat) {
|
|
1038
1210
|
'use strict';
|
|
1039
1211
|
|
|
1040
1212
|
if (!this._count) {
|
|
@@ -1042,15 +1214,16 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1042
1214
|
}
|
|
1043
1215
|
|
|
1044
1216
|
if (typeof dims === 'function') {
|
|
1045
|
-
|
|
1046
|
-
|
|
1217
|
+
contextCompat = context;
|
|
1218
|
+
context = cb;
|
|
1047
1219
|
cb = dims;
|
|
1048
1220
|
dims = [];
|
|
1049
|
-
}
|
|
1221
|
+
} // contextCompat just for compat echarts3
|
|
1222
|
+
|
|
1050
1223
|
|
|
1224
|
+
context = context || contextCompat || this;
|
|
1051
1225
|
dims = zrUtil.map(normalizeDimensions(dims), this.getDimension, this);
|
|
1052
1226
|
var dimSize = dims.length;
|
|
1053
|
-
context = context || this;
|
|
1054
1227
|
|
|
1055
1228
|
for (var i = 0; i < this.count(); i++) {
|
|
1056
1229
|
// Simple optimization
|
|
@@ -1060,11 +1233,11 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1060
1233
|
break;
|
|
1061
1234
|
|
|
1062
1235
|
case 1:
|
|
1063
|
-
cb.call(context, this.get(dims[0], i
|
|
1236
|
+
cb.call(context, this.get(dims[0], i), i);
|
|
1064
1237
|
break;
|
|
1065
1238
|
|
|
1066
1239
|
case 2:
|
|
1067
|
-
cb.call(context, this.get(dims[0], i
|
|
1240
|
+
cb.call(context, this.get(dims[0], i), this.get(dims[1], i), i);
|
|
1068
1241
|
break;
|
|
1069
1242
|
|
|
1070
1243
|
default:
|
|
@@ -1072,7 +1245,7 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1072
1245
|
var value = [];
|
|
1073
1246
|
|
|
1074
1247
|
for (; k < dimSize; k++) {
|
|
1075
|
-
value[k] = this.get(dims[k], i
|
|
1248
|
+
value[k] = this.get(dims[k], i);
|
|
1076
1249
|
} // Index
|
|
1077
1250
|
|
|
1078
1251
|
|
|
@@ -1085,12 +1258,11 @@ listProto.each = function (dims, cb, stack, context) {
|
|
|
1085
1258
|
* Data filter
|
|
1086
1259
|
* @param {string|Array.<string>}
|
|
1087
1260
|
* @param {Function} cb
|
|
1088
|
-
* @param {boolean} [stack=false]
|
|
1089
1261
|
* @param {*} [context=this]
|
|
1090
1262
|
*/
|
|
1091
1263
|
|
|
1092
1264
|
|
|
1093
|
-
listProto.filterSelf = function (dimensions, cb,
|
|
1265
|
+
listProto.filterSelf = function (dimensions, cb, context, contextCompat) {
|
|
1094
1266
|
'use strict';
|
|
1095
1267
|
|
|
1096
1268
|
if (!this._count) {
|
|
@@ -1098,14 +1270,14 @@ listProto.filterSelf = function (dimensions, cb, stack, context) {
|
|
|
1098
1270
|
}
|
|
1099
1271
|
|
|
1100
1272
|
if (typeof dimensions === 'function') {
|
|
1101
|
-
|
|
1102
|
-
|
|
1273
|
+
contextCompat = context;
|
|
1274
|
+
context = cb;
|
|
1103
1275
|
cb = dimensions;
|
|
1104
1276
|
dimensions = [];
|
|
1105
|
-
}
|
|
1277
|
+
} // contextCompat just for compat echarts3
|
|
1106
1278
|
|
|
1107
|
-
|
|
1108
|
-
context = context || this;
|
|
1279
|
+
|
|
1280
|
+
context = context || contextCompat || this;
|
|
1109
1281
|
dimensions = zrUtil.map(normalizeDimensions(dimensions), this.getDimension, this);
|
|
1110
1282
|
var count = this.count();
|
|
1111
1283
|
var Ctor = getIndicesCtor(this);
|
|
@@ -1122,11 +1294,12 @@ listProto.filterSelf = function (dimensions, cb, stack, context) {
|
|
|
1122
1294
|
if (dimSize === 0) {
|
|
1123
1295
|
keep = cb.call(context, i);
|
|
1124
1296
|
} else if (dimSize === 1) {
|
|
1125
|
-
var val =
|
|
1297
|
+
var val = this._getFast(dim0, rawIdx);
|
|
1298
|
+
|
|
1126
1299
|
keep = cb.call(context, val, i);
|
|
1127
1300
|
} else {
|
|
1128
1301
|
for (var k = 0; k < dimSize; k++) {
|
|
1129
|
-
value[k] =
|
|
1302
|
+
value[k] = this._getFast(dim0, rawIdx);
|
|
1130
1303
|
}
|
|
1131
1304
|
|
|
1132
1305
|
value[k] = i;
|
|
@@ -1155,14 +1328,13 @@ listProto.filterSelf = function (dimensions, cb, stack, context) {
|
|
|
1155
1328
|
*/
|
|
1156
1329
|
|
|
1157
1330
|
|
|
1158
|
-
listProto.selectRange = function (range
|
|
1331
|
+
listProto.selectRange = function (range) {
|
|
1159
1332
|
'use strict';
|
|
1160
1333
|
|
|
1161
1334
|
if (!this._count) {
|
|
1162
1335
|
return;
|
|
1163
1336
|
}
|
|
1164
1337
|
|
|
1165
|
-
stack = stack || false;
|
|
1166
1338
|
var dimensions = [];
|
|
1167
1339
|
|
|
1168
1340
|
for (var dim in range) {
|
|
@@ -1186,7 +1358,7 @@ listProto.selectRange = function (range, stack) {
|
|
|
1186
1358
|
var max = range[dim0][1];
|
|
1187
1359
|
var quickFinished = false;
|
|
1188
1360
|
|
|
1189
|
-
if (!this._indices
|
|
1361
|
+
if (!this._indices) {
|
|
1190
1362
|
// Extreme optimization for common case. About 2x faster in chrome.
|
|
1191
1363
|
var idx = 0;
|
|
1192
1364
|
|
|
@@ -1198,9 +1370,13 @@ listProto.selectRange = function (range, stack) {
|
|
|
1198
1370
|
var len = Math.min(this._count - k * this._chunkSize, this._chunkSize);
|
|
1199
1371
|
|
|
1200
1372
|
for (var i = 0; i < len; i++) {
|
|
1201
|
-
var val = chunkStorage[i];
|
|
1373
|
+
var val = chunkStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty
|
|
1374
|
+
// value indicates the line should be broken. But for the case like
|
|
1375
|
+
// scatter plot, a data item with empty value will not be rendered,
|
|
1376
|
+
// but the axis extent may be effected if some other dim of the data
|
|
1377
|
+
// item has value. Fortunately it is not a significant negative effect.
|
|
1202
1378
|
|
|
1203
|
-
if (val >= min && val <= max) {
|
|
1379
|
+
if (val >= min && val <= max || isNaN(val)) {
|
|
1204
1380
|
newIndices[offset++] = idx;
|
|
1205
1381
|
}
|
|
1206
1382
|
|
|
@@ -1222,9 +1398,9 @@ listProto.selectRange = function (range, stack) {
|
|
|
1222
1398
|
|
|
1223
1399
|
for (var i = 0; i < len; i++) {
|
|
1224
1400
|
var val = chunkStorage[i];
|
|
1225
|
-
var val2 = chunkStorage2[i];
|
|
1401
|
+
var val2 = chunkStorage2[i]; // Do not filter NaN, see comment above.
|
|
1226
1402
|
|
|
1227
|
-
if (val >= min && val <= max && val2 >= min2 && val2 <= max2) {
|
|
1403
|
+
if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {
|
|
1228
1404
|
newIndices[offset++] = idx;
|
|
1229
1405
|
}
|
|
1230
1406
|
|
|
@@ -1238,13 +1414,13 @@ listProto.selectRange = function (range, stack) {
|
|
|
1238
1414
|
|
|
1239
1415
|
if (!quickFinished) {
|
|
1240
1416
|
if (dimSize === 1) {
|
|
1241
|
-
stack = stack || this.isStacked(dim0);
|
|
1242
|
-
|
|
1243
1417
|
for (var i = 0; i < originalCount; i++) {
|
|
1244
1418
|
var rawIndex = this.getRawIndex(i);
|
|
1245
|
-
var val = stack ? this.get(dim0, i, true) : this._getFast(dim0, rawIndex);
|
|
1246
1419
|
|
|
1247
|
-
|
|
1420
|
+
var val = this._getFast(dim0, rawIndex); // Do not filter NaN, see comment above.
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
if (val >= min && val <= max || isNaN(val)) {
|
|
1248
1424
|
newIndices[offset++] = rawIndex;
|
|
1249
1425
|
}
|
|
1250
1426
|
}
|
|
@@ -1255,7 +1431,9 @@ listProto.selectRange = function (range, stack) {
|
|
|
1255
1431
|
|
|
1256
1432
|
for (var k = 0; k < dimSize; k++) {
|
|
1257
1433
|
var dimk = dimensions[k];
|
|
1258
|
-
|
|
1434
|
+
|
|
1435
|
+
var val = this._getFast(dim, rawIndex); // Do not filter NaN, see comment above.
|
|
1436
|
+
|
|
1259
1437
|
|
|
1260
1438
|
if (val < range[dimk][0] || val > range[dimk][1]) {
|
|
1261
1439
|
keep = false;
|
|
@@ -1284,26 +1462,27 @@ listProto.selectRange = function (range, stack) {
|
|
|
1284
1462
|
* Data mapping to a plain array
|
|
1285
1463
|
* @param {string|Array.<string>} [dimensions]
|
|
1286
1464
|
* @param {Function} cb
|
|
1287
|
-
* @param {boolean} [stack=false]
|
|
1288
1465
|
* @param {*} [context=this]
|
|
1289
1466
|
* @return {Array}
|
|
1290
1467
|
*/
|
|
1291
1468
|
|
|
1292
1469
|
|
|
1293
|
-
listProto.mapArray = function (dimensions, cb,
|
|
1470
|
+
listProto.mapArray = function (dimensions, cb, context, contextCompat) {
|
|
1294
1471
|
'use strict';
|
|
1295
1472
|
|
|
1296
1473
|
if (typeof dimensions === 'function') {
|
|
1297
|
-
|
|
1298
|
-
|
|
1474
|
+
contextCompat = context;
|
|
1475
|
+
context = cb;
|
|
1299
1476
|
cb = dimensions;
|
|
1300
1477
|
dimensions = [];
|
|
1301
|
-
}
|
|
1478
|
+
} // contextCompat just for compat echarts3
|
|
1479
|
+
|
|
1302
1480
|
|
|
1481
|
+
context = context || contextCompat || this;
|
|
1303
1482
|
var result = [];
|
|
1304
1483
|
this.each(dimensions, function () {
|
|
1305
1484
|
result.push(cb && cb.apply(this, arguments));
|
|
1306
|
-
},
|
|
1485
|
+
}, context);
|
|
1307
1486
|
return result;
|
|
1308
1487
|
}; // Data in excludeDimensions is copied, otherwise transfered.
|
|
1309
1488
|
|
|
@@ -1320,8 +1499,16 @@ function cloneListForMapAndSample(original, excludeDimensions) {
|
|
|
1320
1499
|
var dim = allDimensions[i];
|
|
1321
1500
|
|
|
1322
1501
|
if (originalStorage[dim]) {
|
|
1323
|
-
|
|
1324
|
-
|
|
1502
|
+
// Notice that we do not reset invertedIndicesMap here, becuase
|
|
1503
|
+
// there is no scenario of mapping or sampling ordinal dimension.
|
|
1504
|
+
if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {
|
|
1505
|
+
storage[dim] = cloneDimStore(originalStorage[dim]);
|
|
1506
|
+
list._rawExtent[dim] = getInitialExtent();
|
|
1507
|
+
list._extent[dim] = null;
|
|
1508
|
+
} else {
|
|
1509
|
+
// Direct reference for other dimensions
|
|
1510
|
+
storage[dim] = originalStorage[dim];
|
|
1511
|
+
}
|
|
1325
1512
|
}
|
|
1326
1513
|
}
|
|
1327
1514
|
|
|
@@ -1337,19 +1524,23 @@ function cloneDimStore(originalDimStore) {
|
|
|
1337
1524
|
|
|
1338
1525
|
return newDimStore;
|
|
1339
1526
|
}
|
|
1527
|
+
|
|
1528
|
+
function getInitialExtent() {
|
|
1529
|
+
return [Infinity, -Infinity];
|
|
1530
|
+
}
|
|
1340
1531
|
/**
|
|
1341
1532
|
* Data mapping to a new List with given dimensions
|
|
1342
1533
|
* @param {string|Array.<string>} dimensions
|
|
1343
1534
|
* @param {Function} cb
|
|
1344
|
-
* @param {boolean} [stack=false]
|
|
1345
1535
|
* @param {*} [context=this]
|
|
1346
1536
|
* @return {Array}
|
|
1347
1537
|
*/
|
|
1348
1538
|
|
|
1349
1539
|
|
|
1350
|
-
listProto.map = function (dimensions, cb,
|
|
1351
|
-
'use strict';
|
|
1540
|
+
listProto.map = function (dimensions, cb, context, contextCompat) {
|
|
1541
|
+
'use strict'; // contextCompat just for compat echarts3
|
|
1352
1542
|
|
|
1543
|
+
context = context || contextCompat || this;
|
|
1353
1544
|
dimensions = zrUtil.map(normalizeDimensions(dimensions), this.getDimension, this);
|
|
1354
1545
|
var list = cloneListForMapAndSample(this, dimensions); // Following properties are all immutable.
|
|
1355
1546
|
// So we can reference to the same value
|
|
@@ -1362,10 +1553,13 @@ listProto.map = function (dimensions, cb, stack, context) {
|
|
|
1362
1553
|
var dimSize = dimensions.length;
|
|
1363
1554
|
var dataCount = this.count();
|
|
1364
1555
|
var values = [];
|
|
1556
|
+
var rawExtent = list._rawExtent;
|
|
1365
1557
|
|
|
1366
1558
|
for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {
|
|
1367
1559
|
for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) {
|
|
1368
|
-
values[dimIndex] = this.get(dimensions[dimIndex], dataIndex
|
|
1560
|
+
values[dimIndex] = this.get(dimensions[dimIndex], dataIndex
|
|
1561
|
+
/*, stack */
|
|
1562
|
+
);
|
|
1369
1563
|
}
|
|
1370
1564
|
|
|
1371
1565
|
values[dimSize] = dataIndex;
|
|
@@ -1384,10 +1578,20 @@ listProto.map = function (dimensions, cb, stack, context) {
|
|
|
1384
1578
|
|
|
1385
1579
|
for (var i = 0; i < retValue.length; i++) {
|
|
1386
1580
|
var dim = dimensions[i];
|
|
1581
|
+
var val = retValue[i];
|
|
1582
|
+
var rawExtentOnDim = rawExtent[dim];
|
|
1387
1583
|
var dimStore = storage[dim];
|
|
1388
1584
|
|
|
1389
1585
|
if (dimStore) {
|
|
1390
|
-
dimStore[chunkIndex][chunkOffset] =
|
|
1586
|
+
dimStore[chunkIndex][chunkOffset] = val;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
if (val < rawExtentOnDim[0]) {
|
|
1590
|
+
rawExtentOnDim[0] = val;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
if (val > rawExtentOnDim[1]) {
|
|
1594
|
+
rawExtentOnDim[1] = val;
|
|
1391
1595
|
}
|
|
1392
1596
|
}
|
|
1393
1597
|
}
|
|
@@ -1412,6 +1616,7 @@ listProto.downSample = function (dimension, rate, sampleValue, sampleIndex) {
|
|
|
1412
1616
|
var dimStore = targetStorage[dimension];
|
|
1413
1617
|
var len = this.count();
|
|
1414
1618
|
var chunkSize = this._chunkSize;
|
|
1619
|
+
var rawExtentOnDim = list._rawExtent[dimension];
|
|
1415
1620
|
var newIndices = new (getIndicesCtor(this))(len);
|
|
1416
1621
|
var offset = 0;
|
|
1417
1622
|
|
|
@@ -1435,6 +1640,15 @@ listProto.downSample = function (dimension, rate, sampleValue, sampleIndex) {
|
|
|
1435
1640
|
var sampleChunkOffset = sampleFrameIdx % chunkSize; // Only write value on the filtered data
|
|
1436
1641
|
|
|
1437
1642
|
dimStore[sampleChunkIndex][sampleChunkOffset] = value;
|
|
1643
|
+
|
|
1644
|
+
if (value < rawExtentOnDim[0]) {
|
|
1645
|
+
rawExtentOnDim[0] = value;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
if (value > rawExtentOnDim[1]) {
|
|
1649
|
+
rawExtentOnDim[1] = value;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1438
1652
|
newIndices[offset++] = sampleFrameIdx;
|
|
1439
1653
|
}
|
|
1440
1654
|
|
|
@@ -1704,8 +1918,6 @@ listProto.cloneShallow = function (list) {
|
|
|
1704
1918
|
}
|
|
1705
1919
|
|
|
1706
1920
|
list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices;
|
|
1707
|
-
list._extent = zrUtil.clone(this._extent);
|
|
1708
|
-
list._approximateExtent = zrUtil.clone(this._approximateExtent);
|
|
1709
1921
|
return list;
|
|
1710
1922
|
};
|
|
1711
1923
|
/**
|