echarts 3.6.1 → 3.7.2
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/README.md +1 -0
- package/dist/echarts-en.js +77756 -0
- package/dist/echarts-en.min.js +38 -0
- package/dist/echarts.common-en.js +50169 -0
- package/dist/echarts.common-en.min.js +30 -0
- package/dist/echarts.common.js +5799 -3093
- package/dist/echarts.common.min.js +14 -13
- package/dist/echarts.js +7628 -4679
- package/dist/echarts.min.js +22 -22
- package/dist/echarts.simple-en.js +34988 -0
- package/dist/echarts.simple-en.min.js +27 -0
- package/dist/echarts.simple.js +4472 -2493
- package/dist/echarts.simple.min.js +11 -9
- package/dist/extension/bmap.js +50 -11
- package/dist/extension/bmap.min.js +1 -1
- package/dist/extension/dataTool.js +10 -10
- package/extension/bmap/BMapCoordSys.js +40 -1
- package/index.blank.js +4 -0
- package/index.common.js +1 -1
- package/index.js +1 -1
- package/lib/action/createDataSelectAction.js +6 -2
- package/lib/chart/bar/BarView.js +6 -3
- package/lib/chart/bar/BaseBarSeries.js +4 -3
- package/lib/chart/bar/PictorialBarSeries.js +1 -1
- package/lib/chart/bar/PictorialBarView.js +29 -7
- package/lib/chart/bar/helper.js +14 -31
- package/lib/chart/candlestick/candlestickLayout.js +49 -6
- package/lib/chart/chord/chordCircularLayout.js +2 -2
- package/lib/chart/custom.js +135 -21
- package/lib/chart/funnel/FunnelSeries.js +0 -1
- package/lib/chart/funnel/FunnelView.js +15 -22
- package/lib/chart/funnel/funnelLayout.js +1 -1
- package/lib/chart/gauge/GaugeSeries.js +7 -12
- package/lib/chart/gauge/GaugeView.js +32 -53
- package/lib/chart/graph/GraphSeries.js +2 -1
- package/lib/chart/graph/GraphView.js +39 -45
- package/lib/chart/graph/forceHelper.js +5 -0
- package/lib/chart/graph/forceLayout.js +1 -1
- package/lib/chart/heatmap/HeatmapLayer.js +7 -0
- package/lib/chart/heatmap/HeatmapView.js +10 -9
- package/lib/chart/helper/EffectSymbol.js +3 -3
- package/lib/chart/helper/LargeSymbolDraw.js +6 -1
- package/lib/chart/helper/Line.js +40 -22
- package/lib/chart/helper/Symbol.js +20 -7
- package/lib/chart/helper/SymbolDraw.js +2 -1
- package/lib/chart/helper/labelHelper.js +0 -17
- package/lib/chart/helper/whiskerBoxCommon.js +11 -3
- package/lib/chart/line/LineSeries.js +1 -0
- package/lib/chart/line/LineView.js +14 -2
- package/lib/chart/line/poly.js +5 -0
- package/lib/chart/lines/LinesView.js +22 -7
- package/lib/chart/map/MapSeries.js +3 -7
- package/lib/chart/map/MapView.js +29 -18
- package/lib/chart/pie/PieSeries.js +20 -6
- package/lib/chart/pie/PieView.js +20 -23
- package/lib/chart/pie/labelLayout.js +3 -3
- package/lib/chart/radar/RadarView.js +16 -20
- package/lib/chart/sankey/SankeySeries.js +2 -4
- package/lib/chart/sankey/SankeyView.js +13 -29
- package/lib/chart/sankey/sankeyLayout.js +1 -1
- package/lib/chart/scatter/ScatterSeries.js +2 -1
- package/lib/chart/themeRiver/ThemeRiverSeries.js +2 -4
- package/lib/chart/themeRiver/ThemeRiverView.js +2 -5
- package/lib/chart/themeRiver/themeRiverLayout.js +1 -1
- package/lib/chart/treemap/Breadcrumb.js +1 -1
- package/lib/chart/treemap/TreemapSeries.js +28 -8
- package/lib/chart/treemap/TreemapView.js +88 -77
- package/lib/chart/treemap/treemapLayout.js +29 -13
- package/lib/component/axis/AngleAxisView.js +13 -19
- package/lib/component/axis/AxisBuilder.js +260 -186
- package/lib/component/axis/CartesianAxisView.js +15 -3
- package/lib/component/axis/ParallelAxisView.js +1 -1
- package/lib/component/axis/RadiusAxisView.js +1 -1
- package/lib/component/axis/SingleAxisView.js +8 -2
- package/lib/component/axis/cartesianAxisHelper.js +11 -15
- package/lib/component/axisPointer/AxisPointerModel.js +1 -3
- package/lib/component/axisPointer/BaseAxisPointer.js +15 -38
- package/lib/component/axisPointer/axisTrigger.js +36 -20
- package/lib/component/axisPointer/modelHelper.js +3 -4
- package/lib/component/axisPointer/viewHelper.js +4 -6
- package/lib/component/axisPointer.js +1 -14
- package/lib/component/calendar/CalendarView.js +22 -39
- package/lib/component/dataZoom/AxisProxy.js +3 -2
- package/lib/component/dataZoom/DataZoomModel.js +16 -4
- package/lib/component/dataZoom/InsideZoomView.js +5 -3
- package/lib/component/dataZoom/SliderZoomView.js +21 -32
- package/lib/component/dataZoom/roams.js +33 -9
- package/lib/component/dataZoom/typeDefaulter.js +1 -1
- package/lib/component/graphic.js +17 -5
- package/lib/component/helper/BrushTargetManager.js +1 -1
- package/lib/component/helper/MapDraw.js +26 -22
- package/lib/component/helper/RoamController.js +12 -11
- package/lib/component/helper/listComponent.js +27 -24
- package/lib/component/helper/selectableMixin.js +40 -15
- package/lib/component/legend/LegendModel.js +11 -3
- package/lib/component/legend/LegendView.js +151 -70
- package/lib/component/legend/ScrollableLegendModel.js +75 -0
- package/lib/component/legend/ScrollableLegendView.js +367 -0
- package/lib/component/legend/legendAction.js +1 -0
- package/lib/component/legend/scrollableLegendAction.js +24 -0
- package/lib/component/legend.js +8 -3
- package/lib/component/legendScroll.js +11 -0
- package/lib/component/marker/MarkAreaView.js +12 -26
- package/lib/component/marker/MarkLineView.js +5 -5
- package/lib/component/marker/MarkPointView.js +4 -4
- package/lib/component/marker/MarkerModel.js +1 -4
- package/lib/component/marker/markerHelper.js +1 -0
- package/lib/component/radar/RadarView.js +6 -3
- package/lib/component/timeline/SliderTimelineModel.js +4 -6
- package/lib/component/timeline/SliderTimelineView.js +14 -16
- package/lib/component/timeline/TimelineAxis.js +1 -1
- package/lib/component/timeline/TimelineModel.js +1 -3
- package/lib/component/title.js +9 -10
- package/lib/component/toolbox/ToolboxModel.js +2 -0
- package/lib/component/toolbox/ToolboxView.js +15 -27
- package/lib/component/toolbox/feature/Brush.js +3 -8
- package/lib/component/toolbox/feature/DataView.js +5 -5
- package/lib/component/toolbox/feature/DataZoom.js +3 -4
- package/lib/component/toolbox/feature/MagicType.js +3 -6
- package/lib/component/toolbox/feature/Restore.js +2 -1
- package/lib/component/toolbox/feature/SaveAsImage.js +23 -9
- package/lib/component/tooltip/TooltipContent.js +4 -4
- package/lib/component/tooltip/TooltipView.js +29 -6
- package/lib/component/visualMap/ContinuousModel.js +2 -2
- package/lib/component/visualMap/ContinuousView.js +12 -8
- package/lib/component/visualMap/PiecewiseModel.js +1 -2
- package/lib/component/visualMap/PiecewiseView.js +2 -2
- package/lib/component/visualMap/VisualMapModel.js +18 -12
- package/lib/coord/Axis.js +1 -1
- package/lib/coord/axisDefault.js +3 -3
- package/lib/coord/axisHelper.js +18 -1
- package/lib/coord/axisModelCommonMixin.js +12 -2
- package/lib/coord/calendar/Calendar.js +65 -21
- package/lib/coord/calendar/CalendarModel.js +6 -12
- package/lib/coord/cartesian/Cartesian2D.js +0 -14
- package/lib/coord/cartesian/Grid.js +47 -28
- package/lib/coord/geo/Geo.js +2 -18
- package/lib/coord/geo/GeoModel.js +6 -13
- package/lib/coord/geo/fix/diaoyuIsland.js +30 -0
- package/lib/coord/geo/geoCreator.js +6 -1
- package/lib/coord/polar/Polar.js +0 -13
- package/lib/coord/radar/Radar.js +1 -1
- package/lib/coord/radar/RadarModel.js +6 -2
- package/lib/data/DataDiffer.js +14 -7
- package/lib/data/Graph.js +3 -0
- package/lib/data/List.js +1 -1
- package/lib/data/Tree.js +2 -2
- package/lib/data/helper/completeDimensions.js +2 -11
- package/lib/echarts.js +33 -10
- package/lib/lang/cn.js +4 -0
- package/lib/lang/default.js +42 -0
- package/lib/lang/en.js +42 -0
- package/lib/lang.js +42 -0
- package/lib/langEN.js +42 -0
- package/lib/layout/barGrid.js +11 -3
- package/lib/layout/barPolar.js +9 -2
- package/lib/model/Model.js +2 -1
- package/lib/model/Series.js +14 -6
- package/lib/model/mixin/textStyle.js +11 -9
- package/lib/preprocessor/backwardCompat.js +5 -4
- package/lib/preprocessor/helper/compatStyle.js +157 -45
- package/lib/scale/Interval.js +10 -4
- package/lib/scale/Time.js +14 -6
- package/lib/scale/helper.js +15 -2
- package/lib/util/format.js +4 -24
- package/lib/util/graphic.js +412 -21
- package/lib/util/layout.js +28 -16
- package/lib/util/model.js +26 -11
- package/lib/util/number.js +106 -21
- package/lib/visual/VisualMapping.js +4 -4
- package/package.json +3 -3
- package/rollup.config.js +49 -0
- package/src/action/createDataSelectAction.js +6 -2
- package/src/chart/bar/BarView.js +6 -3
- package/src/chart/bar/BaseBarSeries.js +4 -3
- package/src/chart/bar/PictorialBarSeries.js +1 -1
- package/src/chart/bar/PictorialBarView.js +29 -7
- package/src/chart/bar/helper.js +13 -30
- package/src/chart/candlestick/candlestickLayout.js +49 -6
- package/src/chart/chord/chordCircularLayout.js +2 -2
- package/src/chart/custom.js +135 -21
- package/src/chart/funnel/FunnelSeries.js +0 -1
- package/src/chart/funnel/FunnelView.js +15 -22
- package/src/chart/funnel/funnelLayout.js +1 -1
- package/src/chart/gauge/GaugeSeries.js +7 -12
- package/src/chart/gauge/GaugeView.js +32 -53
- package/src/chart/graph/GraphSeries.js +2 -1
- package/src/chart/graph/GraphView.js +39 -45
- package/src/chart/graph/forceHelper.js +5 -0
- package/src/chart/graph/forceLayout.js +1 -1
- package/src/chart/heatmap/HeatmapLayer.js +7 -0
- package/src/chart/heatmap/HeatmapView.js +10 -9
- package/src/chart/helper/EffectSymbol.js +3 -3
- package/src/chart/helper/LargeSymbolDraw.js +6 -1
- package/src/chart/helper/Line.js +40 -22
- package/src/chart/helper/Symbol.js +20 -7
- package/src/chart/helper/SymbolDraw.js +2 -1
- package/src/chart/helper/labelHelper.js +0 -17
- package/src/chart/helper/whiskerBoxCommon.js +11 -4
- package/src/chart/line/LineSeries.js +1 -0
- package/src/chart/line/LineView.js +14 -2
- package/src/chart/line/poly.js +5 -0
- package/src/chart/lines/LinesView.js +22 -7
- package/src/chart/map/MapSeries.js +3 -7
- package/src/chart/map/MapView.js +29 -18
- package/src/chart/pie/PieSeries.js +20 -6
- package/src/chart/pie/PieView.js +20 -23
- package/src/chart/pie/labelLayout.js +3 -3
- package/src/chart/radar/RadarView.js +16 -20
- package/src/chart/sankey/SankeySeries.js +2 -4
- package/src/chart/sankey/SankeyView.js +13 -29
- package/src/chart/sankey/sankeyLayout.js +1 -1
- package/src/chart/scatter/ScatterSeries.js +2 -1
- package/src/chart/themeRiver/ThemeRiverSeries.js +2 -4
- package/src/chart/themeRiver/ThemeRiverView.js +2 -5
- package/src/chart/themeRiver/themeRiverLayout.js +1 -1
- package/src/chart/treemap/Breadcrumb.js +1 -1
- package/src/chart/treemap/TreemapSeries.js +28 -8
- package/src/chart/treemap/TreemapView.js +88 -77
- package/src/chart/treemap/treemapLayout.js +29 -13
- package/src/component/axis/AngleAxisView.js +13 -19
- package/src/component/axis/AxisBuilder.js +260 -186
- package/src/component/axis/CartesianAxisView.js +15 -3
- package/src/component/axis/ParallelAxisView.js +1 -1
- package/src/component/axis/RadiusAxisView.js +1 -1
- package/src/component/axis/SingleAxisView.js +8 -2
- package/src/component/axis/cartesianAxisHelper.js +11 -15
- package/src/component/axisPointer/AxisPointerModel.js +1 -3
- package/src/component/axisPointer/BaseAxisPointer.js +15 -38
- package/src/component/axisPointer/axisTrigger.js +36 -20
- package/src/component/axisPointer/modelHelper.js +3 -4
- package/src/component/axisPointer/viewHelper.js +4 -6
- package/src/component/axisPointer.js +1 -14
- package/src/component/calendar/CalendarView.js +22 -39
- package/src/component/dataZoom/AxisProxy.js +3 -2
- package/src/component/dataZoom/DataZoomModel.js +16 -4
- package/src/component/dataZoom/InsideZoomView.js +5 -3
- package/src/component/dataZoom/SliderZoomView.js +21 -32
- package/src/component/dataZoom/roams.js +33 -9
- package/src/component/dataZoom/typeDefaulter.js +1 -1
- package/src/component/graphic.js +17 -5
- package/src/component/helper/BrushTargetManager.js +1 -1
- package/src/component/helper/MapDraw.js +26 -22
- package/src/component/helper/RoamController.js +12 -11
- package/src/component/helper/listComponent.js +27 -24
- package/src/component/helper/selectableMixin.js +40 -15
- package/src/component/legend/LegendModel.js +11 -3
- package/src/component/legend/LegendView.js +151 -70
- package/src/component/legend/ScrollableLegendModel.js +76 -0
- package/src/component/legend/ScrollableLegendView.js +368 -0
- package/src/component/legend/legendAction.js +1 -0
- package/src/component/legend/scrollableLegendAction.js +25 -0
- package/src/component/legend.js +8 -3
- package/src/component/legendScroll.js +12 -0
- package/src/component/marker/MarkAreaView.js +12 -26
- package/src/component/marker/MarkLineView.js +5 -5
- package/src/component/marker/MarkPointView.js +4 -4
- package/src/component/marker/MarkerModel.js +1 -4
- package/src/component/marker/markerHelper.js +1 -0
- package/src/component/radar/RadarView.js +6 -3
- package/src/component/timeline/SliderTimelineModel.js +4 -6
- package/src/component/timeline/SliderTimelineView.js +14 -16
- package/src/component/timeline/TimelineAxis.js +1 -1
- package/src/component/timeline/TimelineModel.js +1 -3
- package/src/component/title.js +9 -10
- package/src/component/toolbox/ToolboxModel.js +2 -0
- package/src/component/toolbox/ToolboxView.js +15 -27
- package/src/component/toolbox/feature/Brush.js +3 -8
- package/src/component/toolbox/feature/DataView.js +5 -5
- package/src/component/toolbox/feature/DataZoom.js +3 -4
- package/src/component/toolbox/feature/MagicType.js +3 -6
- package/src/component/toolbox/feature/Restore.js +2 -1
- package/src/component/toolbox/feature/SaveAsImage.js +23 -10
- package/src/component/tooltip/TooltipContent.js +4 -4
- package/src/component/tooltip/TooltipView.js +29 -7
- package/src/component/visualMap/ContinuousModel.js +2 -2
- package/src/component/visualMap/ContinuousView.js +12 -8
- package/src/component/visualMap/PiecewiseModel.js +1 -2
- package/src/component/visualMap/PiecewiseView.js +2 -2
- package/src/component/visualMap/VisualMapModel.js +18 -12
- package/src/coord/Axis.js +1 -1
- package/src/coord/axisDefault.js +3 -3
- package/src/coord/axisHelper.js +18 -1
- package/src/coord/axisModelCommonMixin.js +12 -2
- package/src/coord/calendar/Calendar.js +65 -21
- package/src/coord/calendar/CalendarModel.js +6 -12
- package/src/coord/cartesian/Cartesian2D.js +0 -14
- package/src/coord/cartesian/Grid.js +47 -28
- package/src/coord/geo/Geo.js +2 -18
- package/src/coord/geo/GeoModel.js +6 -13
- package/src/coord/geo/fix/diaoyuIsland.js +30 -0
- package/src/coord/geo/geoCreator.js +6 -1
- package/src/coord/polar/Polar.js +0 -13
- package/src/coord/radar/Radar.js +1 -1
- package/src/coord/radar/RadarModel.js +6 -2
- package/src/data/DataDiffer.js +14 -7
- package/src/data/Graph.js +3 -0
- package/src/data/List.js +1 -1
- package/src/data/Tree.js +2 -2
- package/src/data/helper/completeDimensions.js +2 -11
- package/src/echarts.js +33 -10
- package/src/lang.js +43 -0
- package/src/langEN.js +43 -0
- package/src/layout/barGrid.js +11 -3
- package/src/layout/barPolar.js +9 -2
- package/src/model/Model.js +2 -1
- package/src/model/Series.js +14 -6
- package/src/model/mixin/textStyle.js +11 -9
- package/src/preprocessor/backwardCompat.js +5 -4
- package/src/preprocessor/helper/compatStyle.js +157 -45
- package/src/scale/Interval.js +10 -4
- package/src/scale/Time.js +14 -6
- package/src/scale/helper.js +15 -2
- package/src/util/format.js +4 -24
- package/src/util/graphic.js +412 -21
- package/src/util/layout.js +28 -16
- package/src/util/model.js +26 -11
- package/src/util/number.js +106 -21
- package/src/visual/VisualMapping.js +4 -4
- package/webpack.config.js +21 -7
- package/.npmignore +0 -10
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
var getInterval = AxisBuilder.getInterval;
|
|
10
10
|
|
|
11
11
|
var axisBuilderAttrs = [
|
|
12
|
-
'axisLine', '
|
|
12
|
+
'axisLine', 'axisTickLabel', 'axisName'
|
|
13
13
|
];
|
|
14
14
|
var selfBuilderAttrs = [
|
|
15
15
|
'splitArea', 'splitLine'
|
|
@@ -97,13 +97,19 @@
|
|
|
97
97
|
);
|
|
98
98
|
var ticks = axis.scale.getTicks();
|
|
99
99
|
|
|
100
|
+
var showMinLabel = axisModel.get('axisLabel.showMinLabel');
|
|
101
|
+
var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
|
|
102
|
+
|
|
100
103
|
var p1 = [];
|
|
101
104
|
var p2 = [];
|
|
102
105
|
// Simple optimization
|
|
103
106
|
// Batching the lines if color are the same
|
|
104
107
|
var lineStyle = lineStyleModel.getLineStyle();
|
|
105
108
|
for (var i = 0; i < ticksCoords.length; i++) {
|
|
106
|
-
if (ifIgnoreOnTick(
|
|
109
|
+
if (ifIgnoreOnTick(
|
|
110
|
+
axis, i, lineInterval, ticksCoords.length,
|
|
111
|
+
showMinLabel, showMaxLabel
|
|
112
|
+
)) {
|
|
107
113
|
continue;
|
|
108
114
|
}
|
|
109
115
|
|
|
@@ -174,8 +180,14 @@
|
|
|
174
180
|
var areaStyle = areaStyleModel.getAreaStyle();
|
|
175
181
|
areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];
|
|
176
182
|
|
|
183
|
+
var showMinLabel = axisModel.get('axisLabel.showMinLabel');
|
|
184
|
+
var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
|
|
185
|
+
|
|
177
186
|
for (var i = 1; i < ticksCoords.length; i++) {
|
|
178
|
-
if (ifIgnoreOnTick(
|
|
187
|
+
if (ifIgnoreOnTick(
|
|
188
|
+
axis, i, areaInterval, ticksCoords.length,
|
|
189
|
+
showMinLabel, showMaxLabel
|
|
190
|
+
)) {
|
|
179
191
|
continue;
|
|
180
192
|
}
|
|
181
193
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var brushHelper = require('../helper/brushHelper');
|
|
7
7
|
var graphic = require('../../util/graphic');
|
|
8
8
|
|
|
9
|
-
var elementList = ['axisLine', '
|
|
9
|
+
var elementList = ['axisLine', 'axisTickLabel', 'axisName'];
|
|
10
10
|
|
|
11
11
|
var AxisView = require('../../echarts').extendComponentView({
|
|
12
12
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick;
|
|
9
9
|
|
|
10
10
|
var axisBuilderAttrs = [
|
|
11
|
-
'axisLine', '
|
|
11
|
+
'axisLine', 'axisTickLabel', 'axisName'
|
|
12
12
|
];
|
|
13
13
|
|
|
14
14
|
var selfBuilderAttr = 'splitLine';
|
|
@@ -66,8 +66,14 @@
|
|
|
66
66
|
var p1 = [];
|
|
67
67
|
var p2 = [];
|
|
68
68
|
|
|
69
|
+
var showMinLabel = axisModel.get('axisLabel.showMinLabel');
|
|
70
|
+
var showMaxLabel = axisModel.get('axisLabel.showMaxLabel');
|
|
71
|
+
|
|
69
72
|
for (var i = 0; i < ticksCoords.length; ++i) {
|
|
70
|
-
if (ifIgnoreOnTick(
|
|
73
|
+
if (ifIgnoreOnTick(
|
|
74
|
+
axis, i, lineInterval, ticksCoords.length,
|
|
75
|
+
showMinLabel, showMaxLabel
|
|
76
|
+
)) {
|
|
71
77
|
continue;
|
|
72
78
|
}
|
|
73
79
|
var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
|
|
@@ -21,29 +21,25 @@
|
|
|
21
21
|
var axisPosition = axis.onZero ? 'onZero' : rawAxisPosition;
|
|
22
22
|
var axisDim = axis.dim;
|
|
23
23
|
|
|
24
|
-
// [left, right, top, bottom]
|
|
25
24
|
var rect = grid.getRect();
|
|
26
25
|
var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
|
|
27
|
-
|
|
26
|
+
var idx = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2};
|
|
28
27
|
var axisOffset = axisModel.get('offset') || 0;
|
|
29
28
|
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
posMap.x.onZero = Math.max(Math.min(getZero('y'), posMap.x.bottom), posMap.x.top);
|
|
36
|
-
posMap.y.onZero = Math.max(Math.min(getZero('x'), posMap.y.right), posMap.y.left);
|
|
29
|
+
var posBound = axisDim === 'x'
|
|
30
|
+
? [rectBound[2] - axisOffset, rectBound[3] + axisOffset]
|
|
31
|
+
: [rectBound[0] - axisOffset, rectBound[1] + axisOffset];
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
|
|
33
|
+
if (axis.onZero) {
|
|
34
|
+
var otherAxis = grid.getAxis(axisDim === 'x' ? 'y' : 'x', axis.onZeroAxisIndex);
|
|
35
|
+
var onZeroCoord = otherAxis.toGlobalCoord(otherAxis.dataToCoord(0));
|
|
36
|
+
posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
// Axis position
|
|
44
40
|
layout.position = [
|
|
45
|
-
axisDim === 'y' ?
|
|
46
|
-
axisDim === 'x' ?
|
|
41
|
+
axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0],
|
|
42
|
+
axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]
|
|
47
43
|
];
|
|
48
44
|
|
|
49
45
|
// Axis rotation
|
|
@@ -53,7 +49,7 @@
|
|
|
53
49
|
var dirMap = {top: -1, bottom: 1, left: -1, right: 1};
|
|
54
50
|
|
|
55
51
|
layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];
|
|
56
|
-
layout.labelOffset = axis.onZero ?
|
|
52
|
+
layout.labelOffset = axis.onZero ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0;
|
|
57
53
|
|
|
58
54
|
if (axisModel.get('axisTick.inside')) {
|
|
59
55
|
layout.tickDirection = -layout.tickDirection;
|
|
@@ -59,9 +59,7 @@
|
|
|
59
59
|
formatter: null, // string | Function
|
|
60
60
|
precision: 'auto', // Or a number like 0, 1, 2 ...
|
|
61
61
|
margin: 3,
|
|
62
|
-
|
|
63
|
-
color: '#fff'
|
|
64
|
-
},
|
|
62
|
+
color: '#fff',
|
|
65
63
|
padding: [5, 7, 5, 7],
|
|
66
64
|
backgroundColor: 'auto', // default: axis line color
|
|
67
65
|
borderColor: null,
|
|
@@ -268,15 +268,20 @@
|
|
|
268
268
|
var isInit;
|
|
269
269
|
if (!this._handle) {
|
|
270
270
|
isInit = true;
|
|
271
|
-
handle = this._handle = createIcon(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
271
|
+
handle = this._handle = graphic.createIcon(
|
|
272
|
+
handleModel.get('icon'),
|
|
273
|
+
{
|
|
274
|
+
cursor: 'move',
|
|
275
|
+
draggable: true,
|
|
276
|
+
onmousemove: function (e) {
|
|
277
|
+
// Fot mobile devicem, prevent screen slider on the button.
|
|
278
|
+
eventTool.stop(e.event);
|
|
279
|
+
},
|
|
280
|
+
onmousedown: bind(this._onHandleDragMove, this, 0, 0),
|
|
281
|
+
drift: bind(this._onHandleDragMove, this),
|
|
282
|
+
ondragend: bind(this._onHandleDragEnd, this)
|
|
283
|
+
}
|
|
284
|
+
);
|
|
280
285
|
zr.add(handle);
|
|
281
286
|
}
|
|
282
287
|
|
|
@@ -476,7 +481,7 @@
|
|
|
476
481
|
if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {
|
|
477
482
|
var equals = true;
|
|
478
483
|
zrUtil.each(newProps, function (item, key) {
|
|
479
|
-
equals
|
|
484
|
+
equals = equals && propsEqual(lastProps[key], item);
|
|
480
485
|
});
|
|
481
486
|
return !!equals;
|
|
482
487
|
}
|
|
@@ -496,34 +501,6 @@
|
|
|
496
501
|
};
|
|
497
502
|
}
|
|
498
503
|
|
|
499
|
-
function createIcon(handleModel, handlers) {
|
|
500
|
-
var iconStr = handleModel.get('icon');
|
|
501
|
-
var style = {
|
|
502
|
-
x: -1, y: -1, width: 2, height: 2
|
|
503
|
-
};
|
|
504
|
-
var opt = zrUtil.extend({
|
|
505
|
-
style: {
|
|
506
|
-
strokeNoScale: true
|
|
507
|
-
},
|
|
508
|
-
rectHover: true,
|
|
509
|
-
cursor: 'move',
|
|
510
|
-
draggable: true
|
|
511
|
-
}, handlers);
|
|
512
|
-
|
|
513
|
-
return iconStr.indexOf('image://') === 0
|
|
514
|
-
? (
|
|
515
|
-
style.image = iconStr.slice(8),
|
|
516
|
-
opt.style = style,
|
|
517
|
-
new graphic.Image(opt)
|
|
518
|
-
)
|
|
519
|
-
: graphic.makePath(
|
|
520
|
-
iconStr.replace('path://', ''),
|
|
521
|
-
opt,
|
|
522
|
-
style,
|
|
523
|
-
'center'
|
|
524
|
-
);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
504
|
function updateMandatoryProps(group, axisPointerModel, silent) {
|
|
528
505
|
var z = axisPointerModel.get('z');
|
|
529
506
|
var zlevel = axisPointerModel.get('zlevel');
|
|
@@ -14,26 +14,41 @@
|
|
|
14
14
|
* then hide/downplay them.
|
|
15
15
|
*
|
|
16
16
|
* @param {Object} coordSysAxesInfo
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
17
|
+
* @param {Object} payload
|
|
18
|
+
* @param {string} [payload.currTrigger] 'click' | 'mousemove' | 'leave'
|
|
19
|
+
* @param {Array.<number>} [payload.x] x and y, which are mandatory, specify a point to
|
|
20
|
+
* trigger axisPointer and tooltip.
|
|
21
|
+
* @param {Array.<number>} [payload.y] x and y, which are mandatory, specify a point to
|
|
22
|
+
* trigger axisPointer and tooltip.
|
|
23
|
+
* @param {Object} [payload.seriesIndex] finder, optional, restrict target axes.
|
|
24
|
+
* @param {Object} [payload.dataIndex] finder, restrict target axes.
|
|
25
|
+
* @param {Object} [payload.axesInfo] finder, restrict target axes.
|
|
26
|
+
* [{
|
|
27
|
+
* axisDim: 'x'|'y'|'angle'|...,
|
|
28
|
+
* axisIndex: ...,
|
|
29
|
+
* value: ...
|
|
30
|
+
* }, ...]
|
|
31
|
+
* @param {Function} [payload.dispatchAction]
|
|
32
|
+
* @param {Object} [payload.tooltipOption]
|
|
33
|
+
* @param {Object|Array.<number>|Function} [payload.position] Tooltip position,
|
|
34
|
+
* which can be specified in dispatchAction
|
|
35
|
+
* @param {module:echarts/model/Global} ecModel
|
|
28
36
|
* @param {module:echarts/ExtensionAPI} api
|
|
29
|
-
* @param {Object} [tooltipOption]
|
|
30
37
|
* @return {Object} content of event obj for echarts.connect.
|
|
31
38
|
*/
|
|
32
|
-
function axisTrigger(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
function axisTrigger(payload, ecModel, api) {
|
|
40
|
+
var currTrigger = payload.currTrigger;
|
|
41
|
+
var point = [payload.x, payload.y];
|
|
42
|
+
var finder = payload;
|
|
43
|
+
var dispatchAction = payload.dispatchAction || zrUtil.bind(api.dispatchAction, api);
|
|
44
|
+
var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;
|
|
45
|
+
|
|
46
|
+
// Pending
|
|
47
|
+
// See #6121. But we are not able to reproduce it yet.
|
|
48
|
+
if (!coordSysAxesInfo) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
37
52
|
if (illegalPoint(point)) {
|
|
38
53
|
// Used in the default behavior of `connection`: use the sample seriesIndex
|
|
39
54
|
// and dataIndex. And also used in the tooltipView trigger.
|
|
@@ -107,7 +122,7 @@
|
|
|
107
122
|
});
|
|
108
123
|
|
|
109
124
|
updateModelActually(showValueMap, axesInfo, outputFinder);
|
|
110
|
-
dispatchTooltipActually(dataByCoordSys, point,
|
|
125
|
+
dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);
|
|
111
126
|
dispatchHighDownActually(axesInfo, dispatchAction, api);
|
|
112
127
|
|
|
113
128
|
return outputFinder;
|
|
@@ -290,7 +305,7 @@
|
|
|
290
305
|
});
|
|
291
306
|
}
|
|
292
307
|
|
|
293
|
-
function dispatchTooltipActually(dataByCoordSys, point,
|
|
308
|
+
function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {
|
|
294
309
|
// Basic logic: If no showTip required, hideTip will be dispatched.
|
|
295
310
|
if (illegalPoint(point) || !dataByCoordSys.list.length) {
|
|
296
311
|
dispatchAction({type: 'hideTip'});
|
|
@@ -308,7 +323,8 @@
|
|
|
308
323
|
escapeConnect: true,
|
|
309
324
|
x: point[0],
|
|
310
325
|
y: point[1],
|
|
311
|
-
tooltipOption: tooltipOption,
|
|
326
|
+
tooltipOption: payload.tooltipOption,
|
|
327
|
+
position: payload.position,
|
|
312
328
|
dataIndexInside: sampleItem.dataIndexInside,
|
|
313
329
|
dataIndex: sampleItem.dataIndex,
|
|
314
330
|
seriesIndex: sampleItem.seriesIndex,
|
|
@@ -182,10 +182,7 @@
|
|
|
182
182
|
// (cross style is dashed by default)
|
|
183
183
|
if (!triggerTooltip) {
|
|
184
184
|
var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');
|
|
185
|
-
crossStyle && zrUtil.defaults(
|
|
186
|
-
labelOption.textStyle || (labelOption.textStyle = {}),
|
|
187
|
-
crossStyle.textStyle
|
|
188
|
-
);
|
|
185
|
+
crossStyle && zrUtil.defaults(labelOption, crossStyle.textStyle);
|
|
189
186
|
}
|
|
190
187
|
}
|
|
191
188
|
|
|
@@ -202,10 +199,12 @@
|
|
|
202
199
|
// Notice this case: this coordSys is `cartesian2D` but not `grid`.
|
|
203
200
|
var coordSys = seriesModel.coordinateSystem;
|
|
204
201
|
var seriesTooltipTrigger = seriesModel.get('tooltip.trigger', true);
|
|
202
|
+
var seriesTooltipShow = seriesModel.get('tooltip.show', true);
|
|
205
203
|
if (!coordSys
|
|
206
204
|
|| seriesTooltipTrigger === 'none'
|
|
207
205
|
|| seriesTooltipTrigger === false
|
|
208
206
|
|| seriesTooltipTrigger === 'item'
|
|
207
|
+
|| seriesTooltipShow === false
|
|
209
208
|
|| seriesModel.get('axisPointer.show', true) === false
|
|
210
209
|
) {
|
|
211
210
|
return;
|
|
@@ -45,13 +45,10 @@
|
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
var labelModel = axisPointerModel.getModel('label');
|
|
48
|
-
var textStyleModel = labelModel.getModel('textStyle');
|
|
49
48
|
var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);
|
|
50
49
|
|
|
51
|
-
var font =
|
|
52
|
-
var textRect = textContain.getBoundingRect(
|
|
53
|
-
text, font, labelPos.textAlign, labelPos.textBaseline
|
|
54
|
-
);
|
|
50
|
+
var font = labelModel.getFont();
|
|
51
|
+
var textRect = textContain.getBoundingRect(text, font);
|
|
55
52
|
|
|
56
53
|
var position = labelPos.position;
|
|
57
54
|
var width = textRect.width + paddings[1] + paddings[3];
|
|
@@ -76,10 +73,11 @@
|
|
|
76
73
|
elOption.label = {
|
|
77
74
|
shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
|
|
78
75
|
position: position.slice(),
|
|
76
|
+
// TODO: rich
|
|
79
77
|
style: {
|
|
80
78
|
text: text,
|
|
81
79
|
textFont: font,
|
|
82
|
-
textFill:
|
|
80
|
+
textFill: labelModel.getTextColor(),
|
|
83
81
|
textPosition: 'inside',
|
|
84
82
|
fill: bgColor,
|
|
85
83
|
stroke: labelModel.get('borderColor') || 'transparent',
|
|
@@ -43,18 +43,5 @@
|
|
|
43
43
|
type: 'updateAxisPointer',
|
|
44
44
|
event: 'updateAxisPointer',
|
|
45
45
|
update: ':updateAxisPointer'
|
|
46
|
-
},
|
|
47
|
-
var outputFinder = axisTrigger(
|
|
48
|
-
ecModel.getComponent('axisPointer').coordSysAxesInfo,
|
|
49
|
-
payload.currTrigger,
|
|
50
|
-
[payload.x, payload.y],
|
|
51
|
-
payload,
|
|
52
|
-
payload.dispatchAction || zrUtil.bind(api.dispatchAction, api),
|
|
53
|
-
ecModel,
|
|
54
|
-
api,
|
|
55
|
-
payload.tooltipOption
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
return outputFinder;
|
|
59
|
-
});
|
|
46
|
+
}, axisTrigger);
|
|
60
47
|
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
width: sw,
|
|
101
101
|
height: sh
|
|
102
102
|
},
|
|
103
|
+
cursor: 'default',
|
|
103
104
|
style: itemRectStyleModel
|
|
104
105
|
});
|
|
105
106
|
|
|
@@ -225,25 +226,25 @@
|
|
|
225
226
|
|
|
226
227
|
},
|
|
227
228
|
|
|
228
|
-
_yearTextPositionControl: function (point, orient, position, margin) {
|
|
229
|
+
_yearTextPositionControl: function (textEl, point, orient, position, margin) {
|
|
229
230
|
|
|
230
231
|
point = point.slice();
|
|
231
232
|
var aligns = ['center', 'bottom'];
|
|
232
233
|
|
|
233
|
-
if (position === 'top') {
|
|
234
|
-
point[1] -= margin;
|
|
235
|
-
}
|
|
236
234
|
if (position === 'bottom') {
|
|
237
235
|
point[1] += margin;
|
|
238
236
|
aligns = ['center', 'top'];
|
|
239
237
|
}
|
|
240
|
-
if (position === 'left') {
|
|
238
|
+
else if (position === 'left') {
|
|
241
239
|
point[0] -= margin;
|
|
242
240
|
}
|
|
243
|
-
if (position === 'right') {
|
|
241
|
+
else if (position === 'right') {
|
|
244
242
|
point[0] += margin;
|
|
245
243
|
aligns = ['center', 'top'];
|
|
246
244
|
}
|
|
245
|
+
else { // top
|
|
246
|
+
point[1] -= margin;
|
|
247
|
+
}
|
|
247
248
|
|
|
248
249
|
var rotate = 0;
|
|
249
250
|
if (position === 'left' || position === 'right') {
|
|
@@ -252,10 +253,8 @@
|
|
|
252
253
|
|
|
253
254
|
return {
|
|
254
255
|
rotation: rotate,
|
|
255
|
-
|
|
256
|
+
position: point,
|
|
256
257
|
style: {
|
|
257
|
-
x: point[0],
|
|
258
|
-
y: point[1],
|
|
259
258
|
textAlign: aligns[0],
|
|
260
259
|
textVerticalAlign: aligns[1]
|
|
261
260
|
}
|
|
@@ -270,7 +269,6 @@
|
|
|
270
269
|
return;
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
var yearLabelStyleModel = calendarModel.getModel('yearLabel.textStyle');
|
|
274
272
|
var margin = yearLabel.get('margin');
|
|
275
273
|
var pos = yearLabel.get('position');
|
|
276
274
|
|
|
@@ -284,7 +282,6 @@
|
|
|
284
282
|
|
|
285
283
|
var idx = orient === 'horizontal' ? 0 : 1;
|
|
286
284
|
|
|
287
|
-
|
|
288
285
|
var posPoints = {
|
|
289
286
|
top: [xc, points[idx][1]],
|
|
290
287
|
bottom: [xc, points[1 - idx][1]],
|
|
@@ -308,16 +305,9 @@
|
|
|
308
305
|
|
|
309
306
|
var content = this._formatterLabel(formatter, params);
|
|
310
307
|
|
|
311
|
-
var yearText = new graphic.Text(
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
style: {
|
|
315
|
-
text: content,
|
|
316
|
-
font: yearLabelStyleModel.getFont(),
|
|
317
|
-
fill: yearLabelStyleModel.getTextColor()
|
|
318
|
-
}
|
|
319
|
-
}, this._yearTextPositionControl(posPoints[pos], orient, pos, margin))
|
|
320
|
-
);
|
|
308
|
+
var yearText = new graphic.Text({z2: 30});
|
|
309
|
+
graphic.setTextStyle(yearText.style, yearLabel, {text: content}),
|
|
310
|
+
yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
|
|
321
311
|
|
|
322
312
|
group.add(yearText);
|
|
323
313
|
},
|
|
@@ -367,7 +357,6 @@
|
|
|
367
357
|
return;
|
|
368
358
|
}
|
|
369
359
|
|
|
370
|
-
var monthLabelStyleModel = calendarModel.getModel('monthLabel.textStyle');
|
|
371
360
|
var nameMap = monthLabel.get('nameMap');
|
|
372
361
|
var margin = monthLabel.get('margin');
|
|
373
362
|
var pos = monthLabel.get('position');
|
|
@@ -406,14 +395,11 @@
|
|
|
406
395
|
|
|
407
396
|
var content = this._formatterLabel(formatter, params);
|
|
408
397
|
|
|
409
|
-
var monthText = new graphic.Text({
|
|
410
|
-
|
|
411
|
-
style:
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
fill: monthLabelStyleModel.getTextColor()
|
|
415
|
-
}, this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))
|
|
416
|
-
});
|
|
398
|
+
var monthText = new graphic.Text({z2: 30});
|
|
399
|
+
zrUtil.extend(
|
|
400
|
+
graphic.setTextStyle(monthText.style, monthLabel, {text: content}),
|
|
401
|
+
this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)
|
|
402
|
+
);
|
|
417
403
|
|
|
418
404
|
group.add(monthText);
|
|
419
405
|
}
|
|
@@ -452,7 +438,6 @@
|
|
|
452
438
|
}
|
|
453
439
|
|
|
454
440
|
var coordSys = calendarModel.coordinateSystem;
|
|
455
|
-
var dayLabelStyleModel = calendarModel.getModel('dayLabel.textStyle');
|
|
456
441
|
var pos = dayLabel.get('position');
|
|
457
442
|
var nameMap = dayLabel.get('nameMap');
|
|
458
443
|
var margin = dayLabel.get('margin');
|
|
@@ -482,14 +467,12 @@
|
|
|
482
467
|
var point = coordSys.dataToRect([tmpD.time], false).center;
|
|
483
468
|
var day = i;
|
|
484
469
|
day = Math.abs((i + firstDayOfWeek) % 7);
|
|
485
|
-
var weekText = new graphic.Text({
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
}, this._weekTextPositionControl(point, orient, pos, margin, cellSize))
|
|
492
|
-
});
|
|
470
|
+
var weekText = new graphic.Text({z2: 30});
|
|
471
|
+
|
|
472
|
+
zrUtil.extend(
|
|
473
|
+
graphic.setTextStyle(weekText.style, dayLabel, {text: nameMap[day]}),
|
|
474
|
+
this._weekTextPositionControl(point, orient, pos, margin, cellSize)
|
|
475
|
+
);
|
|
493
476
|
group.add(weekText);
|
|
494
477
|
}
|
|
495
478
|
}
|
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
var isCategoryAxis = axisModel.get('type') === 'category';
|
|
393
393
|
var axisDataLen = isCategoryAxis && (axisModel.get('data') || []).length;
|
|
394
394
|
|
|
395
|
-
if (min != null && min !== 'dataMin') {
|
|
395
|
+
if (min != null && min !== 'dataMin' && typeof min !== 'function') {
|
|
396
396
|
dataExtent[0] = min;
|
|
397
397
|
}
|
|
398
398
|
else if (isCategoryAxis) {
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
var max = axisModel.getMax(true);
|
|
403
|
-
if (max != null && max !== 'dataMax') {
|
|
403
|
+
if (max != null && max !== 'dataMax' && typeof max !== 'function') {
|
|
404
404
|
dataExtent[1] = max;
|
|
405
405
|
}
|
|
406
406
|
else if (isCategoryAxis) {
|
|
@@ -432,6 +432,7 @@
|
|
|
432
432
|
|
|
433
433
|
// [0, 500]: arbitrary value, guess axis extent.
|
|
434
434
|
var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);
|
|
435
|
+
precision = Math.min(precision, 20);
|
|
435
436
|
// isRestore or isFull
|
|
436
437
|
var useOrigin = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100);
|
|
437
438
|
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
minSpan: null, // 0 ~ 100
|
|
58
58
|
maxSpan: null, // 0 ~ 100
|
|
59
59
|
minValueSpan: null, // The range of dataZoom can not be smaller than that.
|
|
60
|
-
maxValueSpan: null
|
|
60
|
+
maxValueSpan: null, // The range of dataZoom can not be larger than that.
|
|
61
|
+
rangeMode: null // Array, can be 'value' or 'percent'.
|
|
61
62
|
},
|
|
62
63
|
|
|
63
64
|
/**
|
|
@@ -514,6 +515,7 @@
|
|
|
514
515
|
getRangePropMode: function () {
|
|
515
516
|
return this._rangePropMode.slice();
|
|
516
517
|
}
|
|
518
|
+
|
|
517
519
|
});
|
|
518
520
|
|
|
519
521
|
function retrieveRaw(option) {
|
|
@@ -528,14 +530,24 @@
|
|
|
528
530
|
}
|
|
529
531
|
|
|
530
532
|
function updateRangeUse(dataZoomModel, rawOption) {
|
|
533
|
+
var rangePropMode = dataZoomModel._rangePropMode;
|
|
534
|
+
var rangeModeInOption = dataZoomModel.get('rangeMode');
|
|
535
|
+
|
|
531
536
|
each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {
|
|
532
|
-
var
|
|
533
|
-
|
|
537
|
+
var percentSpecified = rawOption[names[0]] != null;
|
|
538
|
+
var valueSpecified = rawOption[names[1]] != null;
|
|
539
|
+
if (percentSpecified && !valueSpecified) {
|
|
534
540
|
rangePropMode[index] = 'percent';
|
|
535
541
|
}
|
|
536
|
-
else if (
|
|
542
|
+
else if (!percentSpecified && valueSpecified) {
|
|
537
543
|
rangePropMode[index] = 'value';
|
|
538
544
|
}
|
|
545
|
+
else if (rangeModeInOption) {
|
|
546
|
+
rangePropMode[index] = rangeModeInOption[index];
|
|
547
|
+
}
|
|
548
|
+
else if (percentSpecified) { // percentSpecified && valueSpecified
|
|
549
|
+
rangePropMode[index] = 'percent';
|
|
550
|
+
}
|
|
539
551
|
// else remain its original setting.
|
|
540
552
|
});
|
|
541
553
|
}
|
|
@@ -122,9 +122,11 @@
|
|
|
122
122
|
var directionInfo = getDirectionInfo[coordSysName](
|
|
123
123
|
null, [mouseX, mouseY], axisModel, controller, coordInfo
|
|
124
124
|
);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
var percentPoint = (
|
|
126
|
+
directionInfo.signal > 0
|
|
127
|
+
? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel)
|
|
128
|
+
: (directionInfo.pixel - directionInfo.pixelStart)
|
|
129
|
+
) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];
|
|
128
130
|
|
|
129
131
|
scale = Math.max(1 / scale, 0);
|
|
130
132
|
range[0] = (range[0] - percentPoint) * scale + percentPoint;
|