echarts 4.5.0 → 4.6.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/dist/echarts-en.common.js +1790 -774
- package/dist/echarts-en.common.min.js +1 -1
- package/dist/echarts-en.js +2029 -849
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +1 -1
- package/dist/echarts-en.simple.js +1676 -691
- package/dist/echarts-en.simple.min.js +1 -1
- package/dist/echarts.common.js +1790 -774
- package/dist/echarts.common.min.js +1 -1
- package/dist/echarts.js +2029 -849
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +1 -1
- package/dist/echarts.simple.js +1676 -691
- package/dist/echarts.simple.min.js +1 -1
- package/lib/chart/bar/BarView.js +11 -1
- package/lib/chart/bar/BaseBarSeries.js +3 -1
- package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
- package/lib/chart/funnel/FunnelSeries.js +15 -5
- package/lib/chart/gauge/GaugeSeries.js +0 -2
- package/lib/chart/graph/GraphSeries.js +9 -4
- package/lib/chart/graph/GraphView.js +28 -8
- package/lib/chart/heatmap/HeatmapView.js +4 -4
- package/lib/chart/helper/createListFromArray.js +14 -8
- package/lib/chart/helper/whiskerBoxCommon.js +22 -16
- package/lib/chart/line/LineSeries.js +3 -1
- package/lib/chart/line/LineView.js +8 -2
- package/lib/chart/map/MapSeries.js +8 -1
- package/lib/chart/pie/PieSeries.js +27 -6
- package/lib/chart/pie/PieView.js +1 -1
- package/lib/chart/pie/labelLayout.js +102 -19
- package/lib/chart/pie/pieLayout.js +19 -7
- package/lib/chart/radar/RadarSeries.js +3 -3
- package/lib/chart/sankey/SankeyView.js +28 -9
- package/lib/chart/scatter/ScatterSeries.js +3 -1
- package/lib/chart/themeRiver/ThemeRiverSeries.js +3 -3
- package/lib/chart/tree/TreeSeries.js +15 -1
- package/lib/component/axis/AngleAxisView.js +64 -7
- package/lib/component/axis/AxisBuilder.js +63 -24
- package/lib/component/axis/CartesianAxisView.js +55 -11
- package/lib/component/axis/RadiusAxisView.js +36 -4
- package/lib/component/dataZoom/SliderZoomView.js +4 -10
- package/lib/component/helper/BrushController.js +33 -43
- package/lib/component/legend/LegendModel.js +3 -3
- package/lib/component/legend/LegendView.js +17 -13
- package/lib/component/toolbox/ToolboxView.js +5 -1
- package/lib/component/toolbox/feature/MagicType.js +19 -14
- package/lib/coord/Axis.js +30 -2
- package/lib/coord/axisDefault.js +21 -2
- package/lib/data/DataDimensionInfo.js +157 -0
- package/lib/data/List.js +25 -19
- package/lib/data/Tree.js +2 -1
- 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 +2 -2
- package/lib/layout/barGrid.js +2 -3
- package/lib/model/Series.js +3 -3
- package/lib/model/referHelper.js +40 -12
- package/lib/scale/Interval.js +87 -2
- package/lib/scale/Log.js +9 -2
- package/lib/scale/helper.js +1 -43
- package/lib/theme/dark.js +3 -0
- package/lib/util/graphic.js +1 -2
- package/lib/visual/LegendVisualProvider.js +75 -0
- package/lib/visual/dataColor.js +2 -12
- package/lib/visual/seriesColor.js +15 -7
- package/map/json/province/tianjin.json +1 -1
- package/package.json +3 -2
- package/src/chart/bar/BarView.js +12 -2
- package/src/chart/bar/BaseBarSeries.js +1 -1
- package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
- package/src/chart/funnel/FunnelSeries.js +11 -4
- package/src/chart/gauge/GaugeSeries.js +0 -1
- package/src/chart/graph/GraphSeries.js +8 -3
- package/src/chart/graph/GraphView.js +26 -8
- package/src/chart/heatmap/HeatmapView.js +4 -4
- package/src/chart/helper/createListFromArray.js +13 -8
- package/src/chart/helper/whiskerBoxCommon.js +21 -16
- package/src/chart/line/LineSeries.js +1 -1
- package/src/chart/line/LineView.js +6 -1
- package/src/chart/map/MapSeries.js +5 -1
- package/src/chart/pie/PieSeries.js +26 -5
- package/src/chart/pie/PieView.js +1 -1
- package/src/chart/pie/labelLayout.js +114 -22
- package/src/chart/pie/pieLayout.js +20 -7
- package/src/chart/radar/RadarSeries.js +5 -3
- package/src/chart/sankey/SankeyView.js +26 -9
- package/src/chart/scatter/ScatterSeries.js +1 -1
- package/src/chart/themeRiver/ThemeRiverSeries.js +4 -3
- package/src/chart/tree/TreeSeries.js +12 -1
- package/src/component/axis/AngleAxisView.js +75 -7
- package/src/component/axis/AxisBuilder.js +78 -33
- package/src/component/axis/CartesianAxisView.js +58 -11
- package/src/component/axis/RadiusAxisView.js +37 -4
- package/src/component/dataZoom/SliderZoomView.js +4 -9
- package/src/component/helper/BrushController.js +40 -47
- package/src/component/legend/LegendModel.js +3 -3
- package/src/component/legend/LegendView.js +18 -12
- package/src/component/toolbox/ToolboxView.js +5 -0
- package/src/component/toolbox/feature/MagicType.js +18 -13
- package/src/coord/Axis.js +29 -2
- package/src/coord/axisDefault.js +25 -1
- package/src/data/DataDimensionInfo.js +135 -0
- package/src/data/List.js +29 -16
- package/src/data/Tree.js +3 -1
- 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 +2 -2
- package/src/layout/barGrid.js +6 -3
- package/src/model/Series.js +3 -3
- package/src/model/referHelper.js +34 -11
- package/src/scale/Interval.js +84 -4
- package/src/scale/Log.js +9 -2
- package/src/scale/helper.js +1 -39
- package/src/theme/dark.js +3 -0
- package/src/util/graphic.js +1 -2
- package/src/visual/LegendVisualProvider.js +55 -0
- package/src/visual/dataColor.js +0 -13
- package/src/visual/seriesColor.js +13 -7
- 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
package/lib/chart/bar/BarView.js
CHANGED
|
@@ -396,9 +396,14 @@ var getLayout = {
|
|
|
396
396
|
}
|
|
397
397
|
};
|
|
398
398
|
|
|
399
|
+
function isZeroOnPolar(layout) {
|
|
400
|
+
return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;
|
|
401
|
+
}
|
|
402
|
+
|
|
399
403
|
function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) {
|
|
400
404
|
var color = data.getItemVisual(dataIndex, 'color');
|
|
401
405
|
var opacity = data.getItemVisual(dataIndex, 'opacity');
|
|
406
|
+
var stroke = data.getVisual('borderColor');
|
|
402
407
|
var itemStyleModel = itemModel.getModel('itemStyle');
|
|
403
408
|
var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle();
|
|
404
409
|
|
|
@@ -407,7 +412,8 @@ function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHori
|
|
|
407
412
|
}
|
|
408
413
|
|
|
409
414
|
el.useStyle(zrUtil.defaults({
|
|
410
|
-
|
|
415
|
+
stroke: isZeroOnPolar(layout) ? 'none' : stroke,
|
|
416
|
+
fill: isZeroOnPolar(layout) ? 'none' : color,
|
|
411
417
|
opacity: opacity
|
|
412
418
|
}, itemStyleModel.getBarItemStyle()));
|
|
413
419
|
var cursorStyle = itemModel.getShallow('cursor');
|
|
@@ -418,6 +424,10 @@ function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHori
|
|
|
418
424
|
setLabel(el.style, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside);
|
|
419
425
|
}
|
|
420
426
|
|
|
427
|
+
if (isZeroOnPolar(layout)) {
|
|
428
|
+
hoverStyle.fill = hoverStyle.stroke = 'none';
|
|
429
|
+
}
|
|
430
|
+
|
|
421
431
|
graphic.setHoverStyle(el, hoverStyle);
|
|
422
432
|
} // In case width or height are too small.
|
|
423
433
|
|
|
@@ -43,7 +43,9 @@ var createListFromArray = require("../helper/createListFromArray");
|
|
|
43
43
|
var _default = SeriesModel.extend({
|
|
44
44
|
type: 'series.__base_bar__',
|
|
45
45
|
getInitialData: function (option, ecModel) {
|
|
46
|
-
return createListFromArray(this.getSource(), this
|
|
46
|
+
return createListFromArray(this.getSource(), this, {
|
|
47
|
+
useEncodeDefaulter: true
|
|
48
|
+
});
|
|
47
49
|
},
|
|
48
50
|
getMarkerPosition: function (value) {
|
|
49
51
|
var coordSys = this.coordinateSystem;
|
|
@@ -44,7 +44,9 @@ var _default = SeriesModel.extend({
|
|
|
44
44
|
type: 'series.effectScatter',
|
|
45
45
|
dependencies: ['grid', 'polar'],
|
|
46
46
|
getInitialData: function (option, ecModel) {
|
|
47
|
-
return createListFromArray(this.getSource(), this
|
|
47
|
+
return createListFromArray(this.getSource(), this, {
|
|
48
|
+
useEncodeDefaulter: true
|
|
49
|
+
});
|
|
48
50
|
},
|
|
49
51
|
brushSelector: 'point',
|
|
50
52
|
defaultOption: {
|
|
@@ -20,12 +20,22 @@
|
|
|
20
20
|
|
|
21
21
|
var echarts = require("../../echarts");
|
|
22
22
|
|
|
23
|
+
var zrUtil = require("zrender/lib/core/util");
|
|
24
|
+
|
|
25
|
+
var bind = zrUtil.bind;
|
|
26
|
+
|
|
23
27
|
var createListSimply = require("../helper/createListSimply");
|
|
24
28
|
|
|
25
29
|
var _model = require("../../util/model");
|
|
26
30
|
|
|
27
31
|
var defaultEmphasis = _model.defaultEmphasis;
|
|
28
32
|
|
|
33
|
+
var _sourceHelper = require("../../data/helper/sourceHelper");
|
|
34
|
+
|
|
35
|
+
var makeSeriesEncodeForNameBased = _sourceHelper.makeSeriesEncodeForNameBased;
|
|
36
|
+
|
|
37
|
+
var LegendVisualProvider = require("../../visual/LegendVisualProvider");
|
|
38
|
+
|
|
29
39
|
/*
|
|
30
40
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
31
41
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -50,15 +60,15 @@ var FunnelSeries = echarts.extendSeriesModel({
|
|
|
50
60
|
FunnelSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item
|
|
51
61
|
// Use a function instead of direct access because data reference may changed
|
|
52
62
|
|
|
53
|
-
this.
|
|
54
|
-
return this.getRawData();
|
|
55
|
-
}; // Extend labelLine emphasis
|
|
56
|
-
|
|
63
|
+
this.legendVisualProvider = new LegendVisualProvider(bind(this.getData, this), bind(this.getRawData, this)); // Extend labelLine emphasis
|
|
57
64
|
|
|
58
65
|
this._defaultLabelLine(option);
|
|
59
66
|
},
|
|
60
67
|
getInitialData: function (option, ecModel) {
|
|
61
|
-
return createListSimply(this,
|
|
68
|
+
return createListSimply(this, {
|
|
69
|
+
coordDimensions: ['value'],
|
|
70
|
+
encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)
|
|
71
|
+
});
|
|
62
72
|
},
|
|
63
73
|
_defaultLabelLine: function (option) {
|
|
64
74
|
// Extend labelLine emphasis
|
|
@@ -22,8 +22,6 @@ var createListSimply = require("../helper/createListSimply");
|
|
|
22
22
|
|
|
23
23
|
var SeriesModel = require("../../model/Series");
|
|
24
24
|
|
|
25
|
-
var zrUtil = require("zrender/lib/core/util");
|
|
26
|
-
|
|
27
25
|
/*
|
|
28
26
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
29
27
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -36,6 +36,8 @@ var encodeHTML = _format.encodeHTML;
|
|
|
36
36
|
|
|
37
37
|
var createGraphFromNodeEdge = require("../helper/createGraphFromNodeEdge");
|
|
38
38
|
|
|
39
|
+
var LegendVisualProvider = require("../../visual/LegendVisualProvider");
|
|
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
|
|
@@ -57,12 +59,15 @@ var createGraphFromNodeEdge = require("../helper/createGraphFromNodeEdge");
|
|
|
57
59
|
var GraphSeries = echarts.extendSeriesModel({
|
|
58
60
|
type: 'series.graph',
|
|
59
61
|
init: function (option) {
|
|
60
|
-
GraphSeries.superApply(this, 'init', arguments);
|
|
62
|
+
GraphSeries.superApply(this, 'init', arguments);
|
|
63
|
+
var self = this;
|
|
64
|
+
|
|
65
|
+
function getCategoriesData() {
|
|
66
|
+
return self._categoriesData;
|
|
67
|
+
} // Provide data for legend select
|
|
61
68
|
|
|
62
|
-
this.legendDataProvider = function () {
|
|
63
|
-
return this._categoriesData;
|
|
64
|
-
};
|
|
65
69
|
|
|
70
|
+
this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);
|
|
66
71
|
this.fillDataTextStyle(option.edges || option.links);
|
|
67
72
|
|
|
68
73
|
this._updateCategoriesData();
|
|
@@ -122,6 +122,7 @@ var _default = echarts.extendChartView({
|
|
|
122
122
|
this._firstRender = true;
|
|
123
123
|
},
|
|
124
124
|
render: function (seriesModel, ecModel, api) {
|
|
125
|
+
var graphView = this;
|
|
125
126
|
var coordSys = seriesModel.coordinateSystem;
|
|
126
127
|
this._model = seriesModel;
|
|
127
128
|
var symbolDraw = this._symbolDraw;
|
|
@@ -188,6 +189,8 @@ var _default = echarts.extendChartView({
|
|
|
188
189
|
|
|
189
190
|
if (itemModel.get('focusNodeAdjacency')) {
|
|
190
191
|
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
|
|
192
|
+
graphView._clearTimer();
|
|
193
|
+
|
|
191
194
|
api.dispatchAction({
|
|
192
195
|
type: 'focusNodeAdjacency',
|
|
193
196
|
seriesId: seriesModel.id,
|
|
@@ -195,10 +198,7 @@ var _default = echarts.extendChartView({
|
|
|
195
198
|
});
|
|
196
199
|
});
|
|
197
200
|
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
|
|
198
|
-
|
|
199
|
-
type: 'unfocusNodeAdjacency',
|
|
200
|
-
seriesId: seriesModel.id
|
|
201
|
-
});
|
|
201
|
+
graphView._dispatchUnfocus(api);
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
}, this);
|
|
@@ -209,6 +209,8 @@ var _default = echarts.extendChartView({
|
|
|
209
209
|
|
|
210
210
|
if (edge.getModel().get('focusNodeAdjacency')) {
|
|
211
211
|
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
|
|
212
|
+
graphView._clearTimer();
|
|
213
|
+
|
|
212
214
|
api.dispatchAction({
|
|
213
215
|
type: 'focusNodeAdjacency',
|
|
214
216
|
seriesId: seriesModel.id,
|
|
@@ -216,10 +218,7 @@ var _default = echarts.extendChartView({
|
|
|
216
218
|
});
|
|
217
219
|
});
|
|
218
220
|
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
|
|
219
|
-
|
|
220
|
-
type: 'unfocusNodeAdjacency',
|
|
221
|
-
seriesId: seriesModel.id
|
|
222
|
-
});
|
|
221
|
+
graphView._dispatchUnfocus(api);
|
|
223
222
|
});
|
|
224
223
|
}
|
|
225
224
|
});
|
|
@@ -264,6 +263,27 @@ var _default = echarts.extendChartView({
|
|
|
264
263
|
dispose: function () {
|
|
265
264
|
this._controller && this._controller.dispose();
|
|
266
265
|
this._controllerHost = {};
|
|
266
|
+
|
|
267
|
+
this._clearTimer();
|
|
268
|
+
},
|
|
269
|
+
_dispatchUnfocus: function (api, opt) {
|
|
270
|
+
var self = this;
|
|
271
|
+
|
|
272
|
+
this._clearTimer();
|
|
273
|
+
|
|
274
|
+
this._unfocusDelayTimer = setTimeout(function () {
|
|
275
|
+
self._unfocusDelayTimer = null;
|
|
276
|
+
api.dispatchAction({
|
|
277
|
+
type: 'unfocusNodeAdjacency',
|
|
278
|
+
seriesId: self._model.id
|
|
279
|
+
});
|
|
280
|
+
}, 500);
|
|
281
|
+
},
|
|
282
|
+
_clearTimer: function () {
|
|
283
|
+
if (this._unfocusDelayTimer) {
|
|
284
|
+
clearTimeout(this._unfocusDelayTimer);
|
|
285
|
+
this._unfocusDelayTimer = null;
|
|
286
|
+
}
|
|
267
287
|
},
|
|
268
288
|
focusNodeAdjacency: function (seriesModel, ecModel, api, payload) {
|
|
269
289
|
var data = this._model.getData();
|
|
@@ -166,10 +166,10 @@ var _default = echarts.extendChartView({
|
|
|
166
166
|
var point = coordSys.dataToPoint([data.get(dataDims[0], idx), data.get(dataDims[1], idx)]);
|
|
167
167
|
rect = new graphic.Rect({
|
|
168
168
|
shape: {
|
|
169
|
-
x: point[0] - width / 2,
|
|
170
|
-
y: point[1] - height / 2,
|
|
171
|
-
width: width,
|
|
172
|
-
height: height
|
|
169
|
+
x: Math.floor(point[0] - width / 2),
|
|
170
|
+
y: Math.floor(point[1] - height / 2),
|
|
171
|
+
width: Math.ceil(width),
|
|
172
|
+
height: Math.ceil(height)
|
|
173
173
|
},
|
|
174
174
|
style: {
|
|
175
175
|
fill: data.getItemVisual(idx, 'color'),
|
|
@@ -40,7 +40,7 @@ var CoordinateSystem = require("../../CoordinateSystem");
|
|
|
40
40
|
|
|
41
41
|
var _referHelper = require("../../model/referHelper");
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var getCoordSysInfoBySeries = _referHelper.getCoordSysInfoBySeries;
|
|
44
44
|
|
|
45
45
|
var Source = require("../../data/Source");
|
|
46
46
|
|
|
@@ -48,6 +48,10 @@ var _dataStackHelper = require("../../data/helper/dataStackHelper");
|
|
|
48
48
|
|
|
49
49
|
var enableDataStack = _dataStackHelper.enableDataStack;
|
|
50
50
|
|
|
51
|
+
var _sourceHelper = require("../../data/helper/sourceHelper");
|
|
52
|
+
|
|
53
|
+
var makeSeriesEncodeForAxisCoordSys = _sourceHelper.makeSeriesEncodeForAxisCoordSys;
|
|
54
|
+
|
|
51
55
|
/*
|
|
52
56
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
53
57
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -72,6 +76,7 @@ var enableDataStack = _dataStackHelper.enableDataStack;
|
|
|
72
76
|
* @param {module:echarts/model/Series} seriesModel
|
|
73
77
|
* @param {Object} [opt]
|
|
74
78
|
* @param {string} [opt.generateCoord]
|
|
79
|
+
* @param {boolean} [opt.useEncodeDefaulter]
|
|
75
80
|
*/
|
|
76
81
|
function createListFromArray(source, seriesModel, opt) {
|
|
77
82
|
opt = opt || {};
|
|
@@ -82,15 +87,15 @@ function createListFromArray(source, seriesModel, opt) {
|
|
|
82
87
|
|
|
83
88
|
var coordSysName = seriesModel.get('coordinateSystem');
|
|
84
89
|
var registeredCoordSys = CoordinateSystem.get(coordSysName);
|
|
85
|
-
var
|
|
90
|
+
var coordSysInfo = getCoordSysInfoBySeries(seriesModel);
|
|
86
91
|
var coordSysDimDefs;
|
|
87
92
|
|
|
88
|
-
if (
|
|
89
|
-
coordSysDimDefs = zrUtil.map(
|
|
93
|
+
if (coordSysInfo) {
|
|
94
|
+
coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {
|
|
90
95
|
var dimInfo = {
|
|
91
96
|
name: dim
|
|
92
97
|
};
|
|
93
|
-
var axisModel =
|
|
98
|
+
var axisModel = coordSysInfo.axisMap.get(dim);
|
|
94
99
|
|
|
95
100
|
if (axisModel) {
|
|
96
101
|
var axisType = axisModel.get('type');
|
|
@@ -108,13 +113,14 @@ function createListFromArray(source, seriesModel, opt) {
|
|
|
108
113
|
|
|
109
114
|
var dimInfoList = createDimensions(source, {
|
|
110
115
|
coordDimensions: coordSysDimDefs,
|
|
111
|
-
generateCoord: opt.generateCoord
|
|
116
|
+
generateCoord: opt.generateCoord,
|
|
117
|
+
encodeDefaulter: opt.useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null
|
|
112
118
|
});
|
|
113
119
|
var firstCategoryDimIndex;
|
|
114
120
|
var hasNameEncode;
|
|
115
|
-
|
|
121
|
+
coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {
|
|
116
122
|
var coordDim = dimInfo.coordDim;
|
|
117
|
-
var categoryAxisModel =
|
|
123
|
+
var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);
|
|
118
124
|
|
|
119
125
|
if (categoryAxisModel) {
|
|
120
126
|
if (firstCategoryDimIndex == null) {
|
|
@@ -26,6 +26,10 @@ var _dimensionHelper = require("../../data/helper/dimensionHelper");
|
|
|
26
26
|
|
|
27
27
|
var getDimensionTypeByAxis = _dimensionHelper.getDimensionTypeByAxis;
|
|
28
28
|
|
|
29
|
+
var _sourceHelper = require("../../data/helper/sourceHelper");
|
|
30
|
+
|
|
31
|
+
var makeSeriesEncodeForAxisCoordSys = _sourceHelper.makeSeriesEncodeForAxisCoordSys;
|
|
32
|
+
|
|
29
33
|
/*
|
|
30
34
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
31
35
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -64,7 +68,7 @@ var seriesModelMixin = {
|
|
|
64
68
|
var xAxisType = xAxisModel.get('type');
|
|
65
69
|
var yAxisType = yAxisModel.get('type');
|
|
66
70
|
var addOrdinal; // FIXME
|
|
67
|
-
//
|
|
71
|
+
// Consider time axis.
|
|
68
72
|
|
|
69
73
|
if (xAxisType === 'category') {
|
|
70
74
|
option.layout = 'horizontal';
|
|
@@ -109,22 +113,24 @@ var seriesModelMixin = {
|
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
var defaultValueDimensions = this.defaultValueDimensions;
|
|
116
|
+
var coordDimensions = [{
|
|
117
|
+
name: baseAxisDim,
|
|
118
|
+
type: getDimensionTypeByAxis(baseAxisType),
|
|
119
|
+
ordinalMeta: ordinalMeta,
|
|
120
|
+
otherDims: {
|
|
121
|
+
tooltip: false,
|
|
122
|
+
itemName: 0
|
|
123
|
+
},
|
|
124
|
+
dimsDef: ['base']
|
|
125
|
+
}, {
|
|
126
|
+
name: otherAxisDim,
|
|
127
|
+
type: getDimensionTypeByAxis(otherAxisType),
|
|
128
|
+
dimsDef: defaultValueDimensions.slice()
|
|
129
|
+
}];
|
|
112
130
|
return createListSimply(this, {
|
|
113
|
-
coordDimensions:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
ordinalMeta: ordinalMeta,
|
|
117
|
-
otherDims: {
|
|
118
|
-
tooltip: false,
|
|
119
|
-
itemName: 0
|
|
120
|
-
},
|
|
121
|
-
dimsDef: ['base']
|
|
122
|
-
}, {
|
|
123
|
-
name: otherAxisDim,
|
|
124
|
-
type: getDimensionTypeByAxis(otherAxisType),
|
|
125
|
-
dimsDef: defaultValueDimensions.slice()
|
|
126
|
-
}],
|
|
127
|
-
dimensionsCount: defaultValueDimensions.length + 1
|
|
131
|
+
coordDimensions: coordDimensions,
|
|
132
|
+
dimensionsCount: defaultValueDimensions.length + 1,
|
|
133
|
+
encodeDefaulter: zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)
|
|
128
134
|
});
|
|
129
135
|
},
|
|
130
136
|
|
|
@@ -48,7 +48,9 @@ var _default = SeriesModel.extend({
|
|
|
48
48
|
type: 'series.line',
|
|
49
49
|
dependencies: ['grid', 'polar'],
|
|
50
50
|
getInitialData: function (option, ecModel) {
|
|
51
|
-
return createListFromArray(this.getSource(), this
|
|
51
|
+
return createListFromArray(this.getSource(), this, {
|
|
52
|
+
useEncodeDefaulter: true
|
|
53
|
+
});
|
|
52
54
|
},
|
|
53
55
|
defaultOption: {
|
|
54
56
|
zlevel: 0,
|
|
@@ -368,7 +368,7 @@ var _default = ChartView.extend({
|
|
|
368
368
|
var step = !isCoordSysPolar && seriesModel.get('step');
|
|
369
369
|
var clipShapeForSymbol;
|
|
370
370
|
|
|
371
|
-
if (coordSys && coordSys.getArea) {
|
|
371
|
+
if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {
|
|
372
372
|
clipShapeForSymbol = coordSys.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.
|
|
373
373
|
// See #7913 and `test/dataZoom-clip.html`.
|
|
374
374
|
|
|
@@ -381,8 +381,9 @@ var _default = ChartView.extend({
|
|
|
381
381
|
clipShapeForSymbol.r0 -= 0.5;
|
|
382
382
|
clipShapeForSymbol.r1 += 0.5;
|
|
383
383
|
}
|
|
384
|
-
}
|
|
384
|
+
}
|
|
385
385
|
|
|
386
|
+
this._clipShapeForSymbol = clipShapeForSymbol; // Initialization animation or coordinate system changed
|
|
386
387
|
|
|
387
388
|
if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {
|
|
388
389
|
showSymbol && symbolDraw.updateData(data, {
|
|
@@ -509,6 +510,11 @@ var _default = ChartView.extend({
|
|
|
509
510
|
if (!pt) {
|
|
510
511
|
// Null data
|
|
511
512
|
return;
|
|
513
|
+
} // fix #11360: should't draw symbol outside clipShapeForSymbol
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(pt[0], pt[1])) {
|
|
517
|
+
return;
|
|
512
518
|
}
|
|
513
519
|
|
|
514
520
|
symbol = new SymbolClz(data, dataIndex);
|
|
@@ -37,6 +37,10 @@ var retrieveRawAttr = _dataProvider.retrieveRawAttr;
|
|
|
37
37
|
|
|
38
38
|
var geoSourceManager = require("../../coord/geo/geoSourceManager");
|
|
39
39
|
|
|
40
|
+
var _sourceHelper = require("../../data/helper/sourceHelper");
|
|
41
|
+
|
|
42
|
+
var makeSeriesEncodeForNameBased = _sourceHelper.makeSeriesEncodeForNameBased;
|
|
43
|
+
|
|
40
44
|
/*
|
|
41
45
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
42
46
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -72,7 +76,10 @@ var MapSeries = SeriesModel.extend({
|
|
|
72
76
|
*/
|
|
73
77
|
seriesGroup: [],
|
|
74
78
|
getInitialData: function (option) {
|
|
75
|
-
var data = createListSimply(this,
|
|
79
|
+
var data = createListSimply(this, {
|
|
80
|
+
coordDimensions: ['value'],
|
|
81
|
+
encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)
|
|
82
|
+
});
|
|
76
83
|
var valueDim = data.mapDimension('value');
|
|
77
84
|
var dataNameMap = zrUtil.createHashMap();
|
|
78
85
|
var selectTargetList = [];
|
|
@@ -36,6 +36,12 @@ var _dataProvider = require("../../data/helper/dataProvider");
|
|
|
36
36
|
|
|
37
37
|
var retrieveRawAttr = _dataProvider.retrieveRawAttr;
|
|
38
38
|
|
|
39
|
+
var _sourceHelper = require("../../data/helper/sourceHelper");
|
|
40
|
+
|
|
41
|
+
var makeSeriesEncodeForNameBased = _sourceHelper.makeSeriesEncodeForNameBased;
|
|
42
|
+
|
|
43
|
+
var LegendVisualProvider = require("../../visual/LegendVisualProvider");
|
|
44
|
+
|
|
39
45
|
/*
|
|
40
46
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
41
47
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -61,10 +67,7 @@ var PieSeries = echarts.extendSeriesModel({
|
|
|
61
67
|
PieSeries.superApply(this, 'init', arguments); // Enable legend selection for each data item
|
|
62
68
|
// Use a function instead of direct access because data reference may changed
|
|
63
69
|
|
|
64
|
-
this.
|
|
65
|
-
return this.getRawData();
|
|
66
|
-
};
|
|
67
|
-
|
|
70
|
+
this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));
|
|
68
71
|
this.updateSelectedMap(this._createSelectableList());
|
|
69
72
|
|
|
70
73
|
this._defaultLabelLine(option);
|
|
@@ -75,7 +78,10 @@ var PieSeries = echarts.extendSeriesModel({
|
|
|
75
78
|
this.updateSelectedMap(this._createSelectableList());
|
|
76
79
|
},
|
|
77
80
|
getInitialData: function (option, ecModel) {
|
|
78
|
-
return createListSimply(this,
|
|
81
|
+
return createListSimply(this, {
|
|
82
|
+
coordDimensions: ['value'],
|
|
83
|
+
encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)
|
|
84
|
+
});
|
|
79
85
|
},
|
|
80
86
|
_createSelectableList: function () {
|
|
81
87
|
var data = this.getRawData();
|
|
@@ -144,12 +150,27 @@ var PieSeries = echarts.extendSeriesModel({
|
|
|
144
150
|
// If still show when all data zero.
|
|
145
151
|
stillShowZeroSum: true,
|
|
146
152
|
// cursor: null,
|
|
153
|
+
left: 0,
|
|
154
|
+
top: 0,
|
|
155
|
+
right: 0,
|
|
156
|
+
bottom: 0,
|
|
157
|
+
width: null,
|
|
158
|
+
height: null,
|
|
147
159
|
label: {
|
|
148
160
|
// If rotate around circle
|
|
149
161
|
rotate: false,
|
|
150
162
|
show: true,
|
|
151
163
|
// 'outer', 'inside', 'center'
|
|
152
|
-
position: 'outer'
|
|
164
|
+
position: 'outer',
|
|
165
|
+
// 'none', 'labelLine', 'edge'. Works only when position is 'outer'
|
|
166
|
+
alignTo: 'none',
|
|
167
|
+
// Closest distance between label and chart edge.
|
|
168
|
+
// Works only position is 'outer' and alignTo is 'edge'.
|
|
169
|
+
margin: '25%',
|
|
170
|
+
// Works only position is 'outer' and alignTo is not 'edge'.
|
|
171
|
+
bleedMargin: 10,
|
|
172
|
+
// Distance between text and label line.
|
|
173
|
+
distanceToLabelLine: 5 // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
|
|
153
174
|
// 默认使用全局文本样式,详见TEXTSTYLE
|
|
154
175
|
// distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
|
|
155
176
|
|
package/lib/chart/pie/PieView.js
CHANGED
|
@@ -242,7 +242,7 @@ piePieceProto._updateLabel = function (data, idx, withAnimation) {
|
|
|
242
242
|
graphic.setLabelStyle(labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, {
|
|
243
243
|
labelFetcher: data.hostModel,
|
|
244
244
|
labelDataIndex: idx,
|
|
245
|
-
defaultText:
|
|
245
|
+
defaultText: labelLayout.text,
|
|
246
246
|
autoColor: visualColor,
|
|
247
247
|
useInsideStyle: !!labelLayout.inside
|
|
248
248
|
}, {
|