echarts 4.5.0 → 4.9.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/.DS_Store +0 -0
- package/.gitattributes +3 -0
- package/.github/pull_request_template.md +66 -0
- package/.github/workflows/nodejs.yml +15 -3
- package/.huskyrc +5 -0
- package/CONTRIBUTING.md +16 -160
- package/NOTICE +1 -1
- package/README.md +3 -3
- package/asset/.DS_Store +0 -0
- package/build/.DS_Store +0 -0
- package/dist/echarts-en.common.js +3072 -1261
- package/dist/echarts-en.common.min.js +1 -1
- package/dist/echarts-en.js +4339 -1685
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +1 -1
- package/dist/echarts-en.simple.js +2496 -1011
- package/dist/echarts-en.simple.min.js +1 -1
- package/dist/echarts.common.js +3046 -1261
- package/dist/echarts.common.min.js +1 -1
- package/dist/echarts.js +4313 -1685
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +1 -1
- package/dist/echarts.simple.js +2470 -1011
- package/dist/echarts.simple.min.js +1 -1
- package/dist/extension/bmap.js +33 -11
- package/dist/extension/bmap.js.map +1 -1
- package/dist/extension/bmap.min.js +1 -1
- package/dist/extension/dataTool.js.map +1 -1
- package/extension/.DS_Store +0 -0
- package/extension/bmap/BMapCoordSys.js +14 -4
- package/extension/bmap/BMapModel.js +4 -0
- package/extension/bmap/BMapView.js +18 -10
- package/extension-src/bmap/BMapCoordSys.js +14 -4
- package/extension-src/bmap/BMapModel.js +6 -1
- package/extension-src/bmap/BMapView.js +16 -9
- package/lib/chart/bar/BarSeries.js +14 -1
- package/lib/chart/bar/BarView.js +196 -18
- package/lib/chart/bar/BaseBarSeries.js +3 -1
- package/lib/chart/bar/PictorialBarSeries.js +1 -1
- package/lib/chart/candlestick/candlestickVisual.js +1 -1
- package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
- package/lib/chart/funnel/FunnelSeries.js +14 -5
- package/lib/chart/funnel/funnelLayout.js +162 -46
- package/lib/chart/gauge/GaugeSeries.js +0 -2
- package/lib/chart/graph/GraphSeries.js +23 -7
- package/lib/chart/graph/GraphView.js +30 -12
- package/lib/chart/graph/circularLayoutHelper.js +8 -2
- package/lib/chart/graph/forceLayout.js +6 -1
- package/lib/chart/graph/simpleLayout.js +1 -1
- package/lib/chart/graph/simpleLayoutHelper.js +10 -4
- package/lib/chart/heatmap/HeatmapView.js +4 -4
- package/lib/chart/helper/EffectLine.js +23 -1
- package/lib/chart/helper/EffectSymbol.js +2 -1
- package/lib/chart/helper/Line.js +129 -42
- package/lib/chart/helper/LineDraw.js +5 -1
- package/lib/chart/helper/Symbol.js +2 -3
- package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
- package/lib/chart/helper/createListFromArray.js +14 -8
- package/lib/chart/helper/createRenderPlanner.js +6 -3
- package/lib/chart/helper/multipleGraphEdgeHelper.js +258 -0
- package/lib/chart/helper/whiskerBoxCommon.js +22 -16
- package/lib/chart/line/LineSeries.js +3 -1
- package/lib/chart/line/LineView.js +41 -2
- package/lib/chart/lines/LinesSeries.js +0 -2
- package/lib/chart/map/MapSeries.js +14 -5
- package/lib/chart/pie/PieSeries.js +27 -6
- package/lib/chart/pie/PieView.js +22 -15
- package/lib/chart/pie/labelLayout.js +102 -19
- package/lib/chart/pie/pieLayout.js +19 -7
- package/lib/chart/radar/RadarSeries.js +27 -6
- package/lib/chart/radar/RadarView.js +3 -1
- package/lib/chart/sankey/SankeySeries.js +13 -1
- package/lib/chart/sankey/SankeyView.js +70 -32
- package/lib/chart/sankey/sankeyLayout.js +22 -3
- package/lib/chart/scatter/ScatterSeries.js +3 -1
- package/lib/chart/sunburst/SunburstPiece.js +5 -1
- package/lib/chart/sunburst/SunburstSeries.js +29 -12
- package/lib/chart/sunburst/SunburstView.js +5 -1
- package/lib/chart/themeRiver/ThemeRiverSeries.js +24 -33
- package/lib/chart/tree/TreeSeries.js +20 -3
- package/lib/chart/tree/TreeView.js +149 -23
- package/lib/chart/treemap/TreemapSeries.js +25 -4
- package/lib/chart/treemap/TreemapView.js +80 -38
- package/lib/chart/treemap/treemapLayout.js +1 -1
- package/lib/chart/treemap/treemapVisual.js +9 -15
- package/lib/component/axis/AngleAxisView.js +64 -7
- package/lib/component/axis/AxisBuilder.js +62 -24
- package/lib/component/axis/CartesianAxisView.js +52 -85
- package/lib/component/axis/RadiusAxisView.js +36 -4
- package/lib/component/axis/SingleAxisView.js +21 -6
- package/lib/component/axis/axisSplitHelper.js +132 -0
- package/lib/component/axisPointer/axisTrigger.js +1 -1
- package/lib/component/brush/BrushView.js +11 -1
- package/lib/component/brush/visualEncoding.js +13 -2
- package/lib/component/dataZoom/SliderZoomView.js +4 -10
- package/lib/component/helper/BrushController.js +33 -43
- package/lib/component/helper/MapDraw.js +30 -4
- package/lib/component/legend/LegendModel.js +3 -3
- package/lib/component/legend/LegendView.js +17 -13
- package/lib/component/legend/ScrollableLegendView.js +18 -18
- package/lib/component/marker/MarkAreaView.js +53 -15
- package/lib/component/marker/MarkLineModel.js +2 -1
- package/lib/component/marker/MarkLineView.js +3 -0
- package/lib/component/marker/MarkPointView.js +8 -1
- package/lib/component/marker/MarkerModel.js +3 -2
- package/lib/component/marker/markerHelper.js +7 -4
- package/lib/component/timeline/SliderTimelineView.js +7 -1
- package/lib/component/title.js +6 -2
- package/lib/component/toolbox/ToolboxView.js +5 -1
- package/lib/component/toolbox/feature/DataView.js +23 -8
- package/lib/component/toolbox/feature/DataZoom.js +6 -6
- package/lib/component/toolbox/feature/MagicType.js +20 -14
- package/lib/component/toolbox/feature/SaveAsImage.js +4 -2
- package/lib/component/tooltip/TooltipContent.js +101 -30
- package/lib/component/tooltip/TooltipRichContent.js +56 -8
- package/lib/component/tooltip/TooltipView.js +11 -12
- package/lib/component/visualMap/PiecewiseModel.js +3 -6
- package/lib/component/visualMap/VisualMapModel.js +1 -1
- package/lib/coord/Axis.js +30 -2
- package/lib/coord/View.js +9 -0
- package/lib/coord/axisDefault.js +22 -3
- package/lib/coord/axisHelper.js +24 -18
- package/lib/coord/calendar/Calendar.js +8 -4
- package/lib/coord/geo/GeoModel.js +2 -1
- package/lib/coord/geo/geoJSONLoader.js +3 -2
- package/lib/coord/geo/geoSourceManager.js +3 -2
- package/lib/coord/geo/parseGeoJson.js +3 -2
- package/lib/coord/radar/Radar.js +5 -5
- package/lib/data/DataDimensionInfo.js +157 -0
- package/lib/data/Graph.js +1 -6
- package/lib/data/List.js +26 -20
- package/lib/data/Tree.js +5 -42
- package/lib/data/helper/completeDimensions.js +43 -32
- package/lib/data/helper/createDimensions.js +2 -0
- package/lib/data/helper/sourceHelper.js +214 -114
- package/lib/echarts.js +57 -34
- package/lib/langEN.js +26 -0
- package/lib/layout/barGrid.js +19 -13
- package/lib/layout/barPolar.js +1 -6
- package/lib/loading/default.js +43 -27
- package/lib/model/Series.js +4 -4
- package/lib/model/referHelper.js +40 -12
- package/lib/processor/dataSample.js +1 -1
- package/lib/scale/Interval.js +87 -2
- package/lib/scale/Log.js +9 -2
- package/lib/scale/helper.js +1 -43
- package/lib/stream/Scheduler.js +10 -2
- package/lib/theme/dark.js +3 -0
- package/lib/util/format.js +19 -2
- package/lib/util/graphic.js +14 -12
- package/lib/visual/LegendVisualProvider.js +75 -0
- package/lib/visual/VisualMapping.js +1 -1
- package/lib/visual/dataColor.js +2 -12
- package/lib/visual/seriesColor.js +15 -7
- package/lib/visual/symbol.js +12 -2
- package/map/.DS_Store +0 -0
- package/map/js/.DS_Store +0 -0
- package/map/js/china.js +1 -1
- package/map/js/province/.DS_Store +0 -0
- package/map/js/province/chongqing.js +1 -1
- package/map/js/province/gansu.js +2 -2
- package/map/js/province/tianjin.js +1 -28
- package/map/json/.DS_Store +0 -0
- package/map/json/china.json +1 -1
- package/map/json/province/chongqing.json +1 -1
- package/map/json/province/tianjin.json +1 -1
- package/package.json +12 -6
- package/src/.DS_Store +0 -0
- package/src/chart/.DS_Store +0 -0
- package/src/chart/bar/BarSeries.js +15 -1
- package/src/chart/bar/BarView.js +198 -17
- package/src/chart/bar/BaseBarSeries.js +1 -1
- package/src/chart/bar/PictorialBarSeries.js +2 -2
- package/src/chart/candlestick/candlestickVisual.js +1 -1
- package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
- package/src/chart/funnel/FunnelSeries.js +11 -4
- package/src/chart/funnel/funnelLayout.js +179 -53
- package/src/chart/gauge/GaugeSeries.js +0 -1
- package/src/chart/graph/GraphSeries.js +19 -7
- package/src/chart/graph/GraphView.js +28 -10
- package/src/chart/graph/circularLayoutHelper.js +8 -2
- package/src/chart/graph/forceLayout.js +7 -1
- package/src/chart/graph/simpleLayout.js +1 -1
- package/src/chart/graph/simpleLayoutHelper.js +12 -5
- package/src/chart/heatmap/HeatmapView.js +4 -4
- package/src/chart/helper/EffectLine.js +23 -1
- package/src/chart/helper/EffectSymbol.js +2 -1
- package/src/chart/helper/Line.js +122 -37
- package/src/chart/helper/LineDraw.js +5 -1
- package/src/chart/helper/Symbol.js +4 -4
- package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
- package/src/chart/helper/createGraphFromNodeEdge.js +2 -1
- package/src/chart/helper/createListFromArray.js +13 -8
- package/src/chart/helper/createRenderPlanner.js +5 -2
- package/src/chart/helper/multipleGraphEdgeHelper.js +229 -0
- package/src/chart/helper/whiskerBoxCommon.js +21 -16
- package/src/chart/line/LineSeries.js +1 -1
- package/src/chart/line/LineView.js +45 -1
- package/src/chart/lines/LinesSeries.js +1 -3
- package/src/chart/map/MapSeries.js +11 -5
- package/src/chart/pie/PieSeries.js +26 -5
- package/src/chart/pie/PieView.js +20 -15
- package/src/chart/pie/labelLayout.js +114 -22
- package/src/chart/pie/pieLayout.js +20 -7
- package/src/chart/radar/RadarSeries.js +31 -6
- package/src/chart/radar/RadarView.js +4 -2
- package/src/chart/sankey/SankeySeries.js +12 -1
- package/src/chart/sankey/SankeyView.js +75 -30
- package/src/chart/sankey/sankeyLayout.js +25 -5
- package/src/chart/scatter/ScatterSeries.js +1 -1
- package/src/chart/sunburst/SunburstPiece.js +7 -1
- package/src/chart/sunburst/SunburstSeries.js +28 -15
- package/src/chart/sunburst/SunburstView.js +2 -1
- package/src/chart/themeRiver/ThemeRiverSeries.js +25 -30
- package/src/chart/tree/TreeSeries.js +19 -6
- package/src/chart/tree/TreeView.js +156 -23
- package/src/chart/treemap/TreemapSeries.js +23 -5
- package/src/chart/treemap/TreemapView.js +77 -41
- package/src/chart/treemap/treemapLayout.js +2 -2
- package/src/chart/treemap/treemapVisual.js +8 -25
- package/src/component/axis/AngleAxisView.js +75 -7
- package/src/component/axis/AxisBuilder.js +77 -32
- package/src/component/axis/CartesianAxisView.js +47 -83
- package/src/component/axis/RadiusAxisView.js +37 -4
- package/src/component/axis/SingleAxisView.js +21 -4
- package/src/component/axis/axisSplitHelper.js +114 -0
- package/src/component/axisPointer/axisTrigger.js +1 -1
- package/src/component/brush/BrushView.js +8 -1
- package/src/component/brush/visualEncoding.js +6 -3
- package/src/component/dataZoom/SliderZoomView.js +4 -9
- package/src/component/helper/BrushController.js +40 -47
- package/src/component/helper/MapDraw.js +27 -4
- package/src/component/legend/LegendModel.js +3 -3
- package/src/component/legend/LegendView.js +18 -12
- package/src/component/legend/ScrollableLegendView.js +18 -16
- package/src/component/marker/MarkAreaView.js +53 -15
- package/src/component/marker/MarkLineModel.js +2 -1
- package/src/component/marker/MarkLineView.js +3 -1
- package/src/component/marker/MarkPointView.js +7 -1
- package/src/component/marker/MarkerModel.js +3 -2
- package/src/component/marker/markerHelper.js +8 -5
- package/src/component/timeline/SliderTimelineView.js +9 -6
- package/src/component/title.js +4 -3
- package/src/component/toolbox/.DS_Store +0 -0
- package/src/component/toolbox/ToolboxView.js +5 -0
- package/src/component/toolbox/feature/DataView.js +20 -8
- package/src/component/toolbox/feature/DataZoom.js +6 -6
- package/src/component/toolbox/feature/MagicType.js +19 -13
- package/src/component/toolbox/feature/SaveAsImage.js +4 -2
- package/src/component/tooltip/TooltipContent.js +94 -28
- package/src/component/tooltip/TooltipRichContent.js +52 -9
- package/src/component/tooltip/TooltipView.js +14 -12
- package/src/component/visualMap/PiecewiseModel.js +5 -9
- package/src/component/visualMap/VisualMapModel.js +1 -1
- package/src/coord/Axis.js +29 -2
- package/src/coord/View.js +10 -1
- package/src/coord/axisDefault.js +26 -2
- package/src/coord/axisHelper.js +30 -21
- package/src/coord/calendar/Calendar.js +12 -5
- package/src/coord/geo/GeoModel.js +3 -6
- package/src/coord/geo/geoJSONLoader.js +3 -2
- package/src/coord/geo/geoSourceManager.js +3 -2
- package/src/coord/geo/parseGeoJson.js +3 -2
- package/src/coord/radar/Radar.js +6 -8
- package/src/data/DataDimensionInfo.js +135 -0
- package/src/data/Graph.js +0 -5
- package/src/data/List.js +30 -17
- package/src/data/Tree.js +6 -39
- package/src/data/helper/completeDimensions.js +49 -30
- package/src/data/helper/createDimensions.js +2 -0
- package/src/data/helper/sourceHelper.js +216 -124
- package/src/echarts.js +60 -36
- package/src/langEN.js +26 -0
- package/src/layout/barGrid.js +22 -10
- package/src/layout/barPolar.js +4 -6
- package/src/loading/default.js +46 -34
- package/src/model/.DS_Store +0 -0
- package/src/model/Series.js +4 -4
- package/src/model/referHelper.js +34 -11
- package/src/preprocessor/.DS_Store +0 -0
- package/src/processor/dataSample.js +1 -1
- package/src/scale/Interval.js +84 -4
- package/src/scale/Log.js +9 -2
- package/src/scale/helper.js +1 -39
- package/src/stream/Scheduler.js +9 -1
- package/src/theme/dark.js +3 -0
- package/src/util/.DS_Store +0 -0
- package/src/util/format.js +17 -1
- package/src/util/graphic.js +13 -11
- package/src/visual/LegendVisualProvider.js +55 -0
- package/src/visual/VisualMapping.js +1 -1
- package/src/visual/dataColor.js +0 -13
- package/src/visual/seriesColor.js +13 -7
- package/src/visual/symbol.js +11 -2
- package/theme/.DS_Store +0 -0
- package/theme/azul.js +163 -0
- package/theme/bee-inspired.js +178 -0
- package/theme/blue.js +178 -0
- package/theme/caravan.js +178 -0
- package/theme/carp.js +163 -0
- package/theme/cool.js +180 -0
- package/theme/dark-blue.js +168 -0
- package/theme/dark-bold.js +168 -0
- package/theme/dark-digerati.js +168 -0
- package/theme/dark-fresh-cut.js +168 -0
- package/theme/dark-mushroom.js +168 -0
- package/theme/dark.js +69 -62
- package/theme/eduardo.js +178 -0
- package/theme/forest.js +163 -0
- package/theme/fresh-cut.js +163 -0
- package/theme/fruit.js +178 -0
- package/theme/gray.js +220 -0
- package/theme/green.js +222 -0
- package/theme/helianthus.js +263 -0
- package/theme/infographic.js +72 -57
- package/theme/inspired.js +163 -0
- package/theme/jazz.js +163 -0
- package/theme/london.js +163 -0
- package/theme/macarons.js +80 -57
- package/theme/macarons2.js +251 -0
- package/theme/mint.js +155 -0
- package/theme/red-velvet.js +163 -0
- package/theme/red.js +225 -0
- package/theme/roma.js +55 -22
- package/theme/royal.js +163 -0
- package/theme/sakura.js +140 -0
- package/theme/shine.js +52 -45
- package/theme/tech-blue.js +180 -0
- package/theme/vintage.js +37 -23
|
@@ -153,12 +153,6 @@ function BrushController(zr) {
|
|
|
153
153
|
*/
|
|
154
154
|
|
|
155
155
|
this._dragging;
|
|
156
|
-
/**
|
|
157
|
-
* @private
|
|
158
|
-
* @type {Object}
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
this._lastMouseMovePoint = {};
|
|
162
156
|
/**
|
|
163
157
|
* @private
|
|
164
158
|
* @type {Array}
|
|
@@ -200,7 +194,7 @@ function BrushController(zr) {
|
|
|
200
194
|
*/
|
|
201
195
|
|
|
202
196
|
this._handlers = {};
|
|
203
|
-
each(
|
|
197
|
+
each(pointerHandlers, function (handler, eventName) {
|
|
204
198
|
this._handlers[eventName] = zrUtil.bind(handler, this);
|
|
205
199
|
}, this);
|
|
206
200
|
}
|
|
@@ -351,9 +345,7 @@ function doEnableBrush(controller, brushOption) {
|
|
|
351
345
|
interactionMutex.take(zr, MUTEX_RESOURCE_KEY, controller._uid);
|
|
352
346
|
}
|
|
353
347
|
|
|
354
|
-
|
|
355
|
-
zr.on(eventName, handler);
|
|
356
|
-
});
|
|
348
|
+
mountHandlers(zr, controller._handlers);
|
|
357
349
|
controller._brushType = brushOption.brushType;
|
|
358
350
|
controller._brushOption = zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
|
|
359
351
|
}
|
|
@@ -361,10 +353,20 @@ function doEnableBrush(controller, brushOption) {
|
|
|
361
353
|
function doDisableBrush(controller) {
|
|
362
354
|
var zr = controller._zr;
|
|
363
355
|
interactionMutex.release(zr, MUTEX_RESOURCE_KEY, controller._uid);
|
|
364
|
-
|
|
356
|
+
unmountHandlers(zr, controller._handlers);
|
|
357
|
+
controller._brushType = controller._brushOption = null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function mountHandlers(zr, handlers) {
|
|
361
|
+
each(handlers, function (handler, eventName) {
|
|
362
|
+
zr.on(eventName, handler);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function unmountHandlers(zr, handlers) {
|
|
367
|
+
each(handlers, function (handler, eventName) {
|
|
365
368
|
zr.off(eventName, handler);
|
|
366
369
|
});
|
|
367
|
-
controller._brushType = controller._brushOption = null;
|
|
368
370
|
}
|
|
369
371
|
|
|
370
372
|
function createCover(controller, brushOption) {
|
|
@@ -667,8 +669,11 @@ function pointsToRect(points) {
|
|
|
667
669
|
}
|
|
668
670
|
|
|
669
671
|
function resetCursor(controller, e, localCursorPoint) {
|
|
670
|
-
// Check active
|
|
671
|
-
|
|
672
|
+
if ( // Check active
|
|
673
|
+
!controller._brushType // resetCursor should be always called when mouse is in zr area,
|
|
674
|
+
// but not called when mouse is out of zr area to avoid bad influence
|
|
675
|
+
// if `mousemove`, `mouseup` are triggered from `document` event.
|
|
676
|
+
|| isOutsideZrArea(controller, e)) {
|
|
672
677
|
return;
|
|
673
678
|
}
|
|
674
679
|
|
|
@@ -758,7 +763,7 @@ function determineBrushType(brushType, panel) {
|
|
|
758
763
|
return brushType;
|
|
759
764
|
}
|
|
760
765
|
|
|
761
|
-
var
|
|
766
|
+
var pointerHandlers = {
|
|
762
767
|
mousedown: function (e) {
|
|
763
768
|
if (this._dragging) {
|
|
764
769
|
// In case some browser do not support globalOut,
|
|
@@ -777,10 +782,9 @@ var mouseHandlers = {
|
|
|
777
782
|
}
|
|
778
783
|
},
|
|
779
784
|
mousemove: function (e) {
|
|
780
|
-
var
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
var localCursorPoint = this.group.transformCoordToLocal(lastPoint.x, lastPoint.y);
|
|
785
|
+
var x = e.offsetX;
|
|
786
|
+
var y = e.offsetY;
|
|
787
|
+
var localCursorPoint = this.group.transformCoordToLocal(x, y);
|
|
784
788
|
resetCursor(this, e, localCursorPoint);
|
|
785
789
|
|
|
786
790
|
if (this._dragging) {
|
|
@@ -791,34 +795,15 @@ var mouseHandlers = {
|
|
|
791
795
|
},
|
|
792
796
|
mouseup: function (e) {
|
|
793
797
|
handleDragEnd(this, e);
|
|
794
|
-
},
|
|
795
|
-
globalout: function (e) {
|
|
796
|
-
handleDragEnd(this, e, true);
|
|
797
798
|
}
|
|
798
799
|
};
|
|
799
800
|
|
|
800
|
-
function handleDragEnd(controller, e
|
|
801
|
+
function handleDragEnd(controller, e) {
|
|
801
802
|
if (controller._dragging) {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
var
|
|
806
|
-
var pointerY = e.offsetY;
|
|
807
|
-
var lastPoint = controller._lastMouseMovePoint;
|
|
808
|
-
|
|
809
|
-
if (isGlobalOut) {
|
|
810
|
-
pointerX = lastPoint.x;
|
|
811
|
-
pointerY = lastPoint.y;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
var localCursorPoint = controller.group.transformCoordToLocal(pointerX, pointerY); // FIXME
|
|
815
|
-
// Here `e` is used only in `onIrrelevantElement` finally. And it's OK
|
|
816
|
-
// that pass the `e` of `globalout` to `onIrrelevantElement`. But it is
|
|
817
|
-
// not a good design of these interfaces. However, we do not refactor
|
|
818
|
-
// these code now because the implementation of `onIrrelevantElement`
|
|
819
|
-
// need to be discussed and probably be changed in future, becuase it
|
|
820
|
-
// slows down the performance of zrender in some cases.
|
|
821
|
-
|
|
803
|
+
preventDefault(e);
|
|
804
|
+
var x = e.offsetX;
|
|
805
|
+
var y = e.offsetY;
|
|
806
|
+
var localCursorPoint = controller.group.transformCoordToLocal(x, y);
|
|
822
807
|
var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);
|
|
823
808
|
controller._dragging = false;
|
|
824
809
|
controller._track = [];
|
|
@@ -827,6 +812,11 @@ function handleDragEnd(controller, e, isGlobalOut) {
|
|
|
827
812
|
eventParams && trigger(controller, eventParams);
|
|
828
813
|
}
|
|
829
814
|
}
|
|
815
|
+
|
|
816
|
+
function isOutsideZrArea(controller, x, y) {
|
|
817
|
+
var zr = controller._zr;
|
|
818
|
+
return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();
|
|
819
|
+
}
|
|
830
820
|
/**
|
|
831
821
|
* key: brushType
|
|
832
822
|
* @type {Object}
|
|
@@ -36,6 +36,8 @@ var _component = require("../../util/component");
|
|
|
36
36
|
|
|
37
37
|
var getUID = _component.getUID;
|
|
38
38
|
|
|
39
|
+
var Transformable = require("zrender/lib/mixin/Transformable");
|
|
40
|
+
|
|
39
41
|
/*
|
|
40
42
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
41
43
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -206,14 +208,29 @@ MapDraw.prototype = {
|
|
|
206
208
|
|
|
207
209
|
var regionsGroup = this._regionsGroup;
|
|
208
210
|
var group = this.group;
|
|
211
|
+
var transformInfo = geo.getTransformInfo(); // No animation when first draw or in action
|
|
212
|
+
|
|
213
|
+
var isFirstDraw = !regionsGroup.childAt(0) || payload;
|
|
214
|
+
var targetScale;
|
|
209
215
|
|
|
210
|
-
if (
|
|
211
|
-
group.transform =
|
|
216
|
+
if (isFirstDraw) {
|
|
217
|
+
group.transform = transformInfo.roamTransform;
|
|
212
218
|
group.decomposeTransform();
|
|
219
|
+
group.dirty();
|
|
220
|
+
} else {
|
|
221
|
+
var target = new Transformable();
|
|
222
|
+
target.transform = transformInfo.roamTransform;
|
|
223
|
+
target.decomposeTransform();
|
|
224
|
+
var props = {
|
|
225
|
+
scale: target.scale,
|
|
226
|
+
position: target.position
|
|
227
|
+
};
|
|
228
|
+
targetScale = target.scale;
|
|
229
|
+
graphic.updateProps(group, props, mapOrGeoModel);
|
|
213
230
|
}
|
|
214
231
|
|
|
215
|
-
var scale =
|
|
216
|
-
var position =
|
|
232
|
+
var scale = transformInfo.rawScale;
|
|
233
|
+
var position = transformInfo.rawPosition;
|
|
217
234
|
regionsGroup.removeAll();
|
|
218
235
|
var itemStyleAccessPath = ['itemStyle'];
|
|
219
236
|
var hoverItemStyleAccessPath = ['emphasis', 'itemStyle'];
|
|
@@ -333,6 +350,15 @@ MapDraw.prototype = {
|
|
|
333
350
|
textAlign: 'center',
|
|
334
351
|
textVerticalAlign: 'middle'
|
|
335
352
|
});
|
|
353
|
+
|
|
354
|
+
if (!isFirstDraw) {
|
|
355
|
+
// Text animation
|
|
356
|
+
var textScale = [1 / targetScale[0], 1 / targetScale[1]];
|
|
357
|
+
graphic.updateProps(textEl, {
|
|
358
|
+
scale: textScale
|
|
359
|
+
}, mapOrGeoModel);
|
|
360
|
+
}
|
|
361
|
+
|
|
336
362
|
regionGroup.add(textEl);
|
|
337
363
|
} // setItemGraphicEl, setHoverStyle after all polygons and labels
|
|
338
364
|
// are added to the rigionGroup
|
|
@@ -131,9 +131,9 @@ var LegendModel = echarts.extendComponentModel({
|
|
|
131
131
|
availableNames.push(seriesName);
|
|
132
132
|
var isPotential;
|
|
133
133
|
|
|
134
|
-
if (seriesModel.
|
|
135
|
-
var
|
|
136
|
-
var names =
|
|
134
|
+
if (seriesModel.legendVisualProvider) {
|
|
135
|
+
var provider = seriesModel.legendVisualProvider;
|
|
136
|
+
var names = provider.getAllNames();
|
|
137
137
|
|
|
138
138
|
if (!ecModel.isSeriesFiltered(seriesModel)) {
|
|
139
139
|
availableNames = availableNames.concat(names);
|
|
@@ -191,7 +191,7 @@ var _default = echarts.extendComponentView({
|
|
|
191
191
|
if (legendDrawnMap.get(name)) {
|
|
192
192
|
// Have been drawed
|
|
193
193
|
return;
|
|
194
|
-
} //
|
|
194
|
+
} // Legend to control series.
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
if (seriesModel) {
|
|
@@ -216,32 +216,32 @@ var _default = echarts.extendComponentView({
|
|
|
216
216
|
|
|
217
217
|
var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, selectMode);
|
|
218
218
|
|
|
219
|
-
itemGroup.on('click', curry(dispatchSelectAction, name, api)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
|
|
219
|
+
itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
|
|
220
220
|
legendDrawnMap.set(name, true);
|
|
221
221
|
} else {
|
|
222
|
-
//
|
|
222
|
+
// Legend to control data. In pie and funnel.
|
|
223
223
|
ecModel.eachRawSeries(function (seriesModel) {
|
|
224
224
|
// In case multiple series has same data name
|
|
225
225
|
if (legendDrawnMap.get(name)) {
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
if (seriesModel.
|
|
230
|
-
var
|
|
231
|
-
var idx = data.indexOfName(name);
|
|
229
|
+
if (seriesModel.legendVisualProvider) {
|
|
230
|
+
var provider = seriesModel.legendVisualProvider;
|
|
232
231
|
|
|
233
|
-
if (
|
|
232
|
+
if (!provider.containName(name)) {
|
|
234
233
|
return;
|
|
235
234
|
}
|
|
236
235
|
|
|
237
|
-
var
|
|
238
|
-
var
|
|
236
|
+
var idx = provider.indexOfName(name);
|
|
237
|
+
var color = provider.getItemVisual(idx, 'color');
|
|
238
|
+
var borderColor = provider.getItemVisual(idx, 'borderColor');
|
|
239
239
|
var legendSymbolType = 'roundRect';
|
|
240
240
|
|
|
241
241
|
var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, selectMode); // FIXME: consider different series has items with the same name.
|
|
242
242
|
|
|
243
243
|
|
|
244
|
-
itemGroup.on('click', curry(dispatchSelectAction, name, api)) // Should not specify the series name, consider legend controls
|
|
244
|
+
itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls
|
|
245
245
|
// more than one pie series.
|
|
246
246
|
.on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));
|
|
247
247
|
legendDrawnMap.set(name, true);
|
|
@@ -442,11 +442,15 @@ function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, i
|
|
|
442
442
|
return symbol.setStyle(itemStyle);
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
function dispatchSelectAction(
|
|
445
|
+
function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
|
|
446
|
+
// downplay before unselect
|
|
447
|
+
dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);
|
|
446
448
|
api.dispatchAction({
|
|
447
449
|
type: 'legendToggleSelect',
|
|
448
|
-
name:
|
|
449
|
-
});
|
|
450
|
+
name: seriesName != null ? seriesName : dataName
|
|
451
|
+
}); // highlight after select
|
|
452
|
+
|
|
453
|
+
dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);
|
|
450
454
|
}
|
|
451
455
|
|
|
452
456
|
function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
|
|
@@ -418,28 +418,28 @@ var ScrollableLegendView = LegendView.extend({
|
|
|
418
418
|
}
|
|
419
419
|
},
|
|
420
420
|
_findTargetItemIndex: function (targetDataIndex) {
|
|
421
|
+
if (!this._showController) {
|
|
422
|
+
return 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
421
425
|
var index;
|
|
422
426
|
var contentGroup = this.getContentGroup();
|
|
423
427
|
var defaultIndex;
|
|
428
|
+
contentGroup.eachChild(function (child, idx) {
|
|
429
|
+
var legendDataIdx = child.__legendDataIndex; // FIXME
|
|
430
|
+
// If the given targetDataIndex (from model) is illegal,
|
|
431
|
+
// we use defaultIndex. But the index on the legend model and
|
|
432
|
+
// action payload is still illegal. That case will not be
|
|
433
|
+
// changed until some scenario requires.
|
|
434
|
+
|
|
435
|
+
if (defaultIndex == null && legendDataIdx != null) {
|
|
436
|
+
defaultIndex = idx;
|
|
437
|
+
}
|
|
424
438
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
// we use defualtIndex. But the index on the legend model and
|
|
430
|
-
// action payload is still illegal. That case will not be
|
|
431
|
-
// changed until some scenario requires.
|
|
432
|
-
|
|
433
|
-
if (defaultIndex == null && legendDataIdx != null) {
|
|
434
|
-
defaultIndex = idx;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
if (legendDataIdx === targetDataIndex) {
|
|
438
|
-
index = idx;
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
|
|
439
|
+
if (legendDataIdx === targetDataIndex) {
|
|
440
|
+
index = idx;
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
443
|
return index != null ? index : defaultIndex;
|
|
444
444
|
}
|
|
445
445
|
});
|
|
@@ -212,32 +212,70 @@ MarkerView.extend({
|
|
|
212
212
|
|
|
213
213
|
areaData.each(function (idx) {
|
|
214
214
|
// Layout
|
|
215
|
-
|
|
215
|
+
var points = zrUtil.map(dimPermutations, function (dim) {
|
|
216
216
|
return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
|
|
217
|
-
})
|
|
217
|
+
}); // If none of the area is inside coordSys, allClipped is set to be true
|
|
218
|
+
// in layout so that label will not be displayed. See #12591
|
|
219
|
+
|
|
220
|
+
var allClipped = true;
|
|
221
|
+
zrUtil.each(dimPermutations, function (dim) {
|
|
222
|
+
if (!allClipped) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
var xValue = areaData.get(dim[0], idx);
|
|
227
|
+
var yValue = areaData.get(dim[1], idx); // If is infinity, the axis should be considered not clipped
|
|
228
|
+
|
|
229
|
+
if ((isInifinity(xValue) || coordSys.getAxis('x').containData(xValue)) && (isInifinity(yValue) || coordSys.getAxis('y').containData(yValue))) {
|
|
230
|
+
allClipped = false;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
areaData.setItemLayout(idx, {
|
|
234
|
+
points: points,
|
|
235
|
+
allClipped: allClipped
|
|
236
|
+
}); // Visual
|
|
218
237
|
|
|
219
238
|
areaData.setItemVisual(idx, {
|
|
220
239
|
color: seriesData.getVisual('color')
|
|
221
240
|
});
|
|
222
241
|
});
|
|
223
242
|
areaData.diff(polygonGroup.__data).add(function (idx) {
|
|
224
|
-
var
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
243
|
+
var layout = areaData.getItemLayout(idx);
|
|
244
|
+
|
|
245
|
+
if (!layout.allClipped) {
|
|
246
|
+
var polygon = new graphic.Polygon({
|
|
247
|
+
shape: {
|
|
248
|
+
points: layout.points
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
areaData.setItemGraphicEl(idx, polygon);
|
|
252
|
+
polygonGroup.group.add(polygon);
|
|
253
|
+
}
|
|
231
254
|
}).update(function (newIdx, oldIdx) {
|
|
232
255
|
var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx);
|
|
233
256
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
257
|
+
var layout = areaData.getItemLayout(newIdx);
|
|
258
|
+
|
|
259
|
+
if (!layout.allClipped) {
|
|
260
|
+
if (polygon) {
|
|
261
|
+
graphic.updateProps(polygon, {
|
|
262
|
+
shape: {
|
|
263
|
+
points: layout.points
|
|
264
|
+
}
|
|
265
|
+
}, maModel, newIdx);
|
|
266
|
+
} else {
|
|
267
|
+
polygon = new graphic.Polygon({
|
|
268
|
+
shape: {
|
|
269
|
+
points: layout.points
|
|
270
|
+
}
|
|
271
|
+
});
|
|
237
272
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
273
|
+
|
|
274
|
+
areaData.setItemGraphicEl(newIdx, polygon);
|
|
275
|
+
polygonGroup.group.add(polygon);
|
|
276
|
+
} else if (polygon) {
|
|
277
|
+
polygonGroup.group.remove(polygon);
|
|
278
|
+
}
|
|
241
279
|
}).remove(function (idx) {
|
|
242
280
|
var polygon = polygonGroup.__data.getItemGraphicEl(idx);
|
|
243
281
|
|
|
@@ -278,8 +278,10 @@ var _default = MarkerView.extend({
|
|
|
278
278
|
});
|
|
279
279
|
lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);
|
|
280
280
|
lineData.setItemVisual(idx, {
|
|
281
|
+
'fromSymbolRotate': fromData.getItemVisual(idx, 'symbolRotate'),
|
|
281
282
|
'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'),
|
|
282
283
|
'fromSymbol': fromData.getItemVisual(idx, 'symbol'),
|
|
284
|
+
'toSymbolRotate': toData.getItemVisual(idx, 'symbolRotate'),
|
|
283
285
|
'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'),
|
|
284
286
|
'toSymbol': toData.getItemVisual(idx, 'symbol')
|
|
285
287
|
});
|
|
@@ -297,6 +299,7 @@ var _default = MarkerView.extend({
|
|
|
297
299
|
var itemModel = data.getItemModel(idx);
|
|
298
300
|
updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);
|
|
299
301
|
data.setItemVisual(idx, {
|
|
302
|
+
symbolRotate: itemModel.get('symbolRotate'),
|
|
300
303
|
symbolSize: itemModel.get('symbolSize') || symbolSize[isFrom ? 0 : 1],
|
|
301
304
|
symbol: itemModel.get('symbol', true) || symbolType[isFrom ? 0 : 1],
|
|
302
305
|
color: itemModel.get('itemStyle.color') || seriesData.getVisual('color')
|
|
@@ -116,10 +116,12 @@ var _default = MarkerView.extend({
|
|
|
116
116
|
var itemModel = mpData.getItemModel(idx);
|
|
117
117
|
var symbol = itemModel.getShallow('symbol');
|
|
118
118
|
var symbolSize = itemModel.getShallow('symbolSize');
|
|
119
|
+
var symbolRotate = itemModel.getShallow('symbolRotate');
|
|
119
120
|
var isFnSymbol = zrUtil.isFunction(symbol);
|
|
120
121
|
var isFnSymbolSize = zrUtil.isFunction(symbolSize);
|
|
122
|
+
var isFnSymbolRotate = zrUtil.isFunction(symbolRotate);
|
|
121
123
|
|
|
122
|
-
if (isFnSymbol || isFnSymbolSize) {
|
|
124
|
+
if (isFnSymbol || isFnSymbolSize || isFnSymbolRotate) {
|
|
123
125
|
var rawIdx = mpModel.getRawValue(idx);
|
|
124
126
|
var dataParams = mpModel.getDataParams(idx);
|
|
125
127
|
|
|
@@ -131,11 +133,16 @@ var _default = MarkerView.extend({
|
|
|
131
133
|
// FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
|
|
132
134
|
symbolSize = symbolSize(rawIdx, dataParams);
|
|
133
135
|
}
|
|
136
|
+
|
|
137
|
+
if (isFnSymbolRotate) {
|
|
138
|
+
symbolRotate = symbolRotate(rawIdx, dataParams);
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
mpData.setItemVisual(idx, {
|
|
137
143
|
symbol: symbol,
|
|
138
144
|
symbolSize: symbolSize,
|
|
145
|
+
symbolRotate: symbolRotate,
|
|
139
146
|
color: itemModel.get('itemStyle.color') || seriesData.getVisual('color')
|
|
140
147
|
});
|
|
141
148
|
}); // TODO Text are wrong
|
|
@@ -136,15 +136,16 @@ var MarkerModel = echarts.extendComponentModel({
|
|
|
136
136
|
}, this);
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
|
-
formatTooltip: function (dataIndex) {
|
|
139
|
+
formatTooltip: function (dataIndex, multipleSeries, dataType, renderMode) {
|
|
140
140
|
var data = this.getData();
|
|
141
141
|
var value = this.getRawValue(dataIndex);
|
|
142
142
|
var formattedValue = zrUtil.isArray(value) ? zrUtil.map(value, addCommas).join(', ') : addCommas(value);
|
|
143
143
|
var name = data.getName(dataIndex);
|
|
144
144
|
var html = encodeHTML(this.name);
|
|
145
|
+
var newLine = renderMode === 'html' ? '<br/>' : '\n';
|
|
145
146
|
|
|
146
147
|
if (value != null || name) {
|
|
147
|
-
html +=
|
|
148
|
+
html += newLine;
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
if (name) {
|
|
@@ -85,7 +85,8 @@ function markerTypeCalculatorWithExtent(mlType, data, otherDataDim, targetDataDi
|
|
|
85
85
|
var value = numCalculate(data, calcDataDim, mlType);
|
|
86
86
|
var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];
|
|
87
87
|
coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);
|
|
88
|
-
coordArr[targetCoordIndex] = data.get(
|
|
88
|
+
coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);
|
|
89
|
+
var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision.
|
|
89
90
|
|
|
90
91
|
var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));
|
|
91
92
|
precision = Math.min(precision, 20);
|
|
@@ -94,7 +95,7 @@ function markerTypeCalculatorWithExtent(mlType, data, otherDataDim, targetDataDi
|
|
|
94
95
|
coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
return coordArr;
|
|
98
|
+
return [coordArr, coordArrValue];
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
var curry = zrUtil.curry; // TODO Specified percent
|
|
@@ -151,9 +152,11 @@ function dataTransform(seriesModel, item) {
|
|
|
151
152
|
if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {
|
|
152
153
|
var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);
|
|
153
154
|
var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);
|
|
154
|
-
|
|
155
|
+
var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);
|
|
156
|
+
item.coord = coordInfo[0]; // Force to use the value of calculated value.
|
|
157
|
+
// let item use the value without stack.
|
|
155
158
|
|
|
156
|
-
item.value =
|
|
159
|
+
item.value = coordInfo[1];
|
|
157
160
|
} else {
|
|
158
161
|
// FIXME Only has one of xAxis and yAxis.
|
|
159
162
|
var coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis]; // Each coord support max, min, average
|
|
@@ -571,7 +571,13 @@ function getViewRect(model, api) {
|
|
|
571
571
|
}
|
|
572
572
|
|
|
573
573
|
function makeIcon(timelineModel, objPath, rect, opts) {
|
|
574
|
-
var
|
|
574
|
+
var style = opts.style;
|
|
575
|
+
var icon = graphic.createIcon(timelineModel.get(objPath), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); // TODO createIcon won't use style in opt.
|
|
576
|
+
|
|
577
|
+
if (style) {
|
|
578
|
+
icon.setStyle(style);
|
|
579
|
+
}
|
|
580
|
+
|
|
575
581
|
return icon;
|
|
576
582
|
}
|
|
577
583
|
/**
|
package/lib/component/title.js
CHANGED
|
@@ -28,6 +28,10 @@ var _layout = require("../util/layout");
|
|
|
28
28
|
|
|
29
29
|
var getLayoutRect = _layout.getLayoutRect;
|
|
30
30
|
|
|
31
|
+
var _format = require("../util/format");
|
|
32
|
+
|
|
33
|
+
var windowOpen = _format.windowOpen;
|
|
34
|
+
|
|
31
35
|
/*
|
|
32
36
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
33
37
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -150,13 +154,13 @@ echarts.extendComponentView({
|
|
|
150
154
|
|
|
151
155
|
if (link) {
|
|
152
156
|
textEl.on('click', function () {
|
|
153
|
-
|
|
157
|
+
windowOpen(link, '_' + titleModel.get('target'));
|
|
154
158
|
});
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
if (sublink) {
|
|
158
162
|
subTextEl.on('click', function () {
|
|
159
|
-
|
|
163
|
+
windowOpen(sublink, '_' + titleModel.get('subtarget'));
|
|
160
164
|
});
|
|
161
165
|
}
|
|
162
166
|
|
|
@@ -78,7 +78,11 @@ var _default = echarts.extendComponentView({
|
|
|
78
78
|
var oldName = featureNames[oldIndex];
|
|
79
79
|
var featureOpt = featureOpts[featureName];
|
|
80
80
|
var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
|
|
81
|
-
var feature;
|
|
81
|
+
var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?
|
|
82
|
+
|
|
83
|
+
if (payload && payload.newTitle != null && payload.featureName === featureName) {
|
|
84
|
+
featureOpt.title = payload.newTitle;
|
|
85
|
+
}
|
|
82
86
|
|
|
83
87
|
if (featureName && !oldName) {
|
|
84
88
|
// Create
|
|
@@ -116,7 +116,8 @@ function assembleSeriesWithCategoryAxis(series) {
|
|
|
116
116
|
}));
|
|
117
117
|
var columns = [categoryAxis.model.getCategories()];
|
|
118
118
|
zrUtil.each(group.series, function (series) {
|
|
119
|
-
|
|
119
|
+
var rawData = series.getRawData();
|
|
120
|
+
columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {
|
|
120
121
|
return val;
|
|
121
122
|
}));
|
|
122
123
|
}); // Assemble table content
|
|
@@ -242,7 +243,15 @@ function parseListContents(str) {
|
|
|
242
243
|
var data = [];
|
|
243
244
|
|
|
244
245
|
for (var i = 0; i < lines.length; i++) {
|
|
245
|
-
|
|
246
|
+
// if line is empty, ignore it.
|
|
247
|
+
// there is a case that a user forgot to delete `\n`.
|
|
248
|
+
var line = trim(lines[i]);
|
|
249
|
+
|
|
250
|
+
if (!line) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
var items = line.split(itemSplitRegex);
|
|
246
255
|
var name = '';
|
|
247
256
|
var value;
|
|
248
257
|
var hasName = false;
|
|
@@ -449,14 +458,20 @@ function tryMergeDataOption(newData, originalData) {
|
|
|
449
458
|
var original = originalData && originalData[idx];
|
|
450
459
|
|
|
451
460
|
if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {
|
|
452
|
-
|
|
453
|
-
newVal = newVal.value;
|
|
454
|
-
} // Original data has option
|
|
461
|
+
var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);
|
|
455
462
|
|
|
463
|
+
if (!newValIsObject) {
|
|
464
|
+
newVal = {
|
|
465
|
+
value: newVal
|
|
466
|
+
};
|
|
467
|
+
} // original data has name but new data has no name
|
|
456
468
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
469
|
+
|
|
470
|
+
var shouldDeleteName = original.name != null && newVal.name == null; // Original data has option
|
|
471
|
+
|
|
472
|
+
newVal = zrUtil.defaults(newVal, original);
|
|
473
|
+
shouldDeleteName && delete newVal.name;
|
|
474
|
+
return newVal;
|
|
460
475
|
} else {
|
|
461
476
|
return newVal;
|
|
462
477
|
}
|