echarts 3.5.1 → 3.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/LICENSE +21 -18
- package/README.md +10 -0
- package/dist/echarts.common.js +11010 -9830
- package/dist/echarts.common.min.js +13 -13
- package/dist/echarts.js +13291 -10852
- package/dist/echarts.min.js +22 -21
- package/dist/echarts.simple.js +9904 -8990
- package/dist/echarts.simple.min.js +9 -10
- package/index.js +1 -0
- package/lib/ExtensionAPI.js +2 -4
- package/lib/chart/bar/BarView.js +141 -49
- package/lib/chart/bar/BaseBarSeries.js +2 -6
- package/lib/chart/bar.js +1 -0
- package/lib/chart/boxplot/BoxplotSeries.js +1 -1
- package/lib/chart/boxplot/boxplotLayout.js +23 -7
- package/lib/chart/candlestick/CandlestickSeries.js +3 -22
- package/lib/chart/candlestick/candlestickLayout.js +23 -7
- package/lib/chart/custom.js +442 -0
- package/lib/chart/funnel/funnelLayout.js +10 -3
- package/lib/chart/gauge/GaugeView.js +1 -1
- package/lib/chart/graph/GraphView.js +15 -9
- package/lib/chart/graph/categoryVisual.js +3 -2
- package/lib/chart/heatmap/HeatmapLayer.js +1 -1
- package/lib/chart/heatmap/HeatmapView.js +75 -73
- package/lib/chart/helper/Symbol.js +8 -31
- package/lib/chart/helper/createListFromArray.js +15 -10
- package/lib/chart/helper/labelHelper.js +48 -0
- package/lib/chart/helper/whiskerBoxCommon.js +25 -44
- package/lib/chart/map/mapDataStatistic.js +9 -8
- package/lib/chart/parallel/ParallelSeries.js +2 -0
- package/lib/chart/parallel/ParallelView.js +13 -12
- package/lib/chart/parallel/parallelVisual.js +9 -1
- package/lib/chart/pie/pieLayout.js +25 -17
- package/lib/chart/radar/RadarSeries.js +1 -1
- package/lib/chart/sankey/sankeyLayout.js +1 -1
- package/lib/chart/scatter/ScatterSeries.js +2 -3
- package/lib/chart/themeRiver/ThemeRiverSeries.js +6 -5
- package/lib/chart/themeRiver/themeRiverVisual.js +1 -1
- package/lib/chart/treemap/TreemapSeries.js +3 -3
- package/lib/chart/treemap/TreemapView.js +1 -1
- package/lib/chart/treemap/treemapLayout.js +6 -1
- package/lib/component/axis/AxisBuilder.js +53 -34
- package/lib/component/axis/ParallelAxisView.js +45 -37
- package/lib/component/axisPointer/AxisPointerModel.js +1 -1
- package/lib/component/axisPointer/BaseAxisPointer.js +20 -15
- package/lib/component/axisPointer/CartesianAxisPointer.js +9 -6
- package/lib/component/axisPointer/PolarAxisPointer.js +10 -8
- package/lib/component/axisPointer/SingleAxisPointer.js +11 -7
- package/lib/component/axisPointer/axisTrigger.js +87 -72
- package/lib/component/axisPointer/viewHelper.js +6 -3
- package/lib/component/axisPointer.js +2 -2
- package/lib/component/brush/BrushModel.js +6 -4
- package/lib/component/brush/BrushView.js +1 -1
- package/lib/component/brush/visualEncoding.js +6 -4
- package/lib/component/calendar/CalendarView.js +5 -5
- package/lib/component/dataZoom/AxisProxy.js +76 -13
- package/lib/component/dataZoom/DataZoomModel.js +21 -5
- package/lib/component/dataZoom/InsideZoomModel.js +4 -1
- package/lib/component/dataZoom/InsideZoomView.js +17 -27
- package/lib/component/dataZoom/SliderZoomView.js +63 -26
- package/lib/component/dataZoom/roams.js +9 -4
- package/lib/component/graphic.js +13 -12
- package/lib/component/helper/BrushController.js +75 -114
- package/lib/component/helper/BrushTargetManager.js +16 -8
- package/lib/component/helper/MapDraw.js +25 -11
- package/lib/component/helper/RoamController.js +111 -139
- package/lib/component/helper/brushHelper.js +25 -213
- package/lib/component/helper/cursorHelper.js +21 -0
- package/lib/component/helper/roamHelper.js +54 -0
- package/lib/component/helper/selectableMixin.js +7 -7
- package/lib/component/helper/sliderMove.js +66 -37
- package/lib/component/legend/LegendView.js +6 -6
- package/lib/component/legend/legendAction.js +1 -1
- package/lib/component/marker/MarkAreaView.js +3 -6
- package/lib/component/marker/MarkLineView.js +3 -5
- package/lib/component/marker/MarkPointView.js +3 -5
- package/lib/component/marker/MarkerView.js +10 -12
- package/lib/component/marker/markerHelper.js +1 -1
- package/lib/component/parallel.js +94 -29
- package/lib/component/polar.js +5 -0
- package/lib/component/timeline/SliderTimelineView.js +1 -1
- package/lib/component/toolbox/feature/Brush.js +7 -0
- package/lib/component/toolbox/feature/DataZoom.js +17 -4
- package/lib/component/tooltip/TooltipView.js +92 -20
- package/lib/component/visualMap/ContinuousView.js +6 -4
- package/lib/coord/Axis.js +34 -2
- package/lib/coord/axisDefault.js +4 -1
- package/lib/coord/axisHelper.js +32 -26
- package/lib/coord/axisModelCommonMixin.js +1 -1
- package/lib/coord/calendar/Calendar.js +14 -17
- package/lib/coord/calendar/prepareCustom.js +31 -0
- package/lib/coord/cartesian/Axis2D.js +0 -12
- package/lib/coord/cartesian/Cartesian2D.js +1 -0
- package/lib/coord/cartesian/Grid.js +5 -2
- package/lib/coord/cartesian/prepareCustom.js +36 -0
- package/lib/coord/geo/Geo.js +9 -14
- package/lib/coord/geo/GeoModel.js +5 -5
- package/lib/coord/geo/geoCreator.js +3 -3
- package/lib/coord/geo/parseGeoJson.js +11 -4
- package/lib/coord/geo/prepareCustom.js +36 -0
- package/lib/coord/parallel/Parallel.js +225 -101
- package/lib/coord/parallel/ParallelModel.js +7 -1
- package/lib/coord/polar/Polar.js +2 -1
- package/lib/coord/polar/prepareCustom.js +53 -0
- package/lib/coord/single/Single.js +9 -8
- package/lib/coord/single/SingleAxis.js +0 -27
- package/lib/coord/single/prepareCustom.js +33 -0
- package/lib/data/DataDiffer.js +2 -1
- package/lib/data/Graph.js +11 -7
- package/lib/data/List.js +59 -20
- package/lib/data/helper/completeDimensions.js +184 -23
- package/lib/echarts.js +68 -36
- package/lib/helper.js +1 -8
- package/lib/layout/barGrid.js +91 -19
- package/lib/layout/barPolar.js +286 -0
- package/lib/layout/points.js +22 -16
- package/lib/model/Global.js +34 -31
- package/lib/model/Series.js +41 -29
- package/lib/model/globalDefault.js +4 -1
- package/lib/model/mixin/colorPalette.js +2 -1
- package/lib/model/mixin/textStyle.js +7 -13
- package/lib/scale/Interval.js +46 -76
- package/lib/scale/Log.js +5 -7
- package/lib/scale/Scale.js +10 -1
- package/lib/scale/Time.js +34 -12
- package/lib/scale/helper.js +93 -0
- package/lib/util/format.js +20 -9
- package/lib/util/graphic.js +70 -8
- package/lib/util/layout.js +7 -3
- package/lib/util/model.js +63 -7
- package/lib/util/number.js +59 -19
- package/lib/util/throttle.js +14 -3
- package/map/js/world.js +1 -1
- package/map/json/world.json +1 -1
- package/package.json +3 -3
- package/src/ExtensionAPI.js +2 -4
- package/src/chart/bar/BarView.js +141 -49
- package/src/chart/bar/BaseBarSeries.js +2 -6
- package/src/chart/bar.js +1 -0
- package/src/chart/boxplot/BoxplotSeries.js +1 -1
- package/src/chart/boxplot/boxplotLayout.js +23 -7
- package/src/chart/candlestick/CandlestickSeries.js +3 -22
- package/src/chart/candlestick/candlestickLayout.js +23 -7
- package/src/chart/custom.js +442 -0
- package/src/chart/funnel/funnelLayout.js +10 -4
- package/src/chart/gauge/GaugeView.js +1 -1
- package/src/chart/graph/GraphView.js +15 -9
- package/src/chart/graph/categoryVisual.js +3 -2
- package/src/chart/heatmap/HeatmapLayer.js +1 -1
- package/src/chart/heatmap/HeatmapView.js +75 -73
- package/src/chart/helper/Symbol.js +8 -31
- package/src/chart/helper/createListFromArray.js +15 -10
- package/src/chart/helper/labelHelper.js +49 -0
- package/src/chart/helper/whiskerBoxCommon.js +25 -44
- package/src/chart/map/mapDataStatistic.js +9 -8
- package/src/chart/parallel/ParallelSeries.js +2 -0
- package/src/chart/parallel/ParallelView.js +13 -12
- package/src/chart/parallel/parallelVisual.js +9 -1
- package/src/chart/pie/pieLayout.js +25 -17
- package/src/chart/radar/RadarSeries.js +1 -1
- package/src/chart/sankey/sankeyLayout.js +1 -1
- package/src/chart/scatter/ScatterSeries.js +2 -3
- package/src/chart/themeRiver/ThemeRiverSeries.js +6 -5
- package/src/chart/themeRiver/themeRiverVisual.js +1 -1
- package/src/chart/treemap/TreemapSeries.js +3 -3
- package/src/chart/treemap/TreemapView.js +1 -1
- package/src/chart/treemap/treemapLayout.js +6 -1
- package/src/component/axis/AxisBuilder.js +53 -34
- package/src/component/axis/ParallelAxisView.js +45 -37
- package/src/component/axisPointer/AxisPointerModel.js +1 -1
- package/src/component/axisPointer/BaseAxisPointer.js +20 -15
- package/src/component/axisPointer/CartesianAxisPointer.js +9 -6
- package/src/component/axisPointer/PolarAxisPointer.js +10 -8
- package/src/component/axisPointer/SingleAxisPointer.js +11 -7
- package/src/component/axisPointer/axisTrigger.js +87 -72
- package/src/component/axisPointer/viewHelper.js +6 -3
- package/src/component/axisPointer.js +2 -2
- package/src/component/brush/BrushModel.js +6 -4
- package/src/component/brush/BrushView.js +1 -1
- package/src/component/brush/visualEncoding.js +6 -4
- package/src/component/calendar/CalendarView.js +5 -5
- package/src/component/dataZoom/AxisProxy.js +76 -13
- package/src/component/dataZoom/DataZoomModel.js +21 -5
- package/src/component/dataZoom/InsideZoomModel.js +4 -1
- package/src/component/dataZoom/InsideZoomView.js +17 -27
- package/src/component/dataZoom/SliderZoomView.js +63 -26
- package/src/component/dataZoom/roams.js +9 -4
- package/src/component/graphic.js +13 -12
- package/src/component/helper/BrushController.js +75 -114
- package/src/component/helper/BrushTargetManager.js +16 -8
- package/src/component/helper/MapDraw.js +25 -11
- package/src/component/helper/RoamController.js +111 -139
- package/src/component/helper/brushHelper.js +41 -0
- package/src/component/helper/cursorHelper.js +22 -0
- package/src/component/helper/roamHelper.js +55 -0
- package/src/component/helper/selectableMixin.js +7 -7
- package/src/component/helper/sliderMove.js +66 -37
- package/src/component/legend/LegendView.js +6 -6
- package/src/component/legend/legendAction.js +1 -1
- package/src/component/marker/MarkAreaView.js +3 -6
- package/src/component/marker/MarkLineView.js +3 -5
- package/src/component/marker/MarkPointView.js +3 -5
- package/src/component/marker/MarkerView.js +10 -12
- package/src/component/marker/markerHelper.js +1 -1
- package/src/component/parallel.js +94 -29
- package/src/component/polar.js +5 -0
- package/src/component/timeline/SliderTimelineView.js +1 -1
- package/src/component/toolbox/feature/Brush.js +7 -0
- package/src/component/toolbox/feature/DataZoom.js +17 -4
- package/src/component/tooltip/TooltipView.js +92 -20
- package/src/component/visualMap/ContinuousView.js +6 -4
- package/src/coord/Axis.js +34 -2
- package/src/coord/axisDefault.js +4 -1
- package/src/coord/axisHelper.js +32 -26
- package/src/coord/axisModelCommonMixin.js +1 -1
- package/src/coord/calendar/Calendar.js +14 -17
- package/src/coord/calendar/prepareCustom.js +32 -0
- package/src/coord/cartesian/Axis2D.js +0 -12
- package/src/coord/cartesian/Cartesian2D.js +1 -0
- package/src/coord/cartesian/Grid.js +5 -2
- package/src/coord/cartesian/prepareCustom.js +37 -0
- package/src/coord/geo/Geo.js +9 -14
- package/src/coord/geo/GeoModel.js +5 -5
- package/src/coord/geo/geoCreator.js +3 -3
- package/src/coord/geo/parseGeoJson.js +11 -4
- package/src/coord/geo/prepareCustom.js +37 -0
- package/src/coord/parallel/Parallel.js +225 -101
- package/src/coord/parallel/ParallelModel.js +7 -1
- package/src/coord/polar/Polar.js +2 -1
- package/src/coord/polar/prepareCustom.js +54 -0
- package/src/coord/single/Single.js +9 -8
- package/src/coord/single/SingleAxis.js +0 -27
- package/src/coord/single/prepareCustom.js +34 -0
- package/src/data/DataDiffer.js +2 -1
- package/src/data/Graph.js +11 -7
- package/src/data/List.js +59 -20
- package/src/data/helper/completeDimensions.js +184 -23
- package/src/echarts.js +68 -36
- package/src/helper.js +1 -8
- package/src/layout/barGrid.js +91 -19
- package/src/layout/barPolar.js +287 -0
- package/src/layout/points.js +22 -16
- package/src/model/Global.js +34 -31
- package/src/model/Series.js +41 -29
- package/src/model/globalDefault.js +4 -1
- package/src/model/mixin/colorPalette.js +2 -1
- package/src/model/mixin/textStyle.js +7 -13
- package/src/scale/Interval.js +46 -76
- package/src/scale/Log.js +5 -7
- package/src/scale/Scale.js +10 -1
- package/src/scale/Time.js +34 -12
- package/src/scale/helper.js +94 -0
- package/src/util/format.js +20 -9
- package/src/util/graphic.js +70 -8
- package/src/util/layout.js +7 -3
- package/src/util/model.js +63 -7
- package/src/util/number.js +59 -19
- package/src/util/throttle.js +14 -3
- package/src/coord/cartesian/axisLabelInterval.js +0 -26
- package/theme/default.js +0 -23
- package/theme/halloween.js +0 -528
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
|
|
113
112
|
var group = this.group;
|
|
114
113
|
var data = seriesModel.getData();
|
|
115
114
|
|
|
@@ -121,90 +120,93 @@
|
|
|
121
120
|
var hoverStl = seriesModel.getModel(hoverItemStyleQuery).getItemStyle();
|
|
122
121
|
var labelModel = seriesModel.getModel('label.normal');
|
|
123
122
|
var hoverLabelModel = seriesModel.getModel('label.emphasis');
|
|
123
|
+
var coordSysType = coordSys.type;
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
shape: {
|
|
144
|
-
x: point[0] - width / 2,
|
|
145
|
-
y: point[1] - height / 2,
|
|
146
|
-
width: width,
|
|
147
|
-
height: height
|
|
148
|
-
},
|
|
149
|
-
style: {
|
|
150
|
-
fill: data.getItemVisual(idx, 'color'),
|
|
151
|
-
opacity: data.getItemVisual(idx, 'opacity')
|
|
152
|
-
}
|
|
153
|
-
});
|
|
125
|
+
var dataDims = coordSysType === 'cartesian2d'
|
|
126
|
+
? [
|
|
127
|
+
seriesModel.coordDimToDataDim('x')[0],
|
|
128
|
+
seriesModel.coordDimToDataDim('y')[0],
|
|
129
|
+
seriesModel.coordDimToDataDim('value')[0]
|
|
130
|
+
]
|
|
131
|
+
: [
|
|
132
|
+
seriesModel.coordDimToDataDim('time')[0],
|
|
133
|
+
seriesModel.coordDimToDataDim('value')[0]
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
data.each(function (idx) {
|
|
137
|
+
var rect;
|
|
138
|
+
|
|
139
|
+
if (coordSysType === 'cartesian2d') {
|
|
140
|
+
// Ignore empty data
|
|
141
|
+
if (isNaN(data.get(dataDims[2], idx))) {
|
|
142
|
+
return;
|
|
154
143
|
}
|
|
155
|
-
else {
|
|
156
|
-
// x => time y => value z => idx
|
|
157
144
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
145
|
+
var point = coordSys.dataToPoint([
|
|
146
|
+
data.get(dataDims[0], idx),
|
|
147
|
+
data.get(dataDims[1], idx)
|
|
148
|
+
]);
|
|
149
|
+
|
|
150
|
+
rect = new graphic.Rect({
|
|
151
|
+
shape: {
|
|
152
|
+
x: point[0] - width / 2,
|
|
153
|
+
y: point[1] - height / 2,
|
|
154
|
+
width: width,
|
|
155
|
+
height: height
|
|
156
|
+
},
|
|
157
|
+
style: {
|
|
158
|
+
fill: data.getItemVisual(idx, 'color'),
|
|
159
|
+
opacity: data.getItemVisual(idx, 'opacity')
|
|
161
160
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
style: {
|
|
169
|
-
fill: data.getItemVisual(idx, 'color'),
|
|
170
|
-
opacity: data.getItemVisual(idx, 'opacity')
|
|
171
|
-
}
|
|
172
|
-
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
// Ignore empty data
|
|
165
|
+
if (isNaN(data.get(dataDims[1], idx))) {
|
|
166
|
+
return;
|
|
173
167
|
}
|
|
174
168
|
|
|
169
|
+
rect = new graphic.Rect({
|
|
170
|
+
z2: 1,
|
|
171
|
+
shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,
|
|
172
|
+
style: {
|
|
173
|
+
fill: data.getItemVisual(idx, 'color'),
|
|
174
|
+
opacity: data.getItemVisual(idx, 'opacity')
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
175
178
|
|
|
176
|
-
|
|
179
|
+
var itemModel = data.getItemModel(idx);
|
|
177
180
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
// Optimization for large datset
|
|
182
|
+
if (data.hasItemOption) {
|
|
183
|
+
style = itemModel.getModel(itemStyleQuery).getItemStyle(['color']);
|
|
184
|
+
hoverStl = itemModel.getModel(hoverItemStyleQuery).getItemStyle();
|
|
185
|
+
labelModel = itemModel.getModel(labelQuery);
|
|
186
|
+
hoverLabelModel = itemModel.getModel(hoverLabelQuery);
|
|
187
|
+
}
|
|
185
188
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
189
|
+
var rawValue = seriesModel.getRawValue(idx);
|
|
190
|
+
var defaultText = '-';
|
|
191
|
+
if (rawValue && rawValue[2] != null) {
|
|
192
|
+
defaultText = rawValue[2];
|
|
193
|
+
}
|
|
194
|
+
if (labelModel.getShallow('show')) {
|
|
195
|
+
graphic.setText(style, labelModel);
|
|
196
|
+
style.text = seriesModel.getFormattedLabel(idx, 'normal') || defaultText;
|
|
197
|
+
}
|
|
198
|
+
if (hoverLabelModel.getShallow('show')) {
|
|
199
|
+
graphic.setText(hoverStl, hoverLabelModel);
|
|
200
|
+
hoverStl.text = seriesModel.getFormattedLabel(idx, 'emphasis') || defaultText;
|
|
201
|
+
}
|
|
199
202
|
|
|
200
|
-
|
|
203
|
+
rect.setStyle(style);
|
|
201
204
|
|
|
202
|
-
|
|
205
|
+
graphic.setHoverStyle(rect, data.hasItemOption ? hoverStl : zrUtil.extend({}, hoverStl));
|
|
203
206
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
207
|
+
group.add(rect);
|
|
208
|
+
data.setItemGraphicEl(idx, rect);
|
|
209
|
+
});
|
|
208
210
|
},
|
|
209
211
|
|
|
210
212
|
_renderOnGeo: function (geo, seriesModel, visualMapModel, api) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
var symbolUtil = require('../../util/symbol');
|
|
8
8
|
var graphic = require('../../util/graphic');
|
|
9
9
|
var numberUtil = require('../../util/number');
|
|
10
|
+
var labelHelper = require('./labelHelper');
|
|
10
11
|
|
|
11
12
|
function getSymbolSize(data, idx) {
|
|
12
13
|
var symbolSize = data.getItemVisual(idx, 'symbolSize');
|
|
@@ -218,37 +219,13 @@
|
|
|
218
219
|
elStyle.opacity = opacity;
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
valueDim
|
|
227
|
-
|
|
228
|
-
dataType === 'ordinal' || dataType === 'time'
|
|
229
|
-
)) {} // jshint ignore:line
|
|
230
|
-
|
|
231
|
-
if (valueDim != null && labelModel.getShallow('show')) {
|
|
232
|
-
graphic.setText(elStyle, labelModel, color);
|
|
233
|
-
elStyle.text = zrUtil.retrieve(
|
|
234
|
-
seriesModel.getFormattedLabel(idx, 'normal'),
|
|
235
|
-
data.get(valueDim, idx)
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
elStyle.text = '';
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (valueDim != null && hoverLabelModel.getShallow('show')) {
|
|
243
|
-
graphic.setText(hoverItemStyle, hoverLabelModel, color);
|
|
244
|
-
hoverItemStyle.text = zrUtil.retrieve(
|
|
245
|
-
seriesModel.getFormattedLabel(idx, 'emphasis'),
|
|
246
|
-
data.get(valueDim, idx)
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
hoverItemStyle.text = '';
|
|
251
|
-
}
|
|
222
|
+
var valueDim = labelHelper.findLabelValueDim(data);
|
|
223
|
+
labelHelper.setTextToStyle(
|
|
224
|
+
data, idx, valueDim, elStyle, seriesModel, labelModel, color
|
|
225
|
+
);
|
|
226
|
+
labelHelper.setTextToStyle(
|
|
227
|
+
data, idx, valueDim, hoverItemStyle, seriesModel, hoverLabelModel, color
|
|
228
|
+
);
|
|
252
229
|
|
|
253
230
|
symbolPath.off('mouseover')
|
|
254
231
|
.off('mouseout')
|
|
@@ -38,8 +38,13 @@
|
|
|
38
38
|
var coordSysName = seriesModel.get('coordinateSystem');
|
|
39
39
|
var creator = creators[coordSysName];
|
|
40
40
|
var registeredCoordSys = CoordinateSystem.get(coordSysName);
|
|
41
|
+
var completeDimOpt = {
|
|
42
|
+
encodeDef: seriesModel.get('encode'),
|
|
43
|
+
dimsDef: seriesModel.get('dimensions')
|
|
44
|
+
};
|
|
45
|
+
|
|
41
46
|
// FIXME
|
|
42
|
-
var axesInfo = creator && creator(data, seriesModel, ecModel);
|
|
47
|
+
var axesInfo = creator && creator(data, seriesModel, ecModel, completeDimOpt);
|
|
43
48
|
var dimensions = axesInfo && axesInfo.dimensions;
|
|
44
49
|
if (!dimensions) {
|
|
45
50
|
// Get dimensions from registered coordinate system
|
|
@@ -48,7 +53,7 @@
|
|
|
48
53
|
? registeredCoordSys.getDimensionsInfo()
|
|
49
54
|
: registeredCoordSys.dimensions.slice()
|
|
50
55
|
)) || ['x', 'y'];
|
|
51
|
-
dimensions = completeDimensions(dimensions, data,
|
|
56
|
+
dimensions = completeDimensions(dimensions, data, completeDimOpt);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
var categoryIndex = axesInfo ? axesInfo.categoryIndex : -1;
|
|
@@ -118,7 +123,7 @@
|
|
|
118
123
|
*/
|
|
119
124
|
var creators = {
|
|
120
125
|
|
|
121
|
-
cartesian2d: function (data, seriesModel, ecModel) {
|
|
126
|
+
cartesian2d: function (data, seriesModel, ecModel, completeDimOpt) {
|
|
122
127
|
|
|
123
128
|
var axesModels = zrUtil.map(['xAxis', 'yAxis'], function (name) {
|
|
124
129
|
return ecModel.queryComponents({
|
|
@@ -167,7 +172,7 @@
|
|
|
167
172
|
var isXAxisCateogry = xAxisType === 'category';
|
|
168
173
|
var isYAxisCategory = yAxisType === 'category';
|
|
169
174
|
|
|
170
|
-
completeDimensions(dimensions, data,
|
|
175
|
+
dimensions = completeDimensions(dimensions, data, completeDimOpt);
|
|
171
176
|
|
|
172
177
|
var categoryAxesModels = {};
|
|
173
178
|
if (isXAxisCateogry) {
|
|
@@ -183,7 +188,7 @@
|
|
|
183
188
|
};
|
|
184
189
|
},
|
|
185
190
|
|
|
186
|
-
singleAxis: function (data, seriesModel, ecModel) {
|
|
191
|
+
singleAxis: function (data, seriesModel, ecModel, completeDimOpt) {
|
|
187
192
|
|
|
188
193
|
var singleAxisModel = ecModel.queryComponents({
|
|
189
194
|
mainType: 'singleAxis',
|
|
@@ -206,7 +211,7 @@
|
|
|
206
211
|
stackable: isStackable(singleAxisType)
|
|
207
212
|
}];
|
|
208
213
|
|
|
209
|
-
completeDimensions(dimensions, data);
|
|
214
|
+
dimensions = completeDimensions(dimensions, data, completeDimOpt);
|
|
210
215
|
|
|
211
216
|
var categoryAxesModels = {};
|
|
212
217
|
if (isCategory) {
|
|
@@ -220,7 +225,7 @@
|
|
|
220
225
|
};
|
|
221
226
|
},
|
|
222
227
|
|
|
223
|
-
polar: function (data, seriesModel, ecModel) {
|
|
228
|
+
polar: function (data, seriesModel, ecModel, completeDimOpt) {
|
|
224
229
|
var polarModel = ecModel.queryComponents({
|
|
225
230
|
mainType: 'polar',
|
|
226
231
|
index: seriesModel.get('polarIndex'),
|
|
@@ -257,7 +262,7 @@
|
|
|
257
262
|
var isAngleAxisCateogry = angleAxisType === 'category';
|
|
258
263
|
var isRadiusAxisCateogry = radiusAxisType === 'category';
|
|
259
264
|
|
|
260
|
-
completeDimensions(dimensions, data,
|
|
265
|
+
dimensions = completeDimensions(dimensions, data, completeDimOpt);
|
|
261
266
|
|
|
262
267
|
var categoryAxesModels = {};
|
|
263
268
|
if (isRadiusAxisCateogry) {
|
|
@@ -273,14 +278,14 @@
|
|
|
273
278
|
};
|
|
274
279
|
},
|
|
275
280
|
|
|
276
|
-
geo: function (data, seriesModel, ecModel) {
|
|
281
|
+
geo: function (data, seriesModel, ecModel, completeDimOpt) {
|
|
277
282
|
// TODO Region
|
|
278
283
|
// 多个散点图系列在同一个地区的时候
|
|
279
284
|
return {
|
|
280
285
|
dimensions: completeDimensions([
|
|
281
286
|
{name: 'lng'},
|
|
282
287
|
{name: 'lat'}
|
|
283
|
-
], data,
|
|
288
|
+
], data, completeDimOpt)
|
|
284
289
|
};
|
|
285
290
|
}
|
|
286
291
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module echarts/chart/helper/Symbol
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var graphic = require('../../util/graphic');
|
|
7
|
+
var zrUtil = require('zrender/lib/core/util');
|
|
8
|
+
var modelUtil = require('../../util/model');
|
|
9
|
+
|
|
10
|
+
var helper = {};
|
|
11
|
+
|
|
12
|
+
helper.findLabelValueDim = function (data) {
|
|
13
|
+
var valueDim;
|
|
14
|
+
var labelDims = modelUtil.otherDimToDataDim(data, 'label');
|
|
15
|
+
|
|
16
|
+
if (labelDims.length) {
|
|
17
|
+
valueDim = labelDims[0];
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
// Get last value dim
|
|
21
|
+
var dimensions = data.dimensions.slice();
|
|
22
|
+
var dataType;
|
|
23
|
+
while (dimensions.length && (
|
|
24
|
+
valueDim = dimensions.pop(),
|
|
25
|
+
dataType = data.getDimensionInfo(valueDim).type,
|
|
26
|
+
dataType === 'ordinal' || dataType === 'time'
|
|
27
|
+
)) {} // jshint ignore:line
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return valueDim;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
helper.setTextToStyle = function (
|
|
34
|
+
data, dataIndex, valueDim, elStyle, seriesModel, labelModel, color
|
|
35
|
+
) {
|
|
36
|
+
if (valueDim != null && labelModel.getShallow('show')) {
|
|
37
|
+
graphic.setText(elStyle, labelModel, color);
|
|
38
|
+
elStyle.text = zrUtil.retrieve(
|
|
39
|
+
seriesModel.getFormattedLabel(dataIndex, 'normal'),
|
|
40
|
+
data.get(valueDim, dataIndex)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
elStyle.text = '';
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
module.exports = helper;
|
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
var WhiskerBoxDraw = require('../helper/WhiskerBoxDraw');
|
|
7
7
|
var zrUtil = require('zrender/lib/core/util');
|
|
8
8
|
|
|
9
|
-
function getItemValue(item) {
|
|
10
|
-
return item.value == null ? item : item.value;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
9
|
var seriesModelMixin = {
|
|
14
10
|
|
|
15
11
|
/**
|
|
@@ -51,52 +47,36 @@
|
|
|
51
47
|
option.layout = option.layout || 'horizontal';
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
var coordDims = ['x', 'y'];
|
|
51
|
+
var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;
|
|
52
|
+
var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];
|
|
53
|
+
var otherAxisDim = coordDims[1 - baseAxisDimIndex];
|
|
56
54
|
var data = option.data;
|
|
57
|
-
var dimensions = this.dimensions = ['base'].concat(this.valueDimensions);
|
|
58
|
-
completeDimensions(dimensions, data);
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var value = getItemValue(dataItem);
|
|
63
|
-
return addOrdinal ? (dimName === 'base' ? idx : value[dimIdx - 1]) : value[dimIdx];
|
|
56
|
+
addOrdinal && zrUtil.each(data, function (item, index) {
|
|
57
|
+
zrUtil.isArray(item) && item.unshift(index);
|
|
64
58
|
});
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
return map[this.get('layout')][axisDim];
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @override
|
|
86
|
-
* @param {string|number} dataDim
|
|
87
|
-
* @return {string} coord dimension
|
|
88
|
-
*/
|
|
89
|
-
dataDimToCoordDim: function (dataDim) {
|
|
90
|
-
var dim;
|
|
60
|
+
var dimensions = [{
|
|
61
|
+
name: baseAxisDim,
|
|
62
|
+
otherDims: {
|
|
63
|
+
tooltip: false
|
|
64
|
+
},
|
|
65
|
+
dimsDef: ['base']
|
|
66
|
+
}, {
|
|
67
|
+
name: otherAxisDim,
|
|
68
|
+
dimsDef: this.defaultValueDimensions.slice()
|
|
69
|
+
}];
|
|
70
|
+
|
|
71
|
+
dimensions = completeDimensions(dimensions, data, {
|
|
72
|
+
encodeDef: this.get('encode'),
|
|
73
|
+
dimsDef: this.get('dimensions')
|
|
74
|
+
});
|
|
91
75
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (zrUtil.indexOf(dataDims, dataDim) >= 0) {
|
|
95
|
-
dim = coordDim;
|
|
96
|
-
}
|
|
97
|
-
}, this);
|
|
76
|
+
var list = new List(dimensions, this);
|
|
77
|
+
list.initData(data, categories ? categories.slice() : null);
|
|
98
78
|
|
|
99
|
-
return
|
|
79
|
+
return list;
|
|
100
80
|
},
|
|
101
81
|
|
|
102
82
|
/**
|
|
@@ -107,6 +87,7 @@
|
|
|
107
87
|
var dim = this._baseAxisDim;
|
|
108
88
|
return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;
|
|
109
89
|
}
|
|
90
|
+
|
|
110
91
|
};
|
|
111
92
|
|
|
112
93
|
var viewMixin = {
|
|
@@ -14,24 +14,25 @@
|
|
|
14
14
|
|
|
15
15
|
zrUtil.each(datas, function (data) {
|
|
16
16
|
data.each(dims, function (value, idx) {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// Add prefix to avoid conflict with Object.prototype.
|
|
18
|
+
var mapKey = 'ec-' + data.getName(idx);
|
|
19
|
+
dataNameMap[mapKey] = dataNameMap[mapKey] || [];
|
|
19
20
|
if (!isNaN(value)) {
|
|
20
|
-
dataNameMap[
|
|
21
|
+
dataNameMap[mapKey].push(value);
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
return datas[0].map(dims, function (value, idx) {
|
|
26
|
-
var
|
|
27
|
+
var mapKey = 'ec-' + datas[0].getName(idx);
|
|
27
28
|
var sum = 0;
|
|
28
29
|
var min = Infinity;
|
|
29
30
|
var max = -Infinity;
|
|
30
|
-
var len = dataNameMap[
|
|
31
|
+
var len = dataNameMap[mapKey].length;
|
|
31
32
|
for (var i = 0; i < len; i++) {
|
|
32
|
-
min = Math.min(min, dataNameMap[
|
|
33
|
-
max = Math.max(max, dataNameMap[
|
|
34
|
-
sum += dataNameMap[
|
|
33
|
+
min = Math.min(min, dataNameMap[mapKey][i]);
|
|
34
|
+
max = Math.max(max, dataNameMap[mapKey][i]);
|
|
35
|
+
sum += dataNameMap[mapKey][i];
|
|
35
36
|
}
|
|
36
37
|
var result;
|
|
37
38
|
if (statisticType === 'min') {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* @override
|
|
30
30
|
*/
|
|
31
31
|
render: function (seriesModel, ecModel, api, payload) {
|
|
32
|
-
this._renderForNormal(seriesModel);
|
|
32
|
+
this._renderForNormal(seriesModel, payload);
|
|
33
33
|
// this[
|
|
34
34
|
// seriesModel.option.progressive
|
|
35
35
|
// ? '_renderForProgressive'
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
/**
|
|
43
43
|
* @private
|
|
44
44
|
*/
|
|
45
|
-
_renderForNormal: function (seriesModel) {
|
|
45
|
+
_renderForNormal: function (seriesModel, payload) {
|
|
46
46
|
var dataGroup = this._dataGroup;
|
|
47
47
|
var data = seriesModel.getData();
|
|
48
48
|
var oldData = this._data;
|
|
@@ -86,7 +86,8 @@
|
|
|
86
86
|
var line = oldData.getItemGraphicEl(oldDataIndex);
|
|
87
87
|
var points = createLinePoints(data, newDataIndex, dimensions, coordSys);
|
|
88
88
|
data.setItemGraphicEl(newDataIndex, line);
|
|
89
|
-
|
|
89
|
+
var animationModel = (payload && payload.animation === false) ? null : seriesModel;
|
|
90
|
+
graphic.updateProps(line, {shape: {points: points}}, animationModel, newDataIndex);
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
function remove(oldDataIndex) {
|
|
@@ -190,17 +191,17 @@
|
|
|
190
191
|
if (data.hasItemOption) {
|
|
191
192
|
var itemModel = data.getItemModel(dataIndex);
|
|
192
193
|
var lineStyleModel = itemModel.getModel('lineStyle.normal', seriesStyleModel);
|
|
193
|
-
lineStyle = lineStyleModel.getLineStyle();
|
|
194
|
+
lineStyle = lineStyleModel.getLineStyle(['color', 'stroke']);
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
line.useStyle(zrUtil.extend(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
197
|
+
line.useStyle(zrUtil.extend(lineStyle, {
|
|
198
|
+
fill: null,
|
|
199
|
+
// lineStyle.color have been set to itemVisual in module:echarts/visual/seriesColor.
|
|
200
|
+
stroke: data.getItemVisual(dataIndex, 'color'),
|
|
201
|
+
// lineStyle.opacity have been set to itemVisual in parallelVisual.
|
|
202
|
+
opacity: data.getItemVisual(dataIndex, 'opacity')
|
|
203
|
+
}));
|
|
204
|
+
|
|
204
205
|
line.shape.smooth = smooth;
|
|
205
206
|
});
|
|
206
207
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
var opacityAccessPath = ['lineStyle', 'normal', 'opacity'];
|
|
4
|
+
|
|
3
5
|
module.exports = function (ecModel) {
|
|
4
6
|
|
|
5
7
|
ecModel.eachSeriesByType('parallel', function (seriesModel) {
|
|
@@ -25,7 +27,13 @@
|
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
coordSys.eachActiveState(data, function (activeState, dataIndex) {
|
|
28
|
-
data.
|
|
30
|
+
var itemModel = data.getItemModel(dataIndex);
|
|
31
|
+
var opacity = opacityMap[activeState];
|
|
32
|
+
if (activeState === 'normal') {
|
|
33
|
+
var itemOpacity = itemModel.get(opacityAccessPath, true);
|
|
34
|
+
itemOpacity != null && (opacity = itemOpacity);
|
|
35
|
+
}
|
|
36
|
+
data.setItemVisual(dataIndex, 'opacity', opacity);
|
|
29
37
|
});
|
|
30
38
|
|
|
31
39
|
data.setVisual('color', color);
|