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
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import {retrieve, defaults, extend, each} from 'zrender/src/core/util';
|
|
20
|
+
import {retrieve, defaults, extend, each, map} from 'zrender/src/core/util';
|
|
21
21
|
import * as formatUtil from '../../util/format';
|
|
22
22
|
import * as graphic from '../../util/graphic';
|
|
23
23
|
import Model from '../../model/Model';
|
|
@@ -246,10 +246,12 @@ var builders = {
|
|
|
246
246
|
var axisModel = this.axisModel;
|
|
247
247
|
var opt = this.opt;
|
|
248
248
|
|
|
249
|
-
var
|
|
249
|
+
var ticksEls = buildAxisMajorTicks(this, axisModel, opt);
|
|
250
250
|
var labelEls = buildAxisLabel(this, axisModel, opt);
|
|
251
251
|
|
|
252
|
-
fixMinMaxLabelShow(axisModel, labelEls,
|
|
252
|
+
fixMinMaxLabelShow(axisModel, labelEls, ticksEls);
|
|
253
|
+
|
|
254
|
+
buildAxisMinorTicks(this, axisModel, opt);
|
|
253
255
|
},
|
|
254
256
|
|
|
255
257
|
/**
|
|
@@ -568,42 +570,27 @@ function isNameLocationCenter(nameLocation) {
|
|
|
568
570
|
return nameLocation === 'middle' || nameLocation === 'center';
|
|
569
571
|
}
|
|
570
572
|
|
|
571
|
-
function buildAxisTick(axisBuilder, axisModel, opt) {
|
|
572
|
-
var axis = axisModel.axis;
|
|
573
|
-
|
|
574
|
-
if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) {
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
var tickModel = axisModel.getModel('axisTick');
|
|
579
|
-
|
|
580
|
-
var lineStyleModel = tickModel.getModel('lineStyle');
|
|
581
|
-
var tickLen = tickModel.get('length');
|
|
582
|
-
|
|
583
|
-
var ticksCoords = axis.getTicksCoords();
|
|
584
573
|
|
|
574
|
+
function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, aniid) {
|
|
575
|
+
var tickEls = [];
|
|
585
576
|
var pt1 = [];
|
|
586
577
|
var pt2 = [];
|
|
587
|
-
var matrix = axisBuilder._transform;
|
|
588
|
-
|
|
589
|
-
var tickEls = [];
|
|
590
|
-
|
|
591
578
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
592
579
|
var tickCoord = ticksCoords[i].coord;
|
|
593
580
|
|
|
594
581
|
pt1[0] = tickCoord;
|
|
595
582
|
pt1[1] = 0;
|
|
596
583
|
pt2[0] = tickCoord;
|
|
597
|
-
pt2[1] =
|
|
584
|
+
pt2[1] = tickEndCoord;
|
|
598
585
|
|
|
599
|
-
if (
|
|
600
|
-
v2ApplyTransform(pt1, pt1,
|
|
601
|
-
v2ApplyTransform(pt2, pt2,
|
|
586
|
+
if (tickTransform) {
|
|
587
|
+
v2ApplyTransform(pt1, pt1, tickTransform);
|
|
588
|
+
v2ApplyTransform(pt2, pt2, tickTransform);
|
|
602
589
|
}
|
|
603
590
|
// Tick line, Not use group transform to have better line draw
|
|
604
591
|
var tickEl = new graphic.Line({
|
|
605
592
|
// Id for animation
|
|
606
|
-
anid: '
|
|
593
|
+
anid: aniid + '_' + ticksCoords[i].tickValue,
|
|
607
594
|
subPixelOptimize: true,
|
|
608
595
|
shape: {
|
|
609
596
|
x1: pt1[0],
|
|
@@ -611,22 +598,80 @@ function buildAxisTick(axisBuilder, axisModel, opt) {
|
|
|
611
598
|
x2: pt2[0],
|
|
612
599
|
y2: pt2[1]
|
|
613
600
|
},
|
|
614
|
-
style:
|
|
615
|
-
lineStyleModel.getLineStyle(),
|
|
616
|
-
{
|
|
617
|
-
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
618
|
-
}
|
|
619
|
-
),
|
|
601
|
+
style: tickLineStyle,
|
|
620
602
|
z2: 2,
|
|
621
603
|
silent: true
|
|
622
604
|
});
|
|
623
|
-
axisBuilder.group.add(tickEl);
|
|
624
605
|
tickEls.push(tickEl);
|
|
625
606
|
}
|
|
626
|
-
|
|
627
607
|
return tickEls;
|
|
628
608
|
}
|
|
629
609
|
|
|
610
|
+
function buildAxisMajorTicks(axisBuilder, axisModel, opt) {
|
|
611
|
+
var axis = axisModel.axis;
|
|
612
|
+
|
|
613
|
+
var tickModel = axisModel.getModel('axisTick');
|
|
614
|
+
|
|
615
|
+
if (!tickModel.get('show') || axis.scale.isBlank()) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
var lineStyleModel = tickModel.getModel('lineStyle');
|
|
620
|
+
var tickEndCoord = opt.tickDirection * tickModel.get('length');
|
|
621
|
+
|
|
622
|
+
var ticksCoords = axis.getTicksCoords();
|
|
623
|
+
|
|
624
|
+
var ticksEls = createTicks(ticksCoords, axisBuilder._transform, tickEndCoord, defaults(
|
|
625
|
+
lineStyleModel.getLineStyle(),
|
|
626
|
+
{
|
|
627
|
+
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
628
|
+
}
|
|
629
|
+
), 'ticks');
|
|
630
|
+
|
|
631
|
+
for (var i = 0; i < ticksEls.length; i++) {
|
|
632
|
+
axisBuilder.group.add(ticksEls[i]);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
return ticksEls;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function buildAxisMinorTicks(axisBuilder, axisModel, opt) {
|
|
639
|
+
var axis = axisModel.axis;
|
|
640
|
+
|
|
641
|
+
var minorTickModel = axisModel.getModel('minorTick');
|
|
642
|
+
|
|
643
|
+
if (!minorTickModel.get('show') || axis.scale.isBlank()) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
648
|
+
if (!minorTicksCoords.length) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
var lineStyleModel = minorTickModel.getModel('lineStyle');
|
|
653
|
+
var tickEndCoord = opt.tickDirection * minorTickModel.get('length');
|
|
654
|
+
|
|
655
|
+
var minorTickLineStyle = defaults(
|
|
656
|
+
lineStyleModel.getLineStyle(),
|
|
657
|
+
defaults(
|
|
658
|
+
axisModel.getModel('axisTick').getLineStyle(),
|
|
659
|
+
{
|
|
660
|
+
stroke: axisModel.get('axisLine.lineStyle.color')
|
|
661
|
+
}
|
|
662
|
+
)
|
|
663
|
+
);
|
|
664
|
+
|
|
665
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
666
|
+
var minorTicksEls = createTicks(
|
|
667
|
+
minorTicksCoords[i], axisBuilder._transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i
|
|
668
|
+
);
|
|
669
|
+
for (var k = 0; k < minorTicksEls.length; k++) {
|
|
670
|
+
axisBuilder.group.add(minorTicksEls[k]);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
630
675
|
function buildAxisLabel(axisBuilder, axisModel, opt) {
|
|
631
676
|
var axis = axisModel.axis;
|
|
632
677
|
var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show'));
|
|
@@ -27,17 +27,9 @@ var axisBuilderAttrs = [
|
|
|
27
27
|
'axisLine', 'axisTickLabel', 'axisName'
|
|
28
28
|
];
|
|
29
29
|
var selfBuilderAttrs = [
|
|
30
|
-
'splitArea', 'splitLine'
|
|
30
|
+
'splitArea', 'splitLine', 'minorSplitLine'
|
|
31
31
|
];
|
|
32
32
|
|
|
33
|
-
// function getAlignWithLabel(model, axisModel) {
|
|
34
|
-
// var alignWithLabel = model.get('alignWithLabel');
|
|
35
|
-
// if (alignWithLabel === 'auto') {
|
|
36
|
-
// alignWithLabel = axisModel.get('axisTick.alignWithLabel');
|
|
37
|
-
// }
|
|
38
|
-
// return alignWithLabel;
|
|
39
|
-
// }
|
|
40
|
-
|
|
41
33
|
var CartesianAxisView = AxisView.extend({
|
|
42
34
|
|
|
43
35
|
type: 'cartesianAxis',
|
|
@@ -115,8 +107,6 @@ var CartesianAxisView = AxisView.extend({
|
|
|
115
107
|
var p1 = [];
|
|
116
108
|
var p2 = [];
|
|
117
109
|
|
|
118
|
-
// Simple optimization
|
|
119
|
-
// Batching the lines if color are the same
|
|
120
110
|
var lineStyle = lineStyleModel.getLineStyle();
|
|
121
111
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
122
112
|
var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
|
|
@@ -153,6 +143,63 @@ var CartesianAxisView = AxisView.extend({
|
|
|
153
143
|
}
|
|
154
144
|
},
|
|
155
145
|
|
|
146
|
+
/**
|
|
147
|
+
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
|
|
148
|
+
* @param {module:echarts/coord/cartesian/GridModel} gridModel
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
_minorSplitLine: function (axisModel, gridModel) {
|
|
152
|
+
var axis = axisModel.axis;
|
|
153
|
+
|
|
154
|
+
var minorSplitLineModel = axisModel.getModel('minorSplitLine');
|
|
155
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
156
|
+
|
|
157
|
+
var gridRect = gridModel.coordinateSystem.getRect();
|
|
158
|
+
var isHorizontal = axis.isHorizontal();
|
|
159
|
+
|
|
160
|
+
var minorTicksCoords = axis.getMinorTicksCoords();
|
|
161
|
+
if (!minorTicksCoords.length) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
var p1 = [];
|
|
165
|
+
var p2 = [];
|
|
166
|
+
|
|
167
|
+
var lineStyle = lineStyleModel.getLineStyle();
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
171
|
+
for (var k = 0; k < minorTicksCoords[i].length; k++) {
|
|
172
|
+
var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);
|
|
173
|
+
|
|
174
|
+
if (isHorizontal) {
|
|
175
|
+
p1[0] = tickCoord;
|
|
176
|
+
p1[1] = gridRect.y;
|
|
177
|
+
p2[0] = tickCoord;
|
|
178
|
+
p2[1] = gridRect.y + gridRect.height;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
p1[0] = gridRect.x;
|
|
182
|
+
p1[1] = tickCoord;
|
|
183
|
+
p2[0] = gridRect.x + gridRect.width;
|
|
184
|
+
p2[1] = tickCoord;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
this._axisGroup.add(new graphic.Line({
|
|
188
|
+
anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,
|
|
189
|
+
subPixelOptimize: true,
|
|
190
|
+
shape: {
|
|
191
|
+
x1: p1[0],
|
|
192
|
+
y1: p1[1],
|
|
193
|
+
x2: p2[0],
|
|
194
|
+
y2: p2[1]
|
|
195
|
+
},
|
|
196
|
+
style: lineStyle,
|
|
197
|
+
silent: true
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
|
|
156
203
|
/**
|
|
157
204
|
* @param {module:echarts/coord/cartesian/AxisModel} axisModel
|
|
158
205
|
* @param {module:echarts/coord/cartesian/GridModel} gridModel
|
|
@@ -26,7 +26,7 @@ var axisBuilderAttrs = [
|
|
|
26
26
|
'axisLine', 'axisTickLabel', 'axisName'
|
|
27
27
|
];
|
|
28
28
|
var selfBuilderAttrs = [
|
|
29
|
-
'splitLine', 'splitArea'
|
|
29
|
+
'splitLine', 'splitArea', 'minorSplitLine'
|
|
30
30
|
];
|
|
31
31
|
|
|
32
32
|
export default AxisView.extend({
|
|
@@ -44,6 +44,7 @@ export default AxisView.extend({
|
|
|
44
44
|
var polar = radiusAxis.polar;
|
|
45
45
|
var angleAxis = polar.getAngleAxis();
|
|
46
46
|
var ticksCoords = radiusAxis.getTicksCoords();
|
|
47
|
+
var minorTicksCoords = radiusAxis.getMinorTicksCoords();
|
|
47
48
|
var axisAngle = angleAxis.getExtent()[0];
|
|
48
49
|
var radiusExtent = radiusAxis.getExtent();
|
|
49
50
|
|
|
@@ -54,7 +55,7 @@ export default AxisView.extend({
|
|
|
54
55
|
|
|
55
56
|
zrUtil.each(selfBuilderAttrs, function (name) {
|
|
56
57
|
if (radiusAxisModel.get(name + '.show') && !radiusAxis.scale.isBlank()) {
|
|
57
|
-
this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords);
|
|
58
|
+
this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);
|
|
58
59
|
}
|
|
59
60
|
}, this);
|
|
60
61
|
},
|
|
@@ -80,8 +81,7 @@ export default AxisView.extend({
|
|
|
80
81
|
cx: polar.cx,
|
|
81
82
|
cy: polar.cy,
|
|
82
83
|
r: ticksCoords[i].coord
|
|
83
|
-
}
|
|
84
|
-
silent: true
|
|
84
|
+
}
|
|
85
85
|
}));
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -98,6 +98,39 @@ export default AxisView.extend({
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
_minorSplitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {
|
|
105
|
+
if (!minorTicksCoords.length) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');
|
|
110
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
111
|
+
|
|
112
|
+
var lines = [];
|
|
113
|
+
|
|
114
|
+
for (var i = 0; i < minorTicksCoords.length; i++) {
|
|
115
|
+
for (var k = 0; k < minorTicksCoords[i].length; k++) {
|
|
116
|
+
lines.push(new graphic.Circle({
|
|
117
|
+
shape: {
|
|
118
|
+
cx: polar.cx,
|
|
119
|
+
cy: polar.cy,
|
|
120
|
+
r: minorTicksCoords[i][k].coord
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this.group.add(graphic.mergePath(lines, {
|
|
127
|
+
style: zrUtil.defaults({
|
|
128
|
+
fill: null
|
|
129
|
+
}, lineStyleModel.getLineStyle()),
|
|
130
|
+
silent: true
|
|
131
|
+
}));
|
|
132
|
+
},
|
|
133
|
+
|
|
101
134
|
/**
|
|
102
135
|
* @private
|
|
103
136
|
*/
|
|
@@ -107,6 +107,12 @@ export default echarts.extendComponentView({
|
|
|
107
107
|
areas: zrUtil.clone(areas),
|
|
108
108
|
$from: modelId
|
|
109
109
|
});
|
|
110
|
+
opt.isEnd && this.api.dispatchAction({
|
|
111
|
+
type: 'brushEnd',
|
|
112
|
+
brushId: modelId,
|
|
113
|
+
areas: zrUtil.clone(areas),
|
|
114
|
+
$from: modelId
|
|
115
|
+
});
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
});
|
|
@@ -111,7 +111,21 @@ var DataZoomModel = echarts.extendComponentModel({
|
|
|
111
111
|
this._autoThrottle = true;
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* It is `[rangeModeForMin, rangeModeForMax]`.
|
|
115
|
+
* The optional values for `rangeMode`:
|
|
116
|
+
* + `'value'` mode: the axis extent will always be determined by
|
|
117
|
+
* `dataZoom.startValue` and `dataZoom.endValue`, despite
|
|
118
|
+
* how data like and how `axis.min` and `axis.max` are.
|
|
119
|
+
* + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,
|
|
120
|
+
* where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,
|
|
121
|
+
* and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.
|
|
122
|
+
* Axis extent will be determined by the result of the percent of `[dMin, dMax]`.
|
|
123
|
+
*
|
|
124
|
+
* For example, when users are using dynamic data (update data periodically via `setOption`),
|
|
125
|
+
* if in `'value`' mode, the window will be kept in a fixed value range despite how
|
|
126
|
+
* data are appended, while if in `'percent'` mode, whe window range will be changed alone with
|
|
127
|
+
* the appended data (suppose `axis.min` and `axis.max` are not specified).
|
|
128
|
+
*
|
|
115
129
|
* @private
|
|
116
130
|
*/
|
|
117
131
|
this._rangePropMode = ['percent', 'percent'];
|
|
@@ -450,10 +450,6 @@ var SliderZoomView = DataZoomView.extend({
|
|
|
450
450
|
draggable: true,
|
|
451
451
|
cursor: getCursor(this._orient),
|
|
452
452
|
drift: bind(this._onDragMove, this, 'all'),
|
|
453
|
-
onmousemove: function (e) {
|
|
454
|
-
// Fot mobile devicem, prevent screen slider on the button.
|
|
455
|
-
eventTool.stop(e.event);
|
|
456
|
-
},
|
|
457
453
|
ondragstart: bind(this._showDataInfo, this, true),
|
|
458
454
|
ondragend: bind(this._onDragEnd, this),
|
|
459
455
|
onmouseover: bind(this._showDataInfo, this, true),
|
|
@@ -489,10 +485,6 @@ var SliderZoomView = DataZoomView.extend({
|
|
|
489
485
|
cursor: getCursor(this._orient),
|
|
490
486
|
draggable: true,
|
|
491
487
|
drift: bind(this._onDragMove, this, handleIndex),
|
|
492
|
-
onmousemove: function (e) {
|
|
493
|
-
// Fot mobile devicem, prevent screen slider on the button.
|
|
494
|
-
eventTool.stop(e.event);
|
|
495
|
-
},
|
|
496
488
|
ondragend: bind(this._onDragEnd, this),
|
|
497
489
|
onmouseover: bind(this._showDataInfo, this, true),
|
|
498
490
|
onmouseout: bind(this._showDataInfo, this, false)
|
|
@@ -714,9 +706,12 @@ var SliderZoomView = DataZoomView.extend({
|
|
|
714
706
|
handleLabels[1].attr('invisible', !showOrHide);
|
|
715
707
|
},
|
|
716
708
|
|
|
717
|
-
_onDragMove: function (handleIndex, dx, dy) {
|
|
709
|
+
_onDragMove: function (handleIndex, dx, dy, event) {
|
|
718
710
|
this._dragging = true;
|
|
719
711
|
|
|
712
|
+
// For mobile device, prevent screen slider on the button.
|
|
713
|
+
eventTool.stop(event.event);
|
|
714
|
+
|
|
720
715
|
// Transform dx, dy to bar coordination.
|
|
721
716
|
var barTransform = this._displayables.barGroup.getLocalTransform();
|
|
722
717
|
var vertex = graphic.applyTransform([dx, dy], barTransform, true);
|
|
@@ -180,7 +180,8 @@ function BrushController(zr) {
|
|
|
180
180
|
* @type {Object}
|
|
181
181
|
*/
|
|
182
182
|
this._handlers = {};
|
|
183
|
-
|
|
183
|
+
|
|
184
|
+
each(pointerHandlers, function (handler, eventName) {
|
|
184
185
|
this._handlers[eventName] = zrUtil.bind(handler, this);
|
|
185
186
|
}, this);
|
|
186
187
|
}
|
|
@@ -376,9 +377,7 @@ function doEnableBrush(controller, brushOption) {
|
|
|
376
377
|
interactionMutex.take(zr, MUTEX_RESOURCE_KEY, controller._uid);
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
|
|
380
|
-
zr.on(eventName, handler);
|
|
381
|
-
});
|
|
380
|
+
mountHandlers(zr, controller._handlers);
|
|
382
381
|
|
|
383
382
|
controller._brushType = brushOption.brushType;
|
|
384
383
|
controller._brushOption = zrUtil.merge(zrUtil.clone(DEFAULT_BRUSH_OPT), brushOption, true);
|
|
@@ -389,13 +388,23 @@ function doDisableBrush(controller) {
|
|
|
389
388
|
|
|
390
389
|
interactionMutex.release(zr, MUTEX_RESOURCE_KEY, controller._uid);
|
|
391
390
|
|
|
392
|
-
|
|
393
|
-
zr.off(eventName, handler);
|
|
394
|
-
});
|
|
391
|
+
unmountHandlers(zr, controller._handlers);
|
|
395
392
|
|
|
396
393
|
controller._brushType = controller._brushOption = null;
|
|
397
394
|
}
|
|
398
395
|
|
|
396
|
+
function mountHandlers(zr, handlers) {
|
|
397
|
+
each(handlers, function (handler, eventName) {
|
|
398
|
+
zr.on(eventName, handler);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function unmountHandlers(zr, handlers) {
|
|
403
|
+
each(handlers, function (handler, eventName) {
|
|
404
|
+
zr.off(eventName, handler);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
|
|
399
408
|
function createCover(controller, brushOption) {
|
|
400
409
|
var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);
|
|
401
410
|
cover.__brushOption = brushOption;
|
|
@@ -709,8 +718,14 @@ function pointsToRect(points) {
|
|
|
709
718
|
}
|
|
710
719
|
|
|
711
720
|
function resetCursor(controller, e, localCursorPoint) {
|
|
712
|
-
|
|
713
|
-
|
|
721
|
+
if (
|
|
722
|
+
// Check active
|
|
723
|
+
!controller._brushType
|
|
724
|
+
// resetCursor should be always called when mouse is in zr area,
|
|
725
|
+
// but not called when mouse is out of zr area to avoid bad influence
|
|
726
|
+
// if `mousemove`, `mouseup` are triggered from `document` event.
|
|
727
|
+
|| isOutsideZrArea(controller, e)
|
|
728
|
+
) {
|
|
714
729
|
return;
|
|
715
730
|
}
|
|
716
731
|
|
|
@@ -814,13 +829,13 @@ function determineBrushType(brushType, panel) {
|
|
|
814
829
|
return brushType;
|
|
815
830
|
}
|
|
816
831
|
|
|
817
|
-
var
|
|
832
|
+
var pointerHandlers = {
|
|
818
833
|
|
|
819
834
|
mousedown: function (e) {
|
|
820
835
|
if (this._dragging) {
|
|
821
836
|
// In case some browser do not support globalOut,
|
|
822
837
|
// and release mose out side the browser.
|
|
823
|
-
handleDragEnd
|
|
838
|
+
handleDragEnd(this, e);
|
|
824
839
|
}
|
|
825
840
|
else if (!e.target || !e.target.draggable) {
|
|
826
841
|
|
|
@@ -839,44 +854,51 @@ var mouseHandlers = {
|
|
|
839
854
|
},
|
|
840
855
|
|
|
841
856
|
mousemove: function (e) {
|
|
842
|
-
var
|
|
857
|
+
var x = e.offsetX;
|
|
858
|
+
var y = e.offsetY;
|
|
859
|
+
|
|
860
|
+
var localCursorPoint = this.group.transformCoordToLocal(x, y);
|
|
843
861
|
|
|
844
862
|
resetCursor(this, e, localCursorPoint);
|
|
845
863
|
|
|
846
864
|
if (this._dragging) {
|
|
847
|
-
|
|
848
865
|
preventDefault(e);
|
|
849
|
-
|
|
850
866
|
var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);
|
|
851
|
-
|
|
852
867
|
eventParams && trigger(this, eventParams);
|
|
853
868
|
}
|
|
854
869
|
},
|
|
855
870
|
|
|
856
|
-
mouseup:
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
// in tooltip, globalout should not be triggered.
|
|
860
|
-
// globalout: handleDragEnd
|
|
871
|
+
mouseup: function (e) {
|
|
872
|
+
handleDragEnd(this, e);
|
|
873
|
+
}
|
|
861
874
|
};
|
|
862
875
|
|
|
863
|
-
function handleDragEnd(e) {
|
|
864
|
-
if (this._dragging) {
|
|
865
876
|
|
|
877
|
+
function handleDragEnd(controller, e) {
|
|
878
|
+
if (controller._dragging) {
|
|
866
879
|
preventDefault(e);
|
|
867
880
|
|
|
868
|
-
var
|
|
869
|
-
var
|
|
881
|
+
var x = e.offsetX;
|
|
882
|
+
var y = e.offsetY;
|
|
883
|
+
|
|
884
|
+
var localCursorPoint = controller.group.transformCoordToLocal(x, y);
|
|
885
|
+
var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);
|
|
870
886
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
887
|
+
controller._dragging = false;
|
|
888
|
+
controller._track = [];
|
|
889
|
+
controller._creatingCover = null;
|
|
874
890
|
|
|
875
891
|
// trigger event shoule be at final, after procedure will be nested.
|
|
876
|
-
eventParams && trigger(
|
|
892
|
+
eventParams && trigger(controller, eventParams);
|
|
877
893
|
}
|
|
878
894
|
}
|
|
879
895
|
|
|
896
|
+
function isOutsideZrArea(controller, x, y) {
|
|
897
|
+
var zr = controller._zr;
|
|
898
|
+
return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
|
|
880
902
|
/**
|
|
881
903
|
* key: brushType
|
|
882
904
|
* @type {Object}
|
|
@@ -111,9 +111,9 @@ var LegendModel = echarts.extendComponentModel({
|
|
|
111
111
|
availableNames.push(seriesName);
|
|
112
112
|
var isPotential;
|
|
113
113
|
|
|
114
|
-
if (seriesModel.
|
|
115
|
-
var
|
|
116
|
-
var names =
|
|
114
|
+
if (seriesModel.legendVisualProvider) {
|
|
115
|
+
var provider = seriesModel.legendVisualProvider;
|
|
116
|
+
var names = provider.getAllNames();
|
|
117
117
|
|
|
118
118
|
if (!ecModel.isSeriesFiltered(seriesModel)) {
|
|
119
119
|
availableNames = availableNames.concat(names);
|
|
@@ -175,7 +175,7 @@ export default echarts.extendComponentView({
|
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
//
|
|
178
|
+
// Legend to control series.
|
|
179
179
|
if (seriesModel) {
|
|
180
180
|
var data = seriesModel.getData();
|
|
181
181
|
var color = data.getVisual('color');
|
|
@@ -204,29 +204,31 @@ export default echarts.extendComponentView({
|
|
|
204
204
|
selectMode
|
|
205
205
|
);
|
|
206
206
|
|
|
207
|
-
itemGroup.on('click', curry(dispatchSelectAction, name, api))
|
|
207
|
+
itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId))
|
|
208
208
|
.on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId))
|
|
209
209
|
.on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));
|
|
210
210
|
|
|
211
211
|
legendDrawnMap.set(name, true);
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
|
-
//
|
|
214
|
+
// Legend to control data. In pie and funnel.
|
|
215
215
|
ecModel.eachRawSeries(function (seriesModel) {
|
|
216
|
+
|
|
216
217
|
// In case multiple series has same data name
|
|
217
218
|
if (legendDrawnMap.get(name)) {
|
|
218
219
|
return;
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
if (seriesModel.
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
if (idx < 0) {
|
|
222
|
+
if (seriesModel.legendVisualProvider) {
|
|
223
|
+
var provider = seriesModel.legendVisualProvider;
|
|
224
|
+
if (!provider.containName(name)) {
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
var
|
|
229
|
-
|
|
228
|
+
var idx = provider.indexOfName(name);
|
|
229
|
+
|
|
230
|
+
var color = provider.getItemVisual(idx, 'color');
|
|
231
|
+
var borderColor = provider.getItemVisual(idx, 'borderColor');
|
|
230
232
|
|
|
231
233
|
var legendSymbolType = 'roundRect';
|
|
232
234
|
|
|
@@ -238,7 +240,7 @@ export default echarts.extendComponentView({
|
|
|
238
240
|
);
|
|
239
241
|
|
|
240
242
|
// FIXME: consider different series has items with the same name.
|
|
241
|
-
itemGroup.on('click', curry(dispatchSelectAction, name, api))
|
|
243
|
+
itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId))
|
|
242
244
|
// Should not specify the series name, consider legend controls
|
|
243
245
|
// more than one pie series.
|
|
244
246
|
.on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId))
|
|
@@ -518,11 +520,15 @@ function setSymbolStyle(symbol, symbolType, legendModelItemStyle, borderColor, i
|
|
|
518
520
|
return symbol.setStyle(itemStyle);
|
|
519
521
|
}
|
|
520
522
|
|
|
521
|
-
function dispatchSelectAction(
|
|
523
|
+
function dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {
|
|
524
|
+
// downplay before unselect
|
|
525
|
+
dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);
|
|
522
526
|
api.dispatchAction({
|
|
523
527
|
type: 'legendToggleSelect',
|
|
524
|
-
name:
|
|
528
|
+
name: seriesName != null ? seriesName : dataName
|
|
525
529
|
});
|
|
530
|
+
// highlight after select
|
|
531
|
+
dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);
|
|
526
532
|
}
|
|
527
533
|
|
|
528
534
|
function dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {
|