echarts 4.5.0-rc.2 → 4.8.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/.github/pull_request_template.md +66 -0
- package/.github/workflows/nodejs.yml +12 -2
- package/CONTRIBUTING.md +16 -160
- package/NOTICE +1 -1
- package/README.md +2 -2
- package/dist/echarts-en.common.js +2808 -1188
- package/dist/echarts-en.common.min.js +1 -1
- package/dist/echarts-en.js +3559 -1437
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +1 -1
- package/dist/echarts-en.simple.js +2453 -1002
- package/dist/echarts-en.simple.min.js +1 -1
- package/dist/echarts.common.js +2782 -1188
- package/dist/echarts.common.min.js +1 -1
- package/dist/echarts.js +3533 -1437
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +1 -1
- package/dist/echarts.simple.js +2427 -1002
- package/dist/echarts.simple.min.js +1 -1
- package/dist/extension/bmap.js +336 -2
- package/dist/extension/bmap.js.map +1 -1
- package/dist/extension/bmap.min.js +1 -1
- package/extension/bmap/BMapView.js +6 -2
- package/extension-src/bmap/BMapView.js +3 -2
- package/lib/chart/bar/BarSeries.js +14 -1
- package/lib/chart/bar/BarView.js +161 -16
- package/lib/chart/bar/BaseBarSeries.js +3 -1
- package/lib/chart/candlestick/candlestickVisual.js +1 -1
- package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
- package/lib/chart/funnel/FunnelSeries.js +13 -5
- package/lib/chart/gauge/GaugeSeries.js +0 -2
- package/lib/chart/graph/GraphSeries.js +11 -5
- package/lib/chart/graph/GraphView.js +30 -12
- 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 +94 -33
- package/lib/chart/helper/LineDraw.js +5 -1
- package/lib/chart/helper/Symbol.js +1 -2
- 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/whiskerBoxCommon.js +22 -16
- package/lib/chart/line/LineSeries.js +3 -1
- package/lib/chart/line/LineView.js +41 -2
- package/lib/chart/map/MapSeries.js +11 -3
- 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 +23 -3
- 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 +1 -0
- package/lib/chart/sunburst/SunburstSeries.js +12 -7
- package/lib/chart/sunburst/SunburstView.js +5 -1
- package/lib/chart/themeRiver/ThemeRiverSeries.js +3 -3
- package/lib/chart/tree/TreeSeries.js +20 -3
- package/lib/chart/tree/TreeView.js +151 -25
- package/lib/chart/treemap/TreemapSeries.js +15 -3
- package/lib/chart/treemap/TreemapView.js +80 -38
- 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/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/MarkLineModel.js +2 -1
- package/lib/component/marker/markerHelper.js +7 -4
- package/lib/component/title.js +6 -2
- package/lib/component/toolbox/ToolboxView.js +5 -1
- package/lib/component/toolbox/feature/MagicType.js +20 -14
- package/lib/component/toolbox/feature/SaveAsImage.js +2 -1
- package/lib/component/tooltip/TooltipContent.js +60 -23
- package/lib/component/tooltip/TooltipView.js +7 -8
- package/lib/component/visualMap/PiecewiseModel.js +3 -6
- package/lib/coord/Axis.js +30 -2
- package/lib/coord/View.js +9 -0
- package/lib/coord/axisDefault.js +21 -2
- package/lib/coord/axisHelper.js +22 -16
- package/lib/coord/calendar/Calendar.js +8 -4
- 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/List.js +25 -19
- package/lib/data/Tree.js +9 -19
- 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 +0 -5
- package/lib/loading/default.js +43 -27
- package/lib/model/Series.js +4 -4
- 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/stream/Scheduler.js +9 -1
- 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/dataColor.js +2 -12
- package/lib/visual/seriesColor.js +15 -7
- package/lib/visual/symbol.js +12 -2
- package/map/js/china.js +1 -1
- 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/china.json +1 -1
- package/map/json/province/chongqing.json +1 -1
- package/map/json/province/tianjin.json +1 -1
- package/package.json +11 -6
- package/src/chart/bar/BarSeries.js +15 -1
- package/src/chart/bar/BarView.js +162 -15
- package/src/chart/bar/BaseBarSeries.js +1 -1
- package/src/chart/candlestick/candlestickVisual.js +1 -1
- package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
- package/src/chart/funnel/FunnelSeries.js +10 -4
- package/src/chart/gauge/GaugeSeries.js +0 -1
- package/src/chart/graph/GraphSeries.js +10 -4
- package/src/chart/graph/GraphView.js +28 -10
- 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 +84 -26
- package/src/chart/helper/LineDraw.js +5 -1
- package/src/chart/helper/Symbol.js +2 -2
- package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
- package/src/chart/helper/createListFromArray.js +13 -8
- package/src/chart/helper/createRenderPlanner.js +5 -2
- 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/map/MapSeries.js +8 -3
- 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 +27 -3
- 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 +2 -0
- package/src/chart/sunburst/SunburstSeries.js +12 -7
- package/src/chart/sunburst/SunburstView.js +2 -1
- package/src/chart/themeRiver/ThemeRiverSeries.js +4 -3
- package/src/chart/tree/TreeSeries.js +19 -6
- package/src/chart/tree/TreeView.js +155 -22
- package/src/chart/treemap/TreemapSeries.js +15 -5
- package/src/chart/treemap/TreemapView.js +77 -41
- 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/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/MarkLineModel.js +2 -1
- package/src/component/marker/markerHelper.js +8 -5
- package/src/component/title.js +3 -2
- package/src/component/toolbox/ToolboxView.js +5 -0
- package/src/component/toolbox/feature/MagicType.js +19 -13
- package/src/component/toolbox/feature/SaveAsImage.js +2 -1
- package/src/component/tooltip/TooltipContent.js +59 -22
- package/src/component/tooltip/TooltipView.js +10 -8
- package/src/component/visualMap/PiecewiseModel.js +5 -9
- package/src/coord/Axis.js +29 -2
- package/src/coord/View.js +10 -1
- package/src/coord/axisDefault.js +25 -1
- package/src/coord/axisHelper.js +26 -19
- package/src/coord/calendar/Calendar.js +12 -5
- 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/List.js +29 -16
- package/src/data/Tree.js +12 -17
- 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 +0 -4
- package/src/loading/default.js +46 -34
- package/src/model/Series.js +4 -4
- 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/stream/Scheduler.js +8 -0
- package/src/theme/dark.js +3 -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/dataColor.js +0 -13
- package/src/visual/seriesColor.js +13 -7
- package/src/visual/symbol.js +11 -2
- 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
|
@@ -46,7 +46,7 @@ var AxisBuilder = require("./AxisBuilder");
|
|
|
46
46
|
* specific language governing permissions and limitations
|
|
47
47
|
* under the License.
|
|
48
48
|
*/
|
|
49
|
-
var elementList = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea'];
|
|
49
|
+
var elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];
|
|
50
50
|
|
|
51
51
|
function getAxisLineShape(polar, rExtent, angle) {
|
|
52
52
|
rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());
|
|
@@ -89,6 +89,7 @@ var _default = AxisView.extend({
|
|
|
89
89
|
var polar = angleAxis.polar;
|
|
90
90
|
var radiusExtent = polar.getRadiusAxis().getExtent();
|
|
91
91
|
var ticksAngles = angleAxis.getTicksCoords();
|
|
92
|
+
var minorTickAngles = angleAxis.getMinorTicksCoords();
|
|
92
93
|
var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {
|
|
93
94
|
var labelItem = zrUtil.clone(labelItem);
|
|
94
95
|
labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);
|
|
@@ -98,7 +99,7 @@ var _default = AxisView.extend({
|
|
|
98
99
|
fixAngleOverlap(ticksAngles);
|
|
99
100
|
zrUtil.each(elementList, function (name) {
|
|
100
101
|
if (angleAxisModel.get(name + '.show') && (!angleAxis.scale.isBlank() || name === 'axisLine')) {
|
|
101
|
-
this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels);
|
|
102
|
+
this['_' + name](angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);
|
|
102
103
|
}
|
|
103
104
|
}, this);
|
|
104
105
|
},
|
|
@@ -106,7 +107,7 @@ var _default = AxisView.extend({
|
|
|
106
107
|
/**
|
|
107
108
|
* @private
|
|
108
109
|
*/
|
|
109
|
-
_axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
|
|
110
|
+
_axisLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
110
111
|
var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle'); // extent id of the axis radius (r0 and r)
|
|
111
112
|
|
|
112
113
|
var rId = getRadiusIdx(polar);
|
|
@@ -145,7 +146,7 @@ var _default = AxisView.extend({
|
|
|
145
146
|
/**
|
|
146
147
|
* @private
|
|
147
148
|
*/
|
|
148
|
-
_axisTick: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
|
|
149
|
+
_axisTick: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
149
150
|
var tickModel = angleAxisModel.getModel('axisTick');
|
|
150
151
|
var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');
|
|
151
152
|
var radius = radiusExtent[getRadiusIdx(polar)];
|
|
@@ -164,7 +165,36 @@ var _default = AxisView.extend({
|
|
|
164
165
|
/**
|
|
165
166
|
* @private
|
|
166
167
|
*/
|
|
167
|
-
|
|
168
|
+
_minorTick: function (angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {
|
|
169
|
+
if (!minorTickAngles.length) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
var tickModel = angleAxisModel.getModel('axisTick');
|
|
174
|
+
var minorTickModel = angleAxisModel.getModel('minorTick');
|
|
175
|
+
var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');
|
|
176
|
+
var radius = radiusExtent[getRadiusIdx(polar)];
|
|
177
|
+
var lines = [];
|
|
178
|
+
|
|
179
|
+
for (var i = 0; i < minorTickAngles.length; i++) {
|
|
180
|
+
for (var k = 0; k < minorTickAngles[i].length; k++) {
|
|
181
|
+
lines.push(new graphic.Line({
|
|
182
|
+
shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
this.group.add(graphic.mergePath(lines, {
|
|
188
|
+
style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {
|
|
189
|
+
stroke: angleAxisModel.get('axisLine.lineStyle.color')
|
|
190
|
+
}))
|
|
191
|
+
}));
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @private
|
|
196
|
+
*/
|
|
197
|
+
_axisLabel: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {
|
|
168
198
|
var rawCategoryData = angleAxisModel.getCategories(true);
|
|
169
199
|
var commonLabelModel = angleAxisModel.getModel('axisLabel');
|
|
170
200
|
var labelMargin = commonLabelModel.get('margin');
|
|
@@ -208,7 +238,7 @@ var _default = AxisView.extend({
|
|
|
208
238
|
/**
|
|
209
239
|
* @private
|
|
210
240
|
*/
|
|
211
|
-
_splitLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
|
|
241
|
+
_splitLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
212
242
|
var splitLineModel = angleAxisModel.getModel('splitLine');
|
|
213
243
|
var lineStyleModel = splitLineModel.getModel('lineStyle');
|
|
214
244
|
var lineColors = lineStyleModel.get('color');
|
|
@@ -240,7 +270,34 @@ var _default = AxisView.extend({
|
|
|
240
270
|
/**
|
|
241
271
|
* @private
|
|
242
272
|
*/
|
|
243
|
-
|
|
273
|
+
_minorSplitLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
274
|
+
if (!minorTickAngles.length) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');
|
|
279
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
280
|
+
var lines = [];
|
|
281
|
+
|
|
282
|
+
for (var i = 0; i < minorTickAngles.length; i++) {
|
|
283
|
+
for (var k = 0; k < minorTickAngles[i].length; k++) {
|
|
284
|
+
lines.push(new graphic.Line({
|
|
285
|
+
shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
this.group.add(graphic.mergePath(lines, {
|
|
291
|
+
style: lineStyleModel.getLineStyle(),
|
|
292
|
+
silent: true,
|
|
293
|
+
z: angleAxisModel.get('z')
|
|
294
|
+
}));
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @private
|
|
299
|
+
*/
|
|
300
|
+
_splitArea: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
244
301
|
if (!ticksAngles.length) {
|
|
245
302
|
return;
|
|
246
303
|
}
|
|
@@ -248,9 +248,10 @@ var builders = {
|
|
|
248
248
|
axisTickLabel: function () {
|
|
249
249
|
var axisModel = this.axisModel;
|
|
250
250
|
var opt = this.opt;
|
|
251
|
-
var
|
|
251
|
+
var ticksEls = buildAxisMajorTicks(this, axisModel, opt);
|
|
252
252
|
var labelEls = buildAxisLabel(this, axisModel, opt);
|
|
253
|
-
fixMinMaxLabelShow(axisModel, labelEls,
|
|
253
|
+
fixMinMaxLabelShow(axisModel, labelEls, ticksEls);
|
|
254
|
+
buildAxisMinorTicks(this, axisModel, opt);
|
|
254
255
|
},
|
|
255
256
|
|
|
256
257
|
/**
|
|
@@ -519,38 +520,27 @@ function isNameLocationCenter(nameLocation) {
|
|
|
519
520
|
return nameLocation === 'middle' || nameLocation === 'center';
|
|
520
521
|
}
|
|
521
522
|
|
|
522
|
-
function
|
|
523
|
-
var
|
|
524
|
-
|
|
525
|
-
if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) {
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
var tickModel = axisModel.getModel('axisTick');
|
|
530
|
-
var lineStyleModel = tickModel.getModel('lineStyle');
|
|
531
|
-
var tickLen = tickModel.get('length');
|
|
532
|
-
var ticksCoords = axis.getTicksCoords();
|
|
523
|
+
function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, aniid) {
|
|
524
|
+
var tickEls = [];
|
|
533
525
|
var pt1 = [];
|
|
534
526
|
var pt2 = [];
|
|
535
|
-
var matrix = axisBuilder._transform;
|
|
536
|
-
var tickEls = [];
|
|
537
527
|
|
|
538
528
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
539
529
|
var tickCoord = ticksCoords[i].coord;
|
|
540
530
|
pt1[0] = tickCoord;
|
|
541
531
|
pt1[1] = 0;
|
|
542
532
|
pt2[0] = tickCoord;
|
|
543
|
-
pt2[1] =
|
|
533
|
+
pt2[1] = tickEndCoord;
|
|
544
534
|
|
|
545
|
-
if (
|
|
546
|
-
v2ApplyTransform(pt1, pt1,
|
|
547
|
-
v2ApplyTransform(pt2, pt2,
|
|
535
|
+
if (tickTransform) {
|
|
536
|
+
v2ApplyTransform(pt1, pt1, tickTransform);
|
|
537
|
+
v2ApplyTransform(pt2, pt2, tickTransform);
|
|
548
538
|
} // Tick line, Not use group transform to have better line draw
|
|
549
539
|
|
|
550
540
|
|
|
551
541
|
var tickEl = new graphic.Line({
|
|
552
542
|
// Id for animation
|
|
553
|
-
anid: '
|
|
543
|
+
anid: aniid + '_' + ticksCoords[i].tickValue,
|
|
554
544
|
subPixelOptimize: true,
|
|
555
545
|
shape: {
|
|
556
546
|
x1: pt1[0],
|
|
@@ -558,19 +548,67 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
|
|
|
558
548
|
x2: pt2[0],
|
|
559
549
|
y2: pt2[1]
|
|
560
550
|
},
|
|
561
|
-
style:
|
|
562
|
-
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
563
|
-
}),
|
|
551
|
+
style: tickLineStyle,
|
|
564
552
|
z2: 2,
|
|
565
553
|
silent: true
|
|
566
554
|
});
|
|
567
|
-
axisBuilder.group.add(tickEl);
|
|
568
555
|
tickEls.push(tickEl);
|
|
569
556
|
}
|
|
570
557
|
|
|
571
558
|
return tickEls;
|
|
572
559
|
}
|
|
573
560
|
|
|
561
|
+
function buildAxisMajorTicks(axisBuilder, axisModel, opt) {
|
|
562
|
+
var axis = axisModel.axis;
|
|
563
|
+
var tickModel = axisModel.getModel('axisTick');
|
|
564
|
+
|
|
565
|
+
if (!tickModel.get('show') || axis.scale.isBlank()) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
var lineStyleModel = tickModel.getModel('lineStyle');
|
|
570
|
+
var tickEndCoord = opt.tickDirection * tickModel.get('length');
|
|
571
|
+
var ticksCoords = axis.getTicksCoords();
|
|
572
|
+
var ticksEls = createTicks(ticksCoords, axisBuilder._transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {
|
|
573
|
+
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
574
|
+
}), 'ticks');
|
|
575
|
+
|
|
576
|
+
for (var i = 0; i < ticksEls.length; i++) {
|
|
577
|
+
axisBuilder.group.add(ticksEls[i]);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
return ticksEls;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function buildAxisMinorTicks(axisBuilder, axisModel, opt) {
|
|
584
|
+
var axis = axisModel.axis;
|
|
585
|
+
var minorTickModel = axisModel.getModel('minorTick');
|
|
586
|
+
|
|
587
|
+
if (!minorTickModel.get('show') || axis.scale.isBlank()) {
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
592
|
+
|
|
593
|
+
if (!minorTicksCoords.length) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
var lineStyleModel = minorTickModel.getModel('lineStyle');
|
|
598
|
+
var tickEndCoord = opt.tickDirection * minorTickModel.get('length');
|
|
599
|
+
var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {
|
|
600
|
+
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
601
|
+
}));
|
|
602
|
+
|
|
603
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
604
|
+
var minorTicksEls = createTicks(minorTicksCoords[i], axisBuilder._transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);
|
|
605
|
+
|
|
606
|
+
for (var k = 0; k < minorTicksEls.length; k++) {
|
|
607
|
+
axisBuilder.group.add(minorTicksEls[k]);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
574
612
|
function buildAxisLabel(axisBuilder, axisModel, opt) {
|
|
575
613
|
var axis = axisModel.axis;
|
|
576
614
|
var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show'));
|
|
@@ -28,6 +28,11 @@ var AxisView = require("./AxisView");
|
|
|
28
28
|
|
|
29
29
|
var cartesianAxisHelper = require("../../coord/cartesian/cartesianAxisHelper");
|
|
30
30
|
|
|
31
|
+
var _axisSplitHelper = require("./axisSplitHelper");
|
|
32
|
+
|
|
33
|
+
var rectCoordAxisBuildSplitArea = _axisSplitHelper.rectCoordAxisBuildSplitArea;
|
|
34
|
+
var rectCoordAxisHandleRemove = _axisSplitHelper.rectCoordAxisHandleRemove;
|
|
35
|
+
|
|
31
36
|
/*
|
|
32
37
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
33
38
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -47,14 +52,7 @@ var cartesianAxisHelper = require("../../coord/cartesian/cartesianAxisHelper");
|
|
|
47
52
|
* under the License.
|
|
48
53
|
*/
|
|
49
54
|
var axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];
|
|
50
|
-
var selfBuilderAttrs = ['splitArea', 'splitLine'];
|
|
51
|
-
// var alignWithLabel = model.get('alignWithLabel');
|
|
52
|
-
// if (alignWithLabel === 'auto') {
|
|
53
|
-
// alignWithLabel = axisModel.get('axisTick.alignWithLabel');
|
|
54
|
-
// }
|
|
55
|
-
// return alignWithLabel;
|
|
56
|
-
// }
|
|
57
|
-
|
|
55
|
+
var selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];
|
|
58
56
|
var CartesianAxisView = AxisView.extend({
|
|
59
57
|
type: 'cartesianAxis',
|
|
60
58
|
axisPointerClass: 'CartesianAxisPointer',
|
|
@@ -88,7 +86,7 @@ var CartesianAxisView = AxisView.extend({
|
|
|
88
86
|
CartesianAxisView.superCall(this, 'render', axisModel, ecModel, api, payload);
|
|
89
87
|
},
|
|
90
88
|
remove: function () {
|
|
91
|
-
this
|
|
89
|
+
rectCoordAxisHandleRemove(this);
|
|
92
90
|
},
|
|
93
91
|
|
|
94
92
|
/**
|
|
@@ -114,9 +112,7 @@ var CartesianAxisView = AxisView.extend({
|
|
|
114
112
|
tickModel: splitLineModel
|
|
115
113
|
});
|
|
116
114
|
var p1 = [];
|
|
117
|
-
var p2 = [];
|
|
118
|
-
// Batching the lines if color are the same
|
|
119
|
-
|
|
115
|
+
var p2 = [];
|
|
120
116
|
var lineStyle = lineStyleModel.getLineStyle();
|
|
121
117
|
|
|
122
118
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
@@ -159,90 +155,61 @@ var CartesianAxisView = AxisView.extend({
|
|
|
159
155
|
* @param {module:echarts/coord/cartesian/GridModel} gridModel
|
|
160
156
|
* @private
|
|
161
157
|
*/
|
|
162
|
-
|
|
158
|
+
_minorSplitLine: function (axisModel, gridModel) {
|
|
163
159
|
var axis = axisModel.axis;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var splitAreaModel = axisModel.getModel('splitArea');
|
|
170
|
-
var areaStyleModel = splitAreaModel.getModel('areaStyle');
|
|
171
|
-
var areaColors = areaStyleModel.get('color');
|
|
160
|
+
var minorSplitLineModel = axisModel.getModel('minorSplitLine');
|
|
161
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
172
162
|
var gridRect = gridModel.coordinateSystem.getRect();
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
clamp: true
|
|
176
|
-
});
|
|
163
|
+
var isHorizontal = axis.isHorizontal();
|
|
164
|
+
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
177
165
|
|
|
178
|
-
if (!
|
|
166
|
+
if (!minorTicksCoords.length) {
|
|
179
167
|
return;
|
|
180
|
-
}
|
|
181
|
-
// should be corresponding to previous one if possible.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var areaColorsLen = areaColors.length;
|
|
185
|
-
var lastSplitAreaColors = this._splitAreaColors;
|
|
186
|
-
var newSplitAreaColors = zrUtil.createHashMap();
|
|
187
|
-
var colorIndex = 0;
|
|
168
|
+
}
|
|
188
169
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
170
|
+
var p1 = [];
|
|
171
|
+
var p2 = [];
|
|
172
|
+
var lineStyle = lineStyleModel.getLineStyle();
|
|
192
173
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
174
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
175
|
+
for (var k = 0; k < minorTicksCoords[i].length; k++) {
|
|
176
|
+
var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);
|
|
177
|
+
|
|
178
|
+
if (isHorizontal) {
|
|
179
|
+
p1[0] = tickCoord;
|
|
180
|
+
p1[1] = gridRect.y;
|
|
181
|
+
p2[0] = tickCoord;
|
|
182
|
+
p2[1] = gridRect.y + gridRect.height;
|
|
183
|
+
} else {
|
|
184
|
+
p1[0] = gridRect.x;
|
|
185
|
+
p1[1] = tickCoord;
|
|
186
|
+
p2[0] = gridRect.x + gridRect.width;
|
|
187
|
+
p2[1] = tickCoord;
|
|
196
188
|
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
var prev = axis.toGlobalCoord(ticksCoords[0].coord);
|
|
201
|
-
var areaStyle = areaStyleModel.getAreaStyle();
|
|
202
|
-
areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];
|
|
203
189
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
prev = x + width;
|
|
217
|
-
} else {
|
|
218
|
-
x = gridRect.x;
|
|
219
|
-
y = prev;
|
|
220
|
-
width = gridRect.width;
|
|
221
|
-
height = tickCoord - y;
|
|
222
|
-
prev = y + height;
|
|
190
|
+
this._axisGroup.add(new graphic.Line({
|
|
191
|
+
anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,
|
|
192
|
+
subPixelOptimize: true,
|
|
193
|
+
shape: {
|
|
194
|
+
x1: p1[0],
|
|
195
|
+
y1: p1[1],
|
|
196
|
+
x2: p2[0],
|
|
197
|
+
y2: p2[1]
|
|
198
|
+
},
|
|
199
|
+
style: lineStyle,
|
|
200
|
+
silent: true
|
|
201
|
+
}));
|
|
223
202
|
}
|
|
224
|
-
|
|
225
|
-
var tickValue = ticksCoords[i - 1].tickValue;
|
|
226
|
-
tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);
|
|
227
|
-
|
|
228
|
-
this._axisGroup.add(new graphic.Rect({
|
|
229
|
-
anid: tickValue != null ? 'area_' + tickValue : null,
|
|
230
|
-
shape: {
|
|
231
|
-
x: x,
|
|
232
|
-
y: y,
|
|
233
|
-
width: width,
|
|
234
|
-
height: height
|
|
235
|
-
},
|
|
236
|
-
style: zrUtil.defaults({
|
|
237
|
-
fill: areaColors[colorIndex]
|
|
238
|
-
}, areaStyle),
|
|
239
|
-
silent: true
|
|
240
|
-
}));
|
|
241
|
-
|
|
242
|
-
colorIndex = (colorIndex + 1) % areaColorsLen;
|
|
243
203
|
}
|
|
204
|
+
},
|
|
244
205
|
|
|
245
|
-
|
|
206
|
+
/**
|
|
207
|
+
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
|
|
208
|
+
* @param {module:echarts/coord/cartesian/GridModel} gridModel
|
|
209
|
+
* @private
|
|
210
|
+
*/
|
|
211
|
+
_splitArea: function (axisModel, gridModel) {
|
|
212
|
+
rectCoordAxisBuildSplitArea(this, this._axisGroup, axisModel, gridModel);
|
|
246
213
|
}
|
|
247
214
|
});
|
|
248
215
|
CartesianAxisView.extend({
|
|
@@ -45,7 +45,7 @@ var AxisView = require("./AxisView");
|
|
|
45
45
|
* under the License.
|
|
46
46
|
*/
|
|
47
47
|
var axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];
|
|
48
|
-
var selfBuilderAttrs = ['splitLine', 'splitArea'];
|
|
48
|
+
var selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];
|
|
49
49
|
|
|
50
50
|
var _default = AxisView.extend({
|
|
51
51
|
type: 'radiusAxis',
|
|
@@ -61,6 +61,7 @@ var _default = AxisView.extend({
|
|
|
61
61
|
var polar = radiusAxis.polar;
|
|
62
62
|
var angleAxis = polar.getAngleAxis();
|
|
63
63
|
var ticksCoords = radiusAxis.getTicksCoords();
|
|
64
|
+
var minorTicksCoords = radiusAxis.getMinorTicksCoords();
|
|
64
65
|
var axisAngle = angleAxis.getExtent()[0];
|
|
65
66
|
var radiusExtent = radiusAxis.getExtent();
|
|
66
67
|
var layout = layoutAxis(polar, radiusAxisModel, axisAngle);
|
|
@@ -69,7 +70,7 @@ var _default = AxisView.extend({
|
|
|
69
70
|
this.group.add(axisBuilder.getGroup());
|
|
70
71
|
zrUtil.each(selfBuilderAttrs, function (name) {
|
|
71
72
|
if (radiusAxisModel.get(name + '.show') && !radiusAxis.scale.isBlank()) {
|
|
72
|
-
this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords);
|
|
73
|
+
this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);
|
|
73
74
|
}
|
|
74
75
|
}, this);
|
|
75
76
|
},
|
|
@@ -93,8 +94,7 @@ var _default = AxisView.extend({
|
|
|
93
94
|
cx: polar.cx,
|
|
94
95
|
cy: polar.cy,
|
|
95
96
|
r: ticksCoords[i].coord
|
|
96
|
-
}
|
|
97
|
-
silent: true
|
|
97
|
+
}
|
|
98
98
|
}));
|
|
99
99
|
} // Simple optimization
|
|
100
100
|
// Batching the lines if color are the same
|
|
@@ -111,6 +111,38 @@ var _default = AxisView.extend({
|
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
117
|
+
_minorSplitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {
|
|
118
|
+
if (!minorTicksCoords.length) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');
|
|
123
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
124
|
+
var lines = [];
|
|
125
|
+
|
|
126
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
127
|
+
for (var k = 0; k < minorTicksCoords[i].length; k++) {
|
|
128
|
+
lines.push(new graphic.Circle({
|
|
129
|
+
shape: {
|
|
130
|
+
cx: polar.cx,
|
|
131
|
+
cy: polar.cy,
|
|
132
|
+
r: minorTicksCoords[i][k].coord
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
this.group.add(graphic.mergePath(lines, {
|
|
139
|
+
style: zrUtil.defaults({
|
|
140
|
+
fill: null
|
|
141
|
+
}, lineStyleModel.getLineStyle()),
|
|
142
|
+
silent: true
|
|
143
|
+
}));
|
|
144
|
+
},
|
|
145
|
+
|
|
114
146
|
/**
|
|
115
147
|
* @private
|
|
116
148
|
*/
|
|
@@ -28,6 +28,11 @@ var singleAxisHelper = require("../../coord/single/singleAxisHelper");
|
|
|
28
28
|
|
|
29
29
|
var AxisView = require("./AxisView");
|
|
30
30
|
|
|
31
|
+
var _axisSplitHelper = require("./axisSplitHelper");
|
|
32
|
+
|
|
33
|
+
var rectCoordAxisBuildSplitArea = _axisSplitHelper.rectCoordAxisBuildSplitArea;
|
|
34
|
+
var rectCoordAxisHandleRemove = _axisSplitHelper.rectCoordAxisHandleRemove;
|
|
35
|
+
|
|
31
36
|
/*
|
|
32
37
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
33
38
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -47,24 +52,31 @@ var AxisView = require("./AxisView");
|
|
|
47
52
|
* under the License.
|
|
48
53
|
*/
|
|
49
54
|
var axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];
|
|
50
|
-
var
|
|
55
|
+
var selfBuilderAttrs = ['splitArea', 'splitLine'];
|
|
51
56
|
var SingleAxisView = AxisView.extend({
|
|
52
57
|
type: 'singleAxis',
|
|
53
58
|
axisPointerClass: 'SingleAxisPointer',
|
|
54
59
|
render: function (axisModel, ecModel, api, payload) {
|
|
55
60
|
var group = this.group;
|
|
56
61
|
group.removeAll();
|
|
62
|
+
var oldAxisGroup = this._axisGroup;
|
|
63
|
+
this._axisGroup = new graphic.Group();
|
|
57
64
|
var layout = singleAxisHelper.layout(axisModel);
|
|
58
65
|
var axisBuilder = new AxisBuilder(axisModel, layout);
|
|
59
66
|
zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
|
|
67
|
+
group.add(this._axisGroup);
|
|
60
68
|
group.add(axisBuilder.getGroup());
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
zrUtil.each(selfBuilderAttrs, function (name) {
|
|
70
|
+
if (axisModel.get(name + '.show')) {
|
|
71
|
+
this['_' + name](axisModel);
|
|
72
|
+
}
|
|
73
|
+
}, this);
|
|
74
|
+
graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);
|
|
66
75
|
SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload);
|
|
67
76
|
},
|
|
77
|
+
remove: function () {
|
|
78
|
+
rectCoordAxisHandleRemove(this);
|
|
79
|
+
},
|
|
68
80
|
_splitLine: function (axisModel) {
|
|
69
81
|
var axis = axisModel.axis;
|
|
70
82
|
|
|
@@ -129,6 +141,9 @@ var SingleAxisView = AxisView.extend({
|
|
|
129
141
|
silent: true
|
|
130
142
|
}));
|
|
131
143
|
}
|
|
144
|
+
},
|
|
145
|
+
_splitArea: function (axisModel) {
|
|
146
|
+
rectCoordAxisBuildSplitArea(this, this._axisGroup, axisModel, axisModel);
|
|
132
147
|
}
|
|
133
148
|
});
|
|
134
149
|
var _default = SingleAxisView;
|