echarts 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -18
- package/README.md +10 -0
- package/dist/echarts.common.js +11010 -9830
- package/dist/echarts.common.min.js +13 -13
- package/dist/echarts.js +13291 -10852
- package/dist/echarts.min.js +22 -21
- package/dist/echarts.simple.js +9904 -8990
- package/dist/echarts.simple.min.js +9 -10
- package/index.js +1 -0
- package/lib/ExtensionAPI.js +2 -4
- package/lib/chart/bar/BarView.js +141 -49
- package/lib/chart/bar/BaseBarSeries.js +2 -6
- package/lib/chart/bar.js +1 -0
- package/lib/chart/boxplot/BoxplotSeries.js +1 -1
- package/lib/chart/boxplot/boxplotLayout.js +23 -7
- package/lib/chart/candlestick/CandlestickSeries.js +3 -22
- package/lib/chart/candlestick/candlestickLayout.js +23 -7
- package/lib/chart/custom.js +442 -0
- package/lib/chart/funnel/funnelLayout.js +10 -3
- package/lib/chart/gauge/GaugeView.js +1 -1
- package/lib/chart/graph/GraphView.js +15 -9
- package/lib/chart/graph/categoryVisual.js +3 -2
- package/lib/chart/heatmap/HeatmapLayer.js +1 -1
- package/lib/chart/heatmap/HeatmapView.js +75 -73
- package/lib/chart/helper/Symbol.js +8 -31
- package/lib/chart/helper/createListFromArray.js +15 -10
- package/lib/chart/helper/labelHelper.js +48 -0
- package/lib/chart/helper/whiskerBoxCommon.js +25 -44
- package/lib/chart/map/mapDataStatistic.js +9 -8
- package/lib/chart/parallel/ParallelSeries.js +2 -0
- package/lib/chart/parallel/ParallelView.js +13 -12
- package/lib/chart/parallel/parallelVisual.js +9 -1
- package/lib/chart/pie/pieLayout.js +25 -17
- package/lib/chart/radar/RadarSeries.js +1 -1
- package/lib/chart/sankey/sankeyLayout.js +1 -1
- package/lib/chart/scatter/ScatterSeries.js +2 -3
- package/lib/chart/themeRiver/ThemeRiverSeries.js +6 -5
- package/lib/chart/themeRiver/themeRiverVisual.js +1 -1
- package/lib/chart/treemap/TreemapSeries.js +3 -3
- package/lib/chart/treemap/TreemapView.js +1 -1
- package/lib/chart/treemap/treemapLayout.js +6 -1
- package/lib/component/axis/AxisBuilder.js +53 -34
- package/lib/component/axis/ParallelAxisView.js +45 -37
- package/lib/component/axisPointer/AxisPointerModel.js +1 -1
- package/lib/component/axisPointer/BaseAxisPointer.js +20 -15
- package/lib/component/axisPointer/CartesianAxisPointer.js +9 -6
- package/lib/component/axisPointer/PolarAxisPointer.js +10 -8
- package/lib/component/axisPointer/SingleAxisPointer.js +11 -7
- package/lib/component/axisPointer/axisTrigger.js +87 -72
- package/lib/component/axisPointer/viewHelper.js +6 -3
- package/lib/component/axisPointer.js +2 -2
- package/lib/component/brush/BrushModel.js +6 -4
- package/lib/component/brush/BrushView.js +1 -1
- package/lib/component/brush/visualEncoding.js +6 -4
- package/lib/component/calendar/CalendarView.js +5 -5
- package/lib/component/dataZoom/AxisProxy.js +76 -13
- package/lib/component/dataZoom/DataZoomModel.js +21 -5
- package/lib/component/dataZoom/InsideZoomModel.js +4 -1
- package/lib/component/dataZoom/InsideZoomView.js +17 -27
- package/lib/component/dataZoom/SliderZoomView.js +63 -26
- package/lib/component/dataZoom/roams.js +9 -4
- package/lib/component/graphic.js +13 -12
- package/lib/component/helper/BrushController.js +75 -114
- package/lib/component/helper/BrushTargetManager.js +16 -8
- package/lib/component/helper/MapDraw.js +25 -11
- package/lib/component/helper/RoamController.js +111 -139
- package/lib/component/helper/brushHelper.js +25 -213
- package/lib/component/helper/cursorHelper.js +21 -0
- package/lib/component/helper/roamHelper.js +54 -0
- package/lib/component/helper/selectableMixin.js +7 -7
- package/lib/component/helper/sliderMove.js +66 -37
- package/lib/component/legend/LegendView.js +6 -6
- package/lib/component/legend/legendAction.js +1 -1
- package/lib/component/marker/MarkAreaView.js +3 -6
- package/lib/component/marker/MarkLineView.js +3 -5
- package/lib/component/marker/MarkPointView.js +3 -5
- package/lib/component/marker/MarkerView.js +10 -12
- package/lib/component/marker/markerHelper.js +1 -1
- package/lib/component/parallel.js +94 -29
- package/lib/component/polar.js +5 -0
- package/lib/component/timeline/SliderTimelineView.js +1 -1
- package/lib/component/toolbox/feature/Brush.js +7 -0
- package/lib/component/toolbox/feature/DataZoom.js +17 -4
- package/lib/component/tooltip/TooltipView.js +92 -20
- package/lib/component/visualMap/ContinuousView.js +6 -4
- package/lib/coord/Axis.js +34 -2
- package/lib/coord/axisDefault.js +4 -1
- package/lib/coord/axisHelper.js +32 -26
- package/lib/coord/axisModelCommonMixin.js +1 -1
- package/lib/coord/calendar/Calendar.js +14 -17
- package/lib/coord/calendar/prepareCustom.js +31 -0
- package/lib/coord/cartesian/Axis2D.js +0 -12
- package/lib/coord/cartesian/Cartesian2D.js +1 -0
- package/lib/coord/cartesian/Grid.js +5 -2
- package/lib/coord/cartesian/prepareCustom.js +36 -0
- package/lib/coord/geo/Geo.js +9 -14
- package/lib/coord/geo/GeoModel.js +5 -5
- package/lib/coord/geo/geoCreator.js +3 -3
- package/lib/coord/geo/parseGeoJson.js +11 -4
- package/lib/coord/geo/prepareCustom.js +36 -0
- package/lib/coord/parallel/Parallel.js +225 -101
- package/lib/coord/parallel/ParallelModel.js +7 -1
- package/lib/coord/polar/Polar.js +2 -1
- package/lib/coord/polar/prepareCustom.js +53 -0
- package/lib/coord/single/Single.js +9 -8
- package/lib/coord/single/SingleAxis.js +0 -27
- package/lib/coord/single/prepareCustom.js +33 -0
- package/lib/data/DataDiffer.js +2 -1
- package/lib/data/Graph.js +11 -7
- package/lib/data/List.js +59 -20
- package/lib/data/helper/completeDimensions.js +184 -23
- package/lib/echarts.js +68 -36
- package/lib/helper.js +1 -8
- package/lib/layout/barGrid.js +91 -19
- package/lib/layout/barPolar.js +286 -0
- package/lib/layout/points.js +22 -16
- package/lib/model/Global.js +34 -31
- package/lib/model/Series.js +41 -29
- package/lib/model/globalDefault.js +4 -1
- package/lib/model/mixin/colorPalette.js +2 -1
- package/lib/model/mixin/textStyle.js +7 -13
- package/lib/scale/Interval.js +46 -76
- package/lib/scale/Log.js +5 -7
- package/lib/scale/Scale.js +10 -1
- package/lib/scale/Time.js +34 -12
- package/lib/scale/helper.js +93 -0
- package/lib/util/format.js +20 -9
- package/lib/util/graphic.js +70 -8
- package/lib/util/layout.js +7 -3
- package/lib/util/model.js +63 -7
- package/lib/util/number.js +59 -19
- package/lib/util/throttle.js +14 -3
- package/map/js/world.js +1 -1
- package/map/json/world.json +1 -1
- package/package.json +3 -3
- package/src/ExtensionAPI.js +2 -4
- package/src/chart/bar/BarView.js +141 -49
- package/src/chart/bar/BaseBarSeries.js +2 -6
- package/src/chart/bar.js +1 -0
- package/src/chart/boxplot/BoxplotSeries.js +1 -1
- package/src/chart/boxplot/boxplotLayout.js +23 -7
- package/src/chart/candlestick/CandlestickSeries.js +3 -22
- package/src/chart/candlestick/candlestickLayout.js +23 -7
- package/src/chart/custom.js +442 -0
- package/src/chart/funnel/funnelLayout.js +10 -4
- package/src/chart/gauge/GaugeView.js +1 -1
- package/src/chart/graph/GraphView.js +15 -9
- package/src/chart/graph/categoryVisual.js +3 -2
- package/src/chart/heatmap/HeatmapLayer.js +1 -1
- package/src/chart/heatmap/HeatmapView.js +75 -73
- package/src/chart/helper/Symbol.js +8 -31
- package/src/chart/helper/createListFromArray.js +15 -10
- package/src/chart/helper/labelHelper.js +49 -0
- package/src/chart/helper/whiskerBoxCommon.js +25 -44
- package/src/chart/map/mapDataStatistic.js +9 -8
- package/src/chart/parallel/ParallelSeries.js +2 -0
- package/src/chart/parallel/ParallelView.js +13 -12
- package/src/chart/parallel/parallelVisual.js +9 -1
- package/src/chart/pie/pieLayout.js +25 -17
- package/src/chart/radar/RadarSeries.js +1 -1
- package/src/chart/sankey/sankeyLayout.js +1 -1
- package/src/chart/scatter/ScatterSeries.js +2 -3
- package/src/chart/themeRiver/ThemeRiverSeries.js +6 -5
- package/src/chart/themeRiver/themeRiverVisual.js +1 -1
- package/src/chart/treemap/TreemapSeries.js +3 -3
- package/src/chart/treemap/TreemapView.js +1 -1
- package/src/chart/treemap/treemapLayout.js +6 -1
- package/src/component/axis/AxisBuilder.js +53 -34
- package/src/component/axis/ParallelAxisView.js +45 -37
- package/src/component/axisPointer/AxisPointerModel.js +1 -1
- package/src/component/axisPointer/BaseAxisPointer.js +20 -15
- package/src/component/axisPointer/CartesianAxisPointer.js +9 -6
- package/src/component/axisPointer/PolarAxisPointer.js +10 -8
- package/src/component/axisPointer/SingleAxisPointer.js +11 -7
- package/src/component/axisPointer/axisTrigger.js +87 -72
- package/src/component/axisPointer/viewHelper.js +6 -3
- package/src/component/axisPointer.js +2 -2
- package/src/component/brush/BrushModel.js +6 -4
- package/src/component/brush/BrushView.js +1 -1
- package/src/component/brush/visualEncoding.js +6 -4
- package/src/component/calendar/CalendarView.js +5 -5
- package/src/component/dataZoom/AxisProxy.js +76 -13
- package/src/component/dataZoom/DataZoomModel.js +21 -5
- package/src/component/dataZoom/InsideZoomModel.js +4 -1
- package/src/component/dataZoom/InsideZoomView.js +17 -27
- package/src/component/dataZoom/SliderZoomView.js +63 -26
- package/src/component/dataZoom/roams.js +9 -4
- package/src/component/graphic.js +13 -12
- package/src/component/helper/BrushController.js +75 -114
- package/src/component/helper/BrushTargetManager.js +16 -8
- package/src/component/helper/MapDraw.js +25 -11
- package/src/component/helper/RoamController.js +111 -139
- package/src/component/helper/brushHelper.js +41 -0
- package/src/component/helper/cursorHelper.js +22 -0
- package/src/component/helper/roamHelper.js +55 -0
- package/src/component/helper/selectableMixin.js +7 -7
- package/src/component/helper/sliderMove.js +66 -37
- package/src/component/legend/LegendView.js +6 -6
- package/src/component/legend/legendAction.js +1 -1
- package/src/component/marker/MarkAreaView.js +3 -6
- package/src/component/marker/MarkLineView.js +3 -5
- package/src/component/marker/MarkPointView.js +3 -5
- package/src/component/marker/MarkerView.js +10 -12
- package/src/component/marker/markerHelper.js +1 -1
- package/src/component/parallel.js +94 -29
- package/src/component/polar.js +5 -0
- package/src/component/timeline/SliderTimelineView.js +1 -1
- package/src/component/toolbox/feature/Brush.js +7 -0
- package/src/component/toolbox/feature/DataZoom.js +17 -4
- package/src/component/tooltip/TooltipView.js +92 -20
- package/src/component/visualMap/ContinuousView.js +6 -4
- package/src/coord/Axis.js +34 -2
- package/src/coord/axisDefault.js +4 -1
- package/src/coord/axisHelper.js +32 -26
- package/src/coord/axisModelCommonMixin.js +1 -1
- package/src/coord/calendar/Calendar.js +14 -17
- package/src/coord/calendar/prepareCustom.js +32 -0
- package/src/coord/cartesian/Axis2D.js +0 -12
- package/src/coord/cartesian/Cartesian2D.js +1 -0
- package/src/coord/cartesian/Grid.js +5 -2
- package/src/coord/cartesian/prepareCustom.js +37 -0
- package/src/coord/geo/Geo.js +9 -14
- package/src/coord/geo/GeoModel.js +5 -5
- package/src/coord/geo/geoCreator.js +3 -3
- package/src/coord/geo/parseGeoJson.js +11 -4
- package/src/coord/geo/prepareCustom.js +37 -0
- package/src/coord/parallel/Parallel.js +225 -101
- package/src/coord/parallel/ParallelModel.js +7 -1
- package/src/coord/polar/Polar.js +2 -1
- package/src/coord/polar/prepareCustom.js +54 -0
- package/src/coord/single/Single.js +9 -8
- package/src/coord/single/SingleAxis.js +0 -27
- package/src/coord/single/prepareCustom.js +34 -0
- package/src/data/DataDiffer.js +2 -1
- package/src/data/Graph.js +11 -7
- package/src/data/List.js +59 -20
- package/src/data/helper/completeDimensions.js +184 -23
- package/src/echarts.js +68 -36
- package/src/helper.js +1 -8
- package/src/layout/barGrid.js +91 -19
- package/src/layout/barPolar.js +287 -0
- package/src/layout/points.js +22 -16
- package/src/model/Global.js +34 -31
- package/src/model/Series.js +41 -29
- package/src/model/globalDefault.js +4 -1
- package/src/model/mixin/colorPalette.js +2 -1
- package/src/model/mixin/textStyle.js +7 -13
- package/src/scale/Interval.js +46 -76
- package/src/scale/Log.js +5 -7
- package/src/scale/Scale.js +10 -1
- package/src/scale/Time.js +34 -12
- package/src/scale/helper.js +94 -0
- package/src/util/format.js +20 -9
- package/src/util/graphic.js +70 -8
- package/src/util/layout.js +7 -3
- package/src/util/model.js +63 -7
- package/src/util/number.js +59 -19
- package/src/util/throttle.js +14 -3
- package/src/coord/cartesian/axisLabelInterval.js +0 -26
- package/theme/default.js +0 -23
- package/theme/halloween.js +0 -528
|
@@ -14,25 +14,29 @@
|
|
|
14
14
|
* then hide/downplay them.
|
|
15
15
|
*
|
|
16
16
|
* @param {Object} coordSysAxesInfo
|
|
17
|
-
* @param {string} currTrigger 'click' | 'mousemove' | 'leave'
|
|
18
|
-
* @param {
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* @param {string} [currTrigger] 'click' | 'mousemove' | 'leave'
|
|
18
|
+
* @param {Array.<number>} [point] x and y, which are mandatory, specify a point to
|
|
19
|
+
* tigger axisPointer and tooltip.
|
|
20
|
+
* @param {Object} [finder] {
|
|
21
|
+
* seriesIndex, dataIndex,
|
|
22
|
+
* axesInfo: [{
|
|
23
|
+
* axisDim: 'x'|'y'|'angle'|..., axisIndex: ..., value: ...
|
|
24
|
+
* }, ...]
|
|
25
|
+
* }
|
|
26
|
+
* These properties, which are optional, restrict target axes.
|
|
21
27
|
* @param {Function} dispatchAction
|
|
22
28
|
* @param {module:echarts/ExtensionAPI} api
|
|
23
|
-
* @param {Object} tooltipOption
|
|
24
|
-
* @param {string} [highDownKey]
|
|
29
|
+
* @param {Object} [tooltipOption]
|
|
25
30
|
* @return {Object} content of event obj for echarts.connect.
|
|
26
31
|
*/
|
|
27
32
|
function axisTrigger(
|
|
28
|
-
coordSysAxesInfo, currTrigger, finder, dispatchAction,
|
|
29
|
-
ecModel, api, tooltipOption
|
|
33
|
+
coordSysAxesInfo, currTrigger, point, finder, dispatchAction,
|
|
34
|
+
ecModel, api, tooltipOption
|
|
30
35
|
) {
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
else {
|
|
36
|
+
finder = finder || {};
|
|
37
|
+
if (illegalPoint(point)) {
|
|
38
|
+
// Used in the default behavior of `connection`: use the sample seriesIndex
|
|
39
|
+
// and dataIndex. And also used in the tooltipView trigger.
|
|
36
40
|
point = findPointFromSeries({
|
|
37
41
|
seriesIndex: finder.seriesIndex,
|
|
38
42
|
// Do not use dataIndexInside from other ec instance.
|
|
@@ -40,6 +44,13 @@
|
|
|
40
44
|
dataIndex: finder.dataIndex
|
|
41
45
|
}, ecModel).point;
|
|
42
46
|
}
|
|
47
|
+
var isIllegalPoint = illegalPoint(point);
|
|
48
|
+
|
|
49
|
+
// Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).
|
|
50
|
+
// Notice: In this case, it is difficult to get the `point` (which is necessary to show
|
|
51
|
+
// tooltip, so if point is not given, we just use the point found by sample seriesIndex
|
|
52
|
+
// and dataIndex.
|
|
53
|
+
var inputAxesInfo = finder.axesInfo;
|
|
43
54
|
|
|
44
55
|
var axesInfo = coordSysAxesInfo.axesInfo;
|
|
45
56
|
var shouldHide = currTrigger === 'leave' || illegalPoint(point);
|
|
@@ -47,46 +58,57 @@
|
|
|
47
58
|
|
|
48
59
|
var showValueMap = {};
|
|
49
60
|
var dataByCoordSys = {list: [], map: {}};
|
|
50
|
-
var highlightBatch = [];
|
|
51
61
|
var updaters = {
|
|
52
62
|
showPointer: curry(showPointer, showValueMap),
|
|
53
|
-
showTooltip: curry(showTooltip, dataByCoordSys)
|
|
54
|
-
highlight: curry(highlight, highlightBatch)
|
|
63
|
+
showTooltip: curry(showTooltip, dataByCoordSys)
|
|
55
64
|
};
|
|
56
65
|
|
|
57
66
|
// Process for triggered axes.
|
|
58
67
|
each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {
|
|
59
|
-
|
|
68
|
+
// If a point given, it must be contained by the coordinate system.
|
|
69
|
+
var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);
|
|
60
70
|
|
|
61
71
|
each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {
|
|
62
72
|
var axis = axisInfo.axis;
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);
|
|
74
|
+
// If no inputAxesInfo, no axis is restricted.
|
|
75
|
+
if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {
|
|
76
|
+
var val = inputAxisInfo && inputAxisInfo.value;
|
|
77
|
+
if (val == null && !isIllegalPoint) {
|
|
78
|
+
val = axis.pointToData(point);
|
|
79
|
+
}
|
|
80
|
+
val != null && processOnAxis(axisInfo, val, updaters, false, outputFinder);
|
|
65
81
|
}
|
|
66
82
|
});
|
|
67
83
|
});
|
|
68
84
|
|
|
69
85
|
// Process for linked axes.
|
|
86
|
+
var linkTriggers = {};
|
|
70
87
|
each(axesInfo, function (tarAxisInfo, tarKey) {
|
|
71
88
|
var linkGroup = tarAxisInfo.linkGroup;
|
|
72
89
|
|
|
73
90
|
// If axis has been triggered in the previous stage, it should not be triggered by link.
|
|
74
|
-
linkGroup && !showValueMap[tarKey]
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
if (linkGroup && !showValueMap[tarKey]) {
|
|
92
|
+
each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {
|
|
93
|
+
var srcValItem = showValueMap[srcKey];
|
|
94
|
+
// If srcValItem exist, source axis is triggered, so link to target axis.
|
|
95
|
+
if (srcAxisInfo !== tarAxisInfo && srcValItem) {
|
|
96
|
+
var val = srcValItem.value;
|
|
97
|
+
linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(
|
|
98
|
+
val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)
|
|
99
|
+
)));
|
|
100
|
+
linkTriggers[tarAxisInfo.key] = val;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
each(linkTriggers, function (val, tarKey) {
|
|
106
|
+
processOnAxis(axesInfo[tarKey], val, updaters, true, outputFinder);
|
|
85
107
|
});
|
|
86
108
|
|
|
87
|
-
updateModelActually(showValueMap, axesInfo);
|
|
109
|
+
updateModelActually(showValueMap, axesInfo, outputFinder);
|
|
88
110
|
dispatchTooltipActually(dataByCoordSys, point, tooltipOption, dispatchAction);
|
|
89
|
-
dispatchHighDownActually(
|
|
111
|
+
dispatchHighDownActually(axesInfo, dispatchAction, api);
|
|
90
112
|
|
|
91
113
|
return outputFinder;
|
|
92
114
|
}
|
|
@@ -122,8 +144,7 @@
|
|
|
122
144
|
}
|
|
123
145
|
}
|
|
124
146
|
|
|
125
|
-
updaters.
|
|
126
|
-
updaters.showPointer(axisInfo, newValue, payloadBatch);
|
|
147
|
+
updaters.showPointer(axisInfo, newValue, payloadBatch, outputFinder);
|
|
127
148
|
// Tooltip should always be snapToValue, otherwise there will be
|
|
128
149
|
// incorrect "axis value ~ series value" mapping displayed in tooltip.
|
|
129
150
|
updaters.showTooltip(axisInfo, payloadInfo, snapToValue);
|
|
@@ -148,7 +169,7 @@
|
|
|
148
169
|
seriesNestestValue = result.nestestValue;
|
|
149
170
|
}
|
|
150
171
|
else {
|
|
151
|
-
dataIndices = series.getData().
|
|
172
|
+
dataIndices = series.getData().indicesOfNearest(
|
|
152
173
|
dataDim[0],
|
|
153
174
|
value,
|
|
154
175
|
// Add a threshold to avoid find the wrong dataIndex
|
|
@@ -239,11 +260,8 @@
|
|
|
239
260
|
});
|
|
240
261
|
}
|
|
241
262
|
|
|
242
|
-
function
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function updateModelActually(showValueMap, axesInfo) {
|
|
263
|
+
function updateModelActually(showValueMap, axesInfo, outputFinder) {
|
|
264
|
+
var outputAxesInfo = outputFinder.axesInfo = [];
|
|
247
265
|
// Basic logic: If no 'show' required, 'hide' this axisPointer.
|
|
248
266
|
each(axesInfo, function (axisInfo, key) {
|
|
249
267
|
var option = axisInfo.axisPointerModel.option;
|
|
@@ -252,7 +270,7 @@
|
|
|
252
270
|
if (valItem) {
|
|
253
271
|
!axisInfo.useHandle && (option.status = 'show');
|
|
254
272
|
option.value = valItem.value;
|
|
255
|
-
// For label formatter param.
|
|
273
|
+
// For label formatter param and highlight.
|
|
256
274
|
option.seriesDataIndices = (valItem.payloadBatch || []).slice();
|
|
257
275
|
}
|
|
258
276
|
// When always show (e.g., handle used), remain
|
|
@@ -262,6 +280,13 @@
|
|
|
262
280
|
// click legend to toggle axis blank.
|
|
263
281
|
!axisInfo.useHandle && (option.status = 'hide');
|
|
264
282
|
}
|
|
283
|
+
|
|
284
|
+
// If status is 'hide', should be no info in payload.
|
|
285
|
+
option.status === 'show' && outputAxesInfo.push({
|
|
286
|
+
axisDim: axisInfo.axis.dim,
|
|
287
|
+
axisIndex: axisInfo.axis.model.componentIndex,
|
|
288
|
+
value: option.value
|
|
289
|
+
});
|
|
265
290
|
});
|
|
266
291
|
}
|
|
267
292
|
|
|
@@ -291,28 +316,24 @@
|
|
|
291
316
|
});
|
|
292
317
|
}
|
|
293
318
|
|
|
294
|
-
function dispatchHighDownActually(
|
|
295
|
-
// Basic logic: If nothing highlighted, should downplay all highlighted items.
|
|
296
|
-
// This case will occur when mouse leave coordSys.
|
|
297
|
-
|
|
319
|
+
function dispatchHighDownActually(axesInfo, dispatchAction, api) {
|
|
298
320
|
// FIXME
|
|
299
|
-
//
|
|
300
|
-
// (
|
|
301
|
-
|
|
302
|
-
// It will not be fixed until someone requires this scenario.
|
|
303
|
-
|
|
304
|
-
// Consider items area hightlighted by 'handle', and globalListener may
|
|
305
|
-
// downplay all items (including just highlighted ones) when mousemove.
|
|
306
|
-
// So we use a highDownKey to separate them as a temporary solution.
|
|
321
|
+
// highlight status modification shoule be a stage of main process?
|
|
322
|
+
// (Consider confilct (e.g., legend and axisPointer) and setOption)
|
|
323
|
+
|
|
307
324
|
var zr = api.getZr();
|
|
308
|
-
highDownKey = '
|
|
325
|
+
var highDownKey = 'axisPointerLastHighlights';
|
|
309
326
|
var lastHighlights = get(zr)[highDownKey] || {};
|
|
310
327
|
var newHighlights = get(zr)[highDownKey] = {};
|
|
311
328
|
|
|
329
|
+
// Update highlight/downplay status according to axisPointer model.
|
|
312
330
|
// Build hash map and remove duplicate incidentally.
|
|
313
|
-
|
|
314
|
-
var
|
|
315
|
-
|
|
331
|
+
each(axesInfo, function (axisInfo, key) {
|
|
332
|
+
var option = axisInfo.axisPointerModel.option;
|
|
333
|
+
option.status === 'show' && each(option.seriesDataIndices, function (batchItem) {
|
|
334
|
+
var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;
|
|
335
|
+
newHighlights[key] = batchItem;
|
|
336
|
+
});
|
|
316
337
|
});
|
|
317
338
|
|
|
318
339
|
// Diff.
|
|
@@ -333,21 +354,15 @@
|
|
|
333
354
|
});
|
|
334
355
|
}
|
|
335
356
|
|
|
336
|
-
function
|
|
337
|
-
var
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
!isTarget && each(
|
|
344
|
-
[['AxisId', 'id'], ['AxisIndex', 'componentIndex'], ['AxisName', 'name']],
|
|
345
|
-
function (prop) {
|
|
346
|
-
var vals = modelUtil.normalizeToArray(finder[axis.dim + prop[0]]);
|
|
347
|
-
isTarget |= zrUtil.indexOf(vals, axis.model[prop[1]]) >= 0;
|
|
357
|
+
function findInputAxisInfo(inputAxesInfo, axisInfo) {
|
|
358
|
+
for (var i = 0; i < (inputAxesInfo || []).length; i++) {
|
|
359
|
+
var inputAxisInfo = inputAxesInfo[i];
|
|
360
|
+
if (axisInfo.axis.dim === inputAxisInfo.axisDim
|
|
361
|
+
&& axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex
|
|
362
|
+
) {
|
|
363
|
+
return inputAxisInfo;
|
|
348
364
|
}
|
|
349
|
-
|
|
350
|
-
return !isTarget;
|
|
365
|
+
}
|
|
351
366
|
}
|
|
352
367
|
|
|
353
368
|
function makeMapperParam(axisInfo) {
|
|
@@ -361,7 +376,7 @@
|
|
|
361
376
|
}
|
|
362
377
|
|
|
363
378
|
function illegalPoint(point) {
|
|
364
|
-
return point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);
|
|
379
|
+
return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);
|
|
365
380
|
}
|
|
366
381
|
|
|
367
382
|
module.exports = axisTrigger;
|
|
@@ -88,7 +88,9 @@
|
|
|
88
88
|
shadowColor: labelModel.get('shadowColor'),
|
|
89
89
|
shadowOffsetX: labelModel.get('shadowOffsetX'),
|
|
90
90
|
shadowOffsetY: labelModel.get('shadowOffsetY')
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
|
+
// Lable should be over axisPointer.
|
|
93
|
+
z2: 10
|
|
92
94
|
};
|
|
93
95
|
};
|
|
94
96
|
|
|
@@ -113,8 +115,9 @@
|
|
|
113
115
|
*/
|
|
114
116
|
helper.getValueLabel = function (value, axis, ecModel, seriesDataIndices, opt) {
|
|
115
117
|
var text = axis.scale.getLabel(
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
+
// If `precision` is set, width can be fixed (like '12.00500'), which
|
|
119
|
+
// helps to debounce when when moving label.
|
|
120
|
+
value, {precision: opt.precision}
|
|
118
121
|
);
|
|
119
122
|
var formatter = opt.formatter;
|
|
120
123
|
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
var outputFinder = axisTrigger(
|
|
48
48
|
ecModel.getComponent('axisPointer').coordSysAxesInfo,
|
|
49
49
|
payload.currTrigger,
|
|
50
|
+
[payload.x, payload.y],
|
|
50
51
|
payload,
|
|
51
52
|
payload.dispatchAction || zrUtil.bind(api.dispatchAction, api),
|
|
52
53
|
ecModel,
|
|
53
54
|
api,
|
|
54
|
-
payload.tooltipOption
|
|
55
|
-
payload.highDownKey
|
|
55
|
+
payload.tooltipOption
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
return outputFinder;
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
brushStyle: { // Default brushStyle
|
|
37
37
|
borderWidth: 1,
|
|
38
38
|
color: 'rgba(120,140,180,0.3)',
|
|
39
|
-
borderColor: 'rgba(120,140,180,0.8)'
|
|
40
|
-
width: null // do not use bursh width in line brush, but fetch from grid.
|
|
39
|
+
borderColor: 'rgba(120,140,180,0.8)'
|
|
41
40
|
},
|
|
42
41
|
|
|
43
42
|
throttleType: 'fixRate',// Throttle in brushSelected event. 'fixRate' or 'debounce'.
|
|
@@ -46,7 +45,9 @@
|
|
|
46
45
|
|
|
47
46
|
// FIXME
|
|
48
47
|
// 试验效果
|
|
49
|
-
removeOnClick: true
|
|
48
|
+
removeOnClick: true,
|
|
49
|
+
|
|
50
|
+
z: 10000
|
|
50
51
|
},
|
|
51
52
|
|
|
52
53
|
/**
|
|
@@ -133,7 +134,8 @@
|
|
|
133
134
|
brushMode: option.brushMode,
|
|
134
135
|
transformable: option.transformable,
|
|
135
136
|
brushStyle: new Model(option.brushStyle).getItemStyle(),
|
|
136
|
-
removeOnClick: option.removeOnClick
|
|
137
|
+
removeOnClick: option.removeOnClick,
|
|
138
|
+
z: option.z
|
|
137
139
|
},
|
|
138
140
|
brushOption,
|
|
139
141
|
true
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
function updateController(brushModel, ecModel, api, payload) {
|
|
93
93
|
// Do not update controller when drawing.
|
|
94
94
|
(!payload || payload.$from !== brushModel.id) && this._brushController
|
|
95
|
-
.setPanels(brushModel.brushTargetManager.makePanelOpts())
|
|
95
|
+
.setPanels(brushModel.brushTargetManager.makePanelOpts(api))
|
|
96
96
|
.enableBrush(brushModel.brushOption)
|
|
97
97
|
.updateCovers(brushModel.areas.slice());
|
|
98
98
|
}
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
function stepAParallel(seriesModel, seriesIndex) {
|
|
122
122
|
var coordSys = seriesModel.coordinateSystem;
|
|
123
|
-
hasBrushExists |= coordSys.
|
|
123
|
+
hasBrushExists |= coordSys.hasAxisBrushed();
|
|
124
124
|
|
|
125
125
|
linkOthers(seriesIndex) && coordSys.eachActiveState(
|
|
126
126
|
seriesModel.getData(),
|
|
@@ -233,11 +233,10 @@
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
function checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) {
|
|
236
|
-
var itemLayout = data.getItemLayout(dataIndex);
|
|
237
236
|
for (var i = 0, len = rangeInfoList.length; i < len; i++) {
|
|
238
237
|
var area = rangeInfoList[i];
|
|
239
238
|
if (selectorsByBrushType[area.brushType](
|
|
240
|
-
|
|
239
|
+
dataIndex, data, area.selectors, area
|
|
241
240
|
)) {
|
|
242
241
|
return true;
|
|
243
242
|
}
|
|
@@ -249,7 +248,10 @@
|
|
|
249
248
|
if (zrUtil.isString(brushSelector)) {
|
|
250
249
|
var sels = [];
|
|
251
250
|
zrUtil.each(selector, function (selectorsByElementType, brushType) {
|
|
252
|
-
sels[brushType] =
|
|
251
|
+
sels[brushType] = function (dataIndex, data, selectors, area) {
|
|
252
|
+
var itemLayout = data.getItemLayout(dataIndex);
|
|
253
|
+
return selectorsByElementType[brushSelector](itemLayout, selectors, area);
|
|
254
|
+
};
|
|
253
255
|
});
|
|
254
256
|
return sels;
|
|
255
257
|
}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
var coordSys = calendarModel.coordinateSystem;
|
|
64
64
|
|
|
65
65
|
// range info
|
|
66
|
-
var rangeData = coordSys.
|
|
66
|
+
var rangeData = coordSys.getRangeInfo();
|
|
67
67
|
var orient = coordSys.getOrient();
|
|
68
68
|
|
|
69
69
|
this._renderDayRect(calendarModel, rangeData, group);
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
i = coordSys.getNextNDay(i, 1).time
|
|
91
91
|
) {
|
|
92
92
|
|
|
93
|
-
var point = coordSys.dataToRect([i],
|
|
93
|
+
var point = coordSys.dataToRect([i], false).tl;
|
|
94
94
|
|
|
95
95
|
// every rect
|
|
96
96
|
var rect = new graphic.Rect({
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
function addPoints(date) {
|
|
146
146
|
|
|
147
147
|
self._firstDayOfMonth.push(coordSys.getDateInfo(date));
|
|
148
|
-
self._firstDayPoints.push(coordSys.dataToRect([date],
|
|
148
|
+
self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);
|
|
149
149
|
|
|
150
150
|
var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);
|
|
151
151
|
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
for (var i = 0; i < 7; i++) {
|
|
202
202
|
|
|
203
203
|
var tmpD = coordSys.getNextNDay(date.time, i);
|
|
204
|
-
var point = coordSys.dataToRect([tmpD.time],
|
|
204
|
+
var point = coordSys.dataToRect([tmpD.time], false);
|
|
205
205
|
|
|
206
206
|
points[2 * tmpD.day] = point.tl;
|
|
207
207
|
points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];
|
|
@@ -479,7 +479,7 @@
|
|
|
479
479
|
for (var i = 0; i < 7; i++) {
|
|
480
480
|
|
|
481
481
|
var tmpD = coordSys.getNextNDay(start, i);
|
|
482
|
-
var point = coordSys.dataToRect([tmpD.time],
|
|
482
|
+
var point = coordSys.dataToRect([tmpD.time], false).center;
|
|
483
483
|
var day = i;
|
|
484
484
|
day = Math.abs((i + firstDayOfWeek) % 7);
|
|
485
485
|
var weekText = new graphic.Text({
|
|
@@ -49,6 +49,13 @@
|
|
|
49
49
|
*/
|
|
50
50
|
this._dataExtent;
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* {minSpan, maxSpan, minValueSpan, maxValueSpan}
|
|
54
|
+
* @private
|
|
55
|
+
* @type {Object}
|
|
56
|
+
*/
|
|
57
|
+
this._minMaxSpan;
|
|
58
|
+
|
|
52
59
|
/**
|
|
53
60
|
* @readOnly
|
|
54
61
|
* @type {module: echarts/model/Global}
|
|
@@ -147,6 +154,10 @@
|
|
|
147
154
|
return foundOtherAxisModel;
|
|
148
155
|
},
|
|
149
156
|
|
|
157
|
+
getMinMaxSpan: function () {
|
|
158
|
+
return zrUtil.clone(this._minMaxSpan);
|
|
159
|
+
},
|
|
160
|
+
|
|
150
161
|
/**
|
|
151
162
|
* Only calculate by given range and this._dataExtent, do not change anything.
|
|
152
163
|
*
|
|
@@ -241,6 +252,8 @@
|
|
|
241
252
|
this._valueWindow = dataWindow.valueWindow;
|
|
242
253
|
this._percentWindow = dataWindow.percentWindow;
|
|
243
254
|
|
|
255
|
+
setMinMaxSpan(this);
|
|
256
|
+
|
|
244
257
|
// Update axis setting then.
|
|
245
258
|
setAxisModel(this);
|
|
246
259
|
},
|
|
@@ -270,6 +283,10 @@
|
|
|
270
283
|
var filterMode = dataZoomModel.get('filterMode');
|
|
271
284
|
var valueWindow = this._valueWindow;
|
|
272
285
|
|
|
286
|
+
if (filterMode === 'none') {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
|
|
273
290
|
// FIXME
|
|
274
291
|
// Toolbox may has dataZoom injected. And if there are stacked bar chart
|
|
275
292
|
// with NaN data, NaN will be filtered and stack will be wrong.
|
|
@@ -289,19 +306,43 @@
|
|
|
289
306
|
// Process series data
|
|
290
307
|
each(seriesModels, function (seriesModel) {
|
|
291
308
|
var seriesData = seriesModel.getData();
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
)
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
309
|
+
var dataDims = seriesModel.coordDimToDataDim(axisDim);
|
|
310
|
+
|
|
311
|
+
if (filterMode === 'weakFilter') {
|
|
312
|
+
seriesData && seriesData.filterSelf(function (dataIndex) {
|
|
313
|
+
var leftOut;
|
|
314
|
+
var rightOut;
|
|
315
|
+
var hasValue;
|
|
316
|
+
for (var i = 0; i < dataDims.length; i++) {
|
|
317
|
+
var value = seriesData.get(dataDims[i], dataIndex);
|
|
318
|
+
var thisHasValue = !isNaN(value);
|
|
319
|
+
var thisLeftOut = value < valueWindow[0];
|
|
320
|
+
var thisRightOut = value > valueWindow[1];
|
|
321
|
+
if (thisHasValue && !thisLeftOut && !thisRightOut) {
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
thisHasValue && (hasValue = true);
|
|
325
|
+
thisLeftOut && (leftOut = true);
|
|
326
|
+
thisRightOut && (rightOut = true);
|
|
327
|
+
}
|
|
328
|
+
// If both left out and right out, do not filter.
|
|
329
|
+
return hasValue && leftOut && rightOut;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
seriesData && each(dataDims, function (dim) {
|
|
334
|
+
if (filterMode === 'empty') {
|
|
335
|
+
seriesModel.setData(
|
|
336
|
+
seriesData.map(dim, function (value) {
|
|
337
|
+
return !isInWindow(value) ? NaN : value;
|
|
338
|
+
})
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
seriesData.filterSelf(dim, isInWindow);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
305
346
|
});
|
|
306
347
|
|
|
307
348
|
function isInWindow(value) {
|
|
@@ -400,5 +441,27 @@
|
|
|
400
441
|
);
|
|
401
442
|
}
|
|
402
443
|
|
|
444
|
+
function setMinMaxSpan(axisProxy) {
|
|
445
|
+
var minMaxSpan = axisProxy._minMaxSpan = {};
|
|
446
|
+
var dataZoomModel = axisProxy._dataZoomModel;
|
|
447
|
+
|
|
448
|
+
each(['min', 'max'], function (minMax) {
|
|
449
|
+
minMaxSpan[minMax + 'Span'] = dataZoomModel.get(minMax + 'Span');
|
|
450
|
+
|
|
451
|
+
// minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan
|
|
452
|
+
var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');
|
|
453
|
+
if (valueSpan != null) {
|
|
454
|
+
minMaxSpan[minMax + 'ValueSpan'] = valueSpan;
|
|
455
|
+
|
|
456
|
+
valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan);
|
|
457
|
+
if (valueSpan != null) {
|
|
458
|
+
minMaxSpan[minMax + 'Span'] = numberUtil.linearMap(
|
|
459
|
+
valueSpan, axisProxy._dataExtent, [0, 100], true
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
|
|
403
466
|
module.exports = AxisProxy;
|
|
404
467
|
|
|
@@ -30,12 +30,18 @@
|
|
|
30
30
|
xAxisIndex: null, // Default the first horizontal category axis.
|
|
31
31
|
yAxisIndex: null, // Default the first vertical category axis.
|
|
32
32
|
|
|
33
|
-
filterMode: 'filter', // Possible values: 'filter' or 'empty'.
|
|
34
|
-
// 'filter': data items which are out of window will be removed.
|
|
35
|
-
//
|
|
33
|
+
filterMode: 'filter', // Possible values: 'filter' or 'empty' or 'weakFilter'.
|
|
34
|
+
// 'filter': data items which are out of window will be removed. This option is
|
|
35
|
+
// applicable when filtering outliers. For each data item, it will be
|
|
36
|
+
// filtered if one of the relevant dimensions is out of the window.
|
|
37
|
+
// 'weakFilter': data items which are out of window will be removed. This option
|
|
38
|
+
// is applicable when filtering outliers. For each data item, it will be
|
|
39
|
+
// filtered only if all of the relevant dimensions are out of the same
|
|
40
|
+
// side of the window.
|
|
36
41
|
// 'empty': data items which are out of window will be set to empty.
|
|
37
42
|
// This option is applicable when user should not neglect
|
|
38
43
|
// that there are some data items out of window.
|
|
44
|
+
// 'none': Do not filter.
|
|
39
45
|
// Taking line chart as an example, line will be broken in
|
|
40
46
|
// the filtered points when filterModel is set to 'empty', but
|
|
41
47
|
// be connected when set to 'filter'.
|
|
@@ -47,7 +53,11 @@
|
|
|
47
53
|
start: 0, // Start percent. 0 ~ 100
|
|
48
54
|
end: 100, // End percent. 0 ~ 100
|
|
49
55
|
startValue: null, // Start value. If startValue specified, start is ignored.
|
|
50
|
-
endValue: null
|
|
56
|
+
endValue: null, // End value. If endValue specified, end is ignored.
|
|
57
|
+
minSpan: null, // 0 ~ 100
|
|
58
|
+
maxSpan: null, // 0 ~ 100
|
|
59
|
+
minValueSpan: null, // The range of dataZoom can not be smaller than that.
|
|
60
|
+
maxValueSpan: null // The range of dataZoom can not be larger than that.
|
|
51
61
|
},
|
|
52
62
|
|
|
53
63
|
/**
|
|
@@ -469,9 +479,15 @@
|
|
|
469
479
|
|
|
470
480
|
/**
|
|
471
481
|
* @public
|
|
482
|
+
* @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy
|
|
483
|
+
* corresponding to the axisModel
|
|
472
484
|
* @return {module:echarts/component/dataZoom/AxisProxy}
|
|
473
485
|
*/
|
|
474
|
-
findRepresentativeAxisProxy: function () {
|
|
486
|
+
findRepresentativeAxisProxy: function (axisModel) {
|
|
487
|
+
if (axisModel) {
|
|
488
|
+
return axisModel.__dzAxisProxy;
|
|
489
|
+
}
|
|
490
|
+
|
|
475
491
|
// Find the first hosted axisProxy
|
|
476
492
|
var axisProxies = this._axisProxies;
|
|
477
493
|
for (var key in axisProxies) {
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
*/
|
|
13
13
|
defaultOption: {
|
|
14
14
|
disabled: false, // Whether disable this inside zoom.
|
|
15
|
-
zoomLock: false
|
|
15
|
+
zoomLock: false, // Whether disable zoom but only pan.
|
|
16
|
+
zoomOnMouseWheel: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'.
|
|
17
|
+
moveOnMouseMove: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'.
|
|
18
|
+
preventDefaultMouseMove: true
|
|
16
19
|
}
|
|
17
20
|
});
|