echarts 4.4.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/.github/ISSUE_TEMPLATE.md +1 -1
- package/.github/workflows/nodejs.yml +31 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +6 -12
- package/dist/echarts-en.common.js +2354 -1029
- package/dist/echarts-en.common.min.js +1 -1
- package/dist/echarts-en.js +2727 -1138
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +1 -1
- package/dist/echarts-en.simple.js +2028 -759
- package/dist/echarts-en.simple.min.js +1 -1
- package/dist/echarts.common.js +2354 -1029
- package/dist/echarts.common.min.js +1 -1
- package/dist/echarts.js +2727 -1138
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +1 -1
- package/dist/echarts.simple.js +2028 -759
- package/dist/echarts.simple.min.js +1 -1
- package/dist/extension/dataTool.js +9 -0
- package/dist/extension/dataTool.js.map +1 -1
- package/echarts.all.js +1 -1
- package/lib/chart/bar/BarSeries.js +4 -1
- package/lib/chart/bar/BarView.js +20 -6
- package/lib/chart/bar/BaseBarSeries.js +5 -1
- package/lib/chart/candlestick/CandlestickSeries.js +1 -0
- package/lib/chart/candlestick/CandlestickView.js +42 -1
- package/lib/chart/custom.js +1 -0
- package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
- package/lib/chart/funnel/FunnelSeries.js +15 -5
- package/lib/chart/gauge/GaugeSeries.js +0 -9
- package/lib/chart/graph/GraphSeries.js +11 -4
- package/lib/chart/graph/GraphView.js +28 -8
- package/lib/chart/graph/forceHelper.js +8 -2
- package/lib/chart/graph/forceLayout.js +5 -2
- package/lib/chart/heatmap/HeatmapView.js +4 -4
- package/lib/chart/helper/Symbol.js +8 -0
- 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/chart/tree/TreeView.js +4 -2
- package/lib/component/axis/AngleAxisView.js +97 -20
- 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/brush/BrushView.js +6 -0
- package/lib/component/brush/brushAction.js +5 -0
- package/lib/component/dataZoom/DataZoomModel.js +15 -1
- package/lib/component/dataZoom/SliderZoomView.js +4 -10
- package/lib/component/helper/BrushController.js +43 -25
- package/lib/component/legend/LegendModel.js +3 -3
- package/lib/component/legend/LegendView.js +17 -13
- package/lib/component/toolbox/ToolboxView.js +16 -7
- package/lib/component/toolbox/feature/MagicType.js +19 -14
- package/lib/coord/Axis.js +44 -12
- package/lib/coord/axisDefault.js +21 -2
- package/lib/coord/axisTickLabelBuilder.js +9 -1
- package/lib/coord/cartesian/Cartesian2D.js +0 -15
- package/lib/coord/geo/geoJSONLoader.js +1 -1
- package/lib/coord/polar/polarCreator.js +11 -2
- package/lib/coord/radar/Radar.js +3 -1
- package/lib/coord/radar/RadarModel.js +4 -1
- package/lib/data/DataDiffer.js +2 -4
- package/lib/data/DataDimensionInfo.js +157 -0
- package/lib/data/List.js +29 -23
- 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 +136 -11
- package/lib/layout/barPolar.js +2 -2
- package/lib/model/Global.js +1 -1
- 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/util/number.js +25 -1
- package/lib/util/shape/sausage.js +93 -0
- package/lib/visual/LegendVisualProvider.js +75 -0
- package/lib/visual/dataColor.js +2 -12
- package/lib/visual/seriesColor.js +15 -7
- package/map/js/china.js +2 -2
- package/map/json/china.json +1 -1
- package/map/json/province/tianjin.json +1 -1
- package/package.json +3 -2
- package/src/chart/bar/BarSeries.js +5 -1
- package/src/chart/bar/BarView.js +24 -8
- package/src/chart/bar/BaseBarSeries.js +5 -1
- package/src/chart/candlestick/CandlestickSeries.js +2 -0
- package/src/chart/candlestick/CandlestickView.js +44 -1
- package/src/chart/custom.js +1 -0
- package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
- package/src/chart/funnel/FunnelSeries.js +11 -4
- package/src/chart/gauge/GaugeSeries.js +0 -6
- package/src/chart/graph/GraphSeries.js +10 -3
- package/src/chart/graph/GraphView.js +26 -8
- package/src/chart/graph/forceHelper.js +7 -3
- package/src/chart/graph/forceLayout.js +6 -3
- package/src/chart/heatmap/HeatmapView.js +4 -4
- package/src/chart/helper/Symbol.js +9 -0
- package/src/chart/helper/createClipPathFromCoordSys.js +5 -1
- package/src/chart/helper/createGraphFromNodeEdge.js +1 -1
- 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/chart/tree/TreeView.js +5 -2
- package/src/component/axis/AngleAxisView.js +106 -19
- 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/brush/BrushView.js +6 -0
- package/src/component/brush/brushAction.js +6 -1
- package/src/component/dataZoom/DataZoomModel.js +15 -1
- package/src/component/dataZoom/SliderZoomView.js +4 -9
- package/src/component/helper/BrushController.js +50 -28
- package/src/component/legend/LegendModel.js +3 -3
- package/src/component/legend/LegendView.js +18 -12
- package/src/component/toolbox/ToolboxView.js +18 -5
- package/src/component/toolbox/feature/MagicType.js +18 -13
- package/src/coord/Axis.js +48 -13
- package/src/coord/axisDefault.js +25 -1
- package/src/coord/axisTickLabelBuilder.js +10 -0
- package/src/coord/cartesian/Cartesian2D.js +0 -13
- package/src/coord/geo/geoJSONLoader.js +2 -2
- package/src/coord/polar/polarCreator.js +16 -3
- package/src/coord/radar/Radar.js +3 -1
- package/src/coord/radar/RadarModel.js +5 -2
- package/src/data/DataDiffer.js +1 -4
- package/src/data/DataDimensionInfo.js +135 -0
- package/src/data/Graph.js +1 -1
- package/src/data/List.js +33 -20
- 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 +136 -13
- package/src/layout/barPolar.js +3 -2
- package/src/model/Global.js +1 -1
- 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/util/number.js +22 -2
- package/src/util/shape/sausage.js +93 -0
- 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/.travis.yml +0 -16
|
@@ -24,6 +24,7 @@ var retrieve = _util.retrieve;
|
|
|
24
24
|
var defaults = _util.defaults;
|
|
25
25
|
var extend = _util.extend;
|
|
26
26
|
var each = _util.each;
|
|
27
|
+
var map = _util.map;
|
|
27
28
|
|
|
28
29
|
var formatUtil = require("../../util/format");
|
|
29
30
|
|
|
@@ -248,9 +249,10 @@ var builders = {
|
|
|
248
249
|
axisTickLabel: function () {
|
|
249
250
|
var axisModel = this.axisModel;
|
|
250
251
|
var opt = this.opt;
|
|
251
|
-
var
|
|
252
|
+
var ticksEls = buildAxisMajorTicks(this, axisModel, opt);
|
|
252
253
|
var labelEls = buildAxisLabel(this, axisModel, opt);
|
|
253
|
-
fixMinMaxLabelShow(axisModel, labelEls,
|
|
254
|
+
fixMinMaxLabelShow(axisModel, labelEls, ticksEls);
|
|
255
|
+
buildAxisMinorTicks(this, axisModel, opt);
|
|
254
256
|
},
|
|
255
257
|
|
|
256
258
|
/**
|
|
@@ -519,38 +521,27 @@ function isNameLocationCenter(nameLocation) {
|
|
|
519
521
|
return nameLocation === 'middle' || nameLocation === 'center';
|
|
520
522
|
}
|
|
521
523
|
|
|
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();
|
|
524
|
+
function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, aniid) {
|
|
525
|
+
var tickEls = [];
|
|
533
526
|
var pt1 = [];
|
|
534
527
|
var pt2 = [];
|
|
535
|
-
var matrix = axisBuilder._transform;
|
|
536
|
-
var tickEls = [];
|
|
537
528
|
|
|
538
529
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
539
530
|
var tickCoord = ticksCoords[i].coord;
|
|
540
531
|
pt1[0] = tickCoord;
|
|
541
532
|
pt1[1] = 0;
|
|
542
533
|
pt2[0] = tickCoord;
|
|
543
|
-
pt2[1] =
|
|
534
|
+
pt2[1] = tickEndCoord;
|
|
544
535
|
|
|
545
|
-
if (
|
|
546
|
-
v2ApplyTransform(pt1, pt1,
|
|
547
|
-
v2ApplyTransform(pt2, pt2,
|
|
536
|
+
if (tickTransform) {
|
|
537
|
+
v2ApplyTransform(pt1, pt1, tickTransform);
|
|
538
|
+
v2ApplyTransform(pt2, pt2, tickTransform);
|
|
548
539
|
} // Tick line, Not use group transform to have better line draw
|
|
549
540
|
|
|
550
541
|
|
|
551
542
|
var tickEl = new graphic.Line({
|
|
552
543
|
// Id for animation
|
|
553
|
-
anid: '
|
|
544
|
+
anid: aniid + '_' + ticksCoords[i].tickValue,
|
|
554
545
|
subPixelOptimize: true,
|
|
555
546
|
shape: {
|
|
556
547
|
x1: pt1[0],
|
|
@@ -558,19 +549,67 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
|
|
|
558
549
|
x2: pt2[0],
|
|
559
550
|
y2: pt2[1]
|
|
560
551
|
},
|
|
561
|
-
style:
|
|
562
|
-
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
563
|
-
}),
|
|
552
|
+
style: tickLineStyle,
|
|
564
553
|
z2: 2,
|
|
565
554
|
silent: true
|
|
566
555
|
});
|
|
567
|
-
axisBuilder.group.add(tickEl);
|
|
568
556
|
tickEls.push(tickEl);
|
|
569
557
|
}
|
|
570
558
|
|
|
571
559
|
return tickEls;
|
|
572
560
|
}
|
|
573
561
|
|
|
562
|
+
function buildAxisMajorTicks(axisBuilder, axisModel, opt) {
|
|
563
|
+
var axis = axisModel.axis;
|
|
564
|
+
var tickModel = axisModel.getModel('axisTick');
|
|
565
|
+
|
|
566
|
+
if (!tickModel.get('show') || axis.scale.isBlank()) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
var lineStyleModel = tickModel.getModel('lineStyle');
|
|
571
|
+
var tickEndCoord = opt.tickDirection * tickModel.get('length');
|
|
572
|
+
var ticksCoords = axis.getTicksCoords();
|
|
573
|
+
var ticksEls = createTicks(ticksCoords, axisBuilder._transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {
|
|
574
|
+
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
575
|
+
}), 'ticks');
|
|
576
|
+
|
|
577
|
+
for (var i = 0; i < ticksEls.length; i++) {
|
|
578
|
+
axisBuilder.group.add(ticksEls[i]);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return ticksEls;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function buildAxisMinorTicks(axisBuilder, axisModel, opt) {
|
|
585
|
+
var axis = axisModel.axis;
|
|
586
|
+
var minorTickModel = axisModel.getModel('minorTick');
|
|
587
|
+
|
|
588
|
+
if (!minorTickModel.get('show') || axis.scale.isBlank()) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
593
|
+
|
|
594
|
+
if (!minorTicksCoords.length) {
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
var lineStyleModel = minorTickModel.getModel('lineStyle');
|
|
599
|
+
var tickEndCoord = opt.tickDirection * minorTickModel.get('length');
|
|
600
|
+
var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {
|
|
601
|
+
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
602
|
+
}));
|
|
603
|
+
|
|
604
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
605
|
+
var minorTicksEls = createTicks(minorTicksCoords[i], axisBuilder._transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);
|
|
606
|
+
|
|
607
|
+
for (var k = 0; k < minorTicksEls.length; k++) {
|
|
608
|
+
axisBuilder.group.add(minorTicksEls[k]);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
574
613
|
function buildAxisLabel(axisBuilder, axisModel, opt) {
|
|
575
614
|
var axis = axisModel.axis;
|
|
576
615
|
var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show'));
|
|
@@ -47,14 +47,7 @@ var cartesianAxisHelper = require("../../coord/cartesian/cartesianAxisHelper");
|
|
|
47
47
|
* under the License.
|
|
48
48
|
*/
|
|
49
49
|
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
|
-
|
|
50
|
+
var selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];
|
|
58
51
|
var CartesianAxisView = AxisView.extend({
|
|
59
52
|
type: 'cartesianAxis',
|
|
60
53
|
axisPointerClass: 'CartesianAxisPointer',
|
|
@@ -114,9 +107,7 @@ var CartesianAxisView = AxisView.extend({
|
|
|
114
107
|
tickModel: splitLineModel
|
|
115
108
|
});
|
|
116
109
|
var p1 = [];
|
|
117
|
-
var p2 = [];
|
|
118
|
-
// Batching the lines if color are the same
|
|
119
|
-
|
|
110
|
+
var p2 = [];
|
|
120
111
|
var lineStyle = lineStyleModel.getLineStyle();
|
|
121
112
|
|
|
122
113
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
@@ -154,6 +145,59 @@ var CartesianAxisView = AxisView.extend({
|
|
|
154
145
|
}
|
|
155
146
|
},
|
|
156
147
|
|
|
148
|
+
/**
|
|
149
|
+
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
|
|
150
|
+
* @param {module:echarts/coord/cartesian/GridModel} gridModel
|
|
151
|
+
* @private
|
|
152
|
+
*/
|
|
153
|
+
_minorSplitLine: function (axisModel, gridModel) {
|
|
154
|
+
var axis = axisModel.axis;
|
|
155
|
+
var minorSplitLineModel = axisModel.getModel('minorSplitLine');
|
|
156
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
157
|
+
var gridRect = gridModel.coordinateSystem.getRect();
|
|
158
|
+
var isHorizontal = axis.isHorizontal();
|
|
159
|
+
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
160
|
+
|
|
161
|
+
if (!minorTicksCoords.length) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
var p1 = [];
|
|
166
|
+
var p2 = [];
|
|
167
|
+
var lineStyle = lineStyleModel.getLineStyle();
|
|
168
|
+
|
|
169
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
170
|
+
for (var k = 0; k < minorTicksCoords[i].length; k++) {
|
|
171
|
+
var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);
|
|
172
|
+
|
|
173
|
+
if (isHorizontal) {
|
|
174
|
+
p1[0] = tickCoord;
|
|
175
|
+
p1[1] = gridRect.y;
|
|
176
|
+
p2[0] = tickCoord;
|
|
177
|
+
p2[1] = gridRect.y + gridRect.height;
|
|
178
|
+
} else {
|
|
179
|
+
p1[0] = gridRect.x;
|
|
180
|
+
p1[1] = tickCoord;
|
|
181
|
+
p2[0] = gridRect.x + gridRect.width;
|
|
182
|
+
p2[1] = tickCoord;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
this._axisGroup.add(new graphic.Line({
|
|
186
|
+
anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,
|
|
187
|
+
subPixelOptimize: true,
|
|
188
|
+
shape: {
|
|
189
|
+
x1: p1[0],
|
|
190
|
+
y1: p1[1],
|
|
191
|
+
x2: p2[0],
|
|
192
|
+
y2: p2[1]
|
|
193
|
+
},
|
|
194
|
+
style: lineStyle,
|
|
195
|
+
silent: true
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
|
|
157
201
|
/**
|
|
158
202
|
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
|
|
159
203
|
* @param {module:echarts/coord/cartesian/GridModel} gridModel
|
|
@@ -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
|
*/
|
|
@@ -119,6 +119,12 @@ var _default = echarts.extendComponentView({
|
|
|
119
119
|
areas: zrUtil.clone(areas),
|
|
120
120
|
$from: modelId
|
|
121
121
|
});
|
|
122
|
+
opt.isEnd && this.api.dispatchAction({
|
|
123
|
+
type: 'brushEnd',
|
|
124
|
+
brushId: modelId,
|
|
125
|
+
areas: zrUtil.clone(areas),
|
|
126
|
+
$from: modelId
|
|
127
|
+
});
|
|
122
128
|
}
|
|
123
129
|
});
|
|
124
130
|
|
|
@@ -144,7 +144,21 @@ var DataZoomModel = echarts.extendComponentModel({
|
|
|
144
144
|
|
|
145
145
|
this._autoThrottle = true;
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
147
|
+
* It is `[rangeModeForMin, rangeModeForMax]`.
|
|
148
|
+
* The optional values for `rangeMode`:
|
|
149
|
+
* + `'value'` mode: the axis extent will always be determined by
|
|
150
|
+
* `dataZoom.startValue` and `dataZoom.endValue`, despite
|
|
151
|
+
* how data like and how `axis.min` and `axis.max` are.
|
|
152
|
+
* + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,
|
|
153
|
+
* where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,
|
|
154
|
+
* and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.
|
|
155
|
+
* Axis extent will be determined by the result of the percent of `[dMin, dMax]`.
|
|
156
|
+
*
|
|
157
|
+
* For example, when users are using dynamic data (update data periodically via `setOption`),
|
|
158
|
+
* if in `'value`' mode, the window will be kept in a fixed value range despite how
|
|
159
|
+
* data are appended, while if in `'percent'` mode, whe window range will be changed alone with
|
|
160
|
+
* the appended data (suppose `axis.min` and `axis.max` are not specified).
|
|
161
|
+
*
|
|
148
162
|
* @private
|
|
149
163
|
*/
|
|
150
164
|
|
|
@@ -435,10 +435,6 @@ var SliderZoomView = DataZoomView.extend({
|
|
|
435
435
|
draggable: true,
|
|
436
436
|
cursor: getCursor(this._orient),
|
|
437
437
|
drift: bind(this._onDragMove, this, 'all'),
|
|
438
|
-
onmousemove: function (e) {
|
|
439
|
-
// Fot mobile devicem, prevent screen slider on the button.
|
|
440
|
-
eventTool.stop(e.event);
|
|
441
|
-
},
|
|
442
438
|
ondragstart: bind(this._showDataInfo, this, true),
|
|
443
439
|
ondragend: bind(this._onDragEnd, this),
|
|
444
440
|
onmouseover: bind(this._showDataInfo, this, true),
|
|
@@ -469,10 +465,6 @@ var SliderZoomView = DataZoomView.extend({
|
|
|
469
465
|
cursor: getCursor(this._orient),
|
|
470
466
|
draggable: true,
|
|
471
467
|
drift: bind(this._onDragMove, this, handleIndex),
|
|
472
|
-
onmousemove: function (e) {
|
|
473
|
-
// Fot mobile devicem, prevent screen slider on the button.
|
|
474
|
-
eventTool.stop(e.event);
|
|
475
|
-
},
|
|
476
468
|
ondragend: bind(this._onDragEnd, this),
|
|
477
469
|
onmouseover: bind(this._showDataInfo, this, true),
|
|
478
470
|
onmouseout: bind(this._showDataInfo, this, false)
|
|
@@ -647,8 +639,10 @@ var SliderZoomView = DataZoomView.extend({
|
|
|
647
639
|
handleLabels[0].attr('invisible', !showOrHide);
|
|
648
640
|
handleLabels[1].attr('invisible', !showOrHide);
|
|
649
641
|
},
|
|
650
|
-
_onDragMove: function (handleIndex, dx, dy) {
|
|
651
|
-
this._dragging = true; //
|
|
642
|
+
_onDragMove: function (handleIndex, dx, dy, event) {
|
|
643
|
+
this._dragging = true; // For mobile device, prevent screen slider on the button.
|
|
644
|
+
|
|
645
|
+
eventTool.stop(event.event); // Transform dx, dy to bar coordination.
|
|
652
646
|
|
|
653
647
|
var barTransform = this._displayables.barGroup.getLocalTransform();
|
|
654
648
|
|
|
@@ -194,7 +194,7 @@ function BrushController(zr) {
|
|
|
194
194
|
*/
|
|
195
195
|
|
|
196
196
|
this._handlers = {};
|
|
197
|
-
each(
|
|
197
|
+
each(pointerHandlers, function (handler, eventName) {
|
|
198
198
|
this._handlers[eventName] = zrUtil.bind(handler, this);
|
|
199
199
|
}, this);
|
|
200
200
|
}
|
|
@@ -345,9 +345,7 @@ function doEnableBrush(controller, brushOption) {
|
|
|
345
345
|
interactionMutex.take(zr, MUTEX_RESOURCE_KEY, controller._uid);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
|
|
349
|
-
zr.on(eventName, handler);
|
|
350
|
-
});
|
|
348
|
+
mountHandlers(zr, controller._handlers);
|
|
351
349
|
controller._brushType = brushOption.brushType;
|
|
352
350
|
controller._brushOption = zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
|
|
353
351
|
}
|
|
@@ -355,10 +353,20 @@ function doEnableBrush(controller, brushOption) {
|
|
|
355
353
|
function doDisableBrush(controller) {
|
|
356
354
|
var zr = controller._zr;
|
|
357
355
|
interactionMutex.release(zr, MUTEX_RESOURCE_KEY, controller._uid);
|
|
358
|
-
|
|
356
|
+
unmountHandlers(zr, controller._handlers);
|
|
357
|
+
controller._brushType = controller._brushOption = null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function mountHandlers(zr, handlers) {
|
|
361
|
+
each(handlers, function (handler, eventName) {
|
|
362
|
+
zr.on(eventName, handler);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function unmountHandlers(zr, handlers) {
|
|
367
|
+
each(handlers, function (handler, eventName) {
|
|
359
368
|
zr.off(eventName, handler);
|
|
360
369
|
});
|
|
361
|
-
controller._brushType = controller._brushOption = null;
|
|
362
370
|
}
|
|
363
371
|
|
|
364
372
|
function createCover(controller, brushOption) {
|
|
@@ -661,8 +669,11 @@ function pointsToRect(points) {
|
|
|
661
669
|
}
|
|
662
670
|
|
|
663
671
|
function resetCursor(controller, e, localCursorPoint) {
|
|
664
|
-
// Check active
|
|
665
|
-
|
|
672
|
+
if ( // Check active
|
|
673
|
+
!controller._brushType // resetCursor should be always called when mouse is in zr area,
|
|
674
|
+
// but not called when mouse is out of zr area to avoid bad influence
|
|
675
|
+
// if `mousemove`, `mouseup` are triggered from `document` event.
|
|
676
|
+
|| isOutsideZrArea(controller, e)) {
|
|
666
677
|
return;
|
|
667
678
|
}
|
|
668
679
|
|
|
@@ -752,12 +763,12 @@ function determineBrushType(brushType, panel) {
|
|
|
752
763
|
return brushType;
|
|
753
764
|
}
|
|
754
765
|
|
|
755
|
-
var
|
|
766
|
+
var pointerHandlers = {
|
|
756
767
|
mousedown: function (e) {
|
|
757
768
|
if (this._dragging) {
|
|
758
769
|
// In case some browser do not support globalOut,
|
|
759
770
|
// and release mose out side the browser.
|
|
760
|
-
handleDragEnd
|
|
771
|
+
handleDragEnd(this, e);
|
|
761
772
|
} else if (!e.target || !e.target.draggable) {
|
|
762
773
|
preventDefault(e);
|
|
763
774
|
var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);
|
|
@@ -771,7 +782,9 @@ var mouseHandlers = {
|
|
|
771
782
|
}
|
|
772
783
|
},
|
|
773
784
|
mousemove: function (e) {
|
|
774
|
-
var
|
|
785
|
+
var x = e.offsetX;
|
|
786
|
+
var y = e.offsetY;
|
|
787
|
+
var localCursorPoint = this.group.transformCoordToLocal(x, y);
|
|
775
788
|
resetCursor(this, e, localCursorPoint);
|
|
776
789
|
|
|
777
790
|
if (this._dragging) {
|
|
@@ -780,25 +793,30 @@ var mouseHandlers = {
|
|
|
780
793
|
eventParams && trigger(this, eventParams);
|
|
781
794
|
}
|
|
782
795
|
},
|
|
783
|
-
mouseup:
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
// globalout: handleDragEnd
|
|
787
|
-
|
|
796
|
+
mouseup: function (e) {
|
|
797
|
+
handleDragEnd(this, e);
|
|
798
|
+
}
|
|
788
799
|
};
|
|
789
800
|
|
|
790
|
-
function handleDragEnd(e) {
|
|
791
|
-
if (
|
|
801
|
+
function handleDragEnd(controller, e) {
|
|
802
|
+
if (controller._dragging) {
|
|
792
803
|
preventDefault(e);
|
|
793
|
-
var
|
|
794
|
-
var
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
804
|
+
var x = e.offsetX;
|
|
805
|
+
var y = e.offsetY;
|
|
806
|
+
var localCursorPoint = controller.group.transformCoordToLocal(x, y);
|
|
807
|
+
var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);
|
|
808
|
+
controller._dragging = false;
|
|
809
|
+
controller._track = [];
|
|
810
|
+
controller._creatingCover = null; // trigger event shoule be at final, after procedure will be nested.
|
|
811
|
+
|
|
812
|
+
eventParams && trigger(controller, eventParams);
|
|
800
813
|
}
|
|
801
814
|
}
|
|
815
|
+
|
|
816
|
+
function isOutsideZrArea(controller, x, y) {
|
|
817
|
+
var zr = controller._zr;
|
|
818
|
+
return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();
|
|
819
|
+
}
|
|
802
820
|
/**
|
|
803
821
|
* key: brushType
|
|
804
822
|
* @type {Object}
|
|
@@ -131,9 +131,9 @@ var LegendModel = echarts.extendComponentModel({
|
|
|
131
131
|
availableNames.push(seriesName);
|
|
132
132
|
var isPotential;
|
|
133
133
|
|
|
134
|
-
if (seriesModel.
|
|
135
|
-
var
|
|
136
|
-
var names =
|
|
134
|
+
if (seriesModel.legendVisualProvider) {
|
|
135
|
+
var provider = seriesModel.legendVisualProvider;
|
|
136
|
+
var names = provider.getAllNames();
|
|
137
137
|
|
|
138
138
|
if (!ecModel.isSeriesFiltered(seriesModel)) {
|
|
139
139
|
availableNames = availableNames.concat(names);
|
|
@@ -191,7 +191,7 @@ var _default = echarts.extendComponentView({
|
|
|
191
191
|
if (legendDrawnMap.get(name)) {
|
|
192
192
|
// Have been drawed
|
|
193
193
|
return;
|
|
194
|
-
} //
|
|
194
|
+
} // Legend to control series.
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
if (seriesModel) {
|
|
@@ -216,32 +216,32 @@ var _default = echarts.extendComponentView({
|
|
|
216
216
|
|
|
217
217
|
var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, borderColor, selectMode);
|
|
218
218
|
|
|
219
|
-
itemGroup.on('click', curry(dispatchSelectAction, name, api)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
|
|
219
|
+
itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
|
|
220
220
|
legendDrawnMap.set(name, true);
|
|
221
221
|
} else {
|
|
222
|
-
//
|
|
222
|
+
// Legend to control data. In pie and funnel.
|
|
223
223
|
ecModel.eachRawSeries(function (seriesModel) {
|
|
224
224
|
// In case multiple series has same data name
|
|
225
225
|
if (legendDrawnMap.get(name)) {
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
if (seriesModel.
|
|
230
|
-
var
|
|
231
|
-
var idx = data.indexOfName(name);
|
|
229
|
+
if (seriesModel.legendVisualProvider) {
|
|
230
|
+
var provider = seriesModel.legendVisualProvider;
|
|
232
231
|
|
|
233
|
-
if (
|
|
232
|
+
if (!provider.containName(name)) {
|
|
234
233
|
return;
|
|
235
234
|
}
|
|
236
235
|
|
|
237
|
-
var
|
|
238
|
-
var
|
|
236
|
+
var idx = provider.indexOfName(name);
|
|
237
|
+
var color = provider.getItemVisual(idx, 'color');
|
|
238
|
+
var borderColor = provider.getItemVisual(idx, 'borderColor');
|
|
239
239
|
var legendSymbolType = 'roundRect';
|
|
240
240
|
|
|
241
241
|
var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, borderColor, selectMode); // FIXME: consider different series has items with the same name.
|
|
242
242
|
|
|
243
243
|
|
|
244
|
-
itemGroup.on('click', curry(dispatchSelectAction, name, api)) // Should not specify the series name, consider legend controls
|
|
244
|
+
itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls
|
|
245
245
|
// more than one pie series.
|
|
246
246
|
.on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));
|
|
247
247
|
legendDrawnMap.set(name, true);
|
|
@@ -442,11 +442,15 @@ function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, i
|
|
|
442
442
|
return symbol.setStyle(itemStyle);
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
function dispatchSelectAction(
|
|
445
|
+
function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
|
|
446
|
+
// downplay before unselect
|
|
447
|
+
dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);
|
|
446
448
|
api.dispatchAction({
|
|
447
449
|
type: 'legendToggleSelect',
|
|
448
|
-
name:
|
|
449
|
-
});
|
|
450
|
+
name: seriesName != null ? seriesName : dataName
|
|
451
|
+
}); // highlight after select
|
|
452
|
+
|
|
453
|
+
dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);
|
|
450
454
|
}
|
|
451
455
|
|
|
452
456
|
function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
|
|
@@ -78,7 +78,11 @@ var _default = echarts.extendComponentView({
|
|
|
78
78
|
var oldName = featureNames[oldIndex];
|
|
79
79
|
var featureOpt = featureOpts[featureName];
|
|
80
80
|
var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
|
|
81
|
-
var feature;
|
|
81
|
+
var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?
|
|
82
|
+
|
|
83
|
+
if (payload && payload.newTitle != null) {
|
|
84
|
+
featureOpt.title = payload.newTitle;
|
|
85
|
+
}
|
|
82
86
|
|
|
83
87
|
if (featureName && !oldName) {
|
|
84
88
|
// Create
|
|
@@ -172,7 +176,15 @@ var _default = echarts.extendComponentView({
|
|
|
172
176
|
height: itemSize
|
|
173
177
|
});
|
|
174
178
|
path.setStyle(iconStyleModel.getItemStyle());
|
|
175
|
-
path.hoverStyle = iconStyleEmphasisModel.getItemStyle();
|
|
179
|
+
path.hoverStyle = iconStyleEmphasisModel.getItemStyle(); // Text position calculation
|
|
180
|
+
|
|
181
|
+
path.setStyle({
|
|
182
|
+
text: titles[iconName],
|
|
183
|
+
textAlign: iconStyleEmphasisModel.get('textAlign'),
|
|
184
|
+
textBorderRadius: iconStyleEmphasisModel.get('textBorderRadius'),
|
|
185
|
+
textPadding: iconStyleEmphasisModel.get('textPadding'),
|
|
186
|
+
textFill: null
|
|
187
|
+
});
|
|
176
188
|
var tooltipModel = toolboxModel.getModel('tooltip');
|
|
177
189
|
|
|
178
190
|
if (tooltipModel && tooltipModel.get('show')) {
|
|
@@ -198,14 +210,11 @@ var _default = echarts.extendComponentView({
|
|
|
198
210
|
path.on('mouseover', function () {
|
|
199
211
|
// Should not reuse above hoverStyle, which might be modified.
|
|
200
212
|
var hoverStyle = iconStyleEmphasisModel.getItemStyle();
|
|
213
|
+
var defaultTextPosition = toolboxModel.get('orient') === 'vertical' ? toolboxModel.get('right') == null ? 'right' : 'left' : toolboxModel.get('bottom') == null ? 'bottom' : 'top';
|
|
201
214
|
path.setStyle({
|
|
202
|
-
text: titles[iconName],
|
|
203
|
-
textPosition: iconStyleEmphasisModel.get('textPosition') || 'bottom',
|
|
204
215
|
textFill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',
|
|
205
|
-
textAlign: iconStyleEmphasisModel.get('textAlign') || 'center',
|
|
206
216
|
textBackgroundColor: iconStyleEmphasisModel.get('textBackgroundColor'),
|
|
207
|
-
|
|
208
|
-
textPadding: iconStyleEmphasisModel.get('textPadding')
|
|
217
|
+
textPosition: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition
|
|
209
218
|
});
|
|
210
219
|
}).on('mouseout', function () {
|
|
211
220
|
path.setStyle({
|