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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
define(function (require) {
|
|
2
2
|
|
|
3
3
|
var zrUtil = require('zrender/core/util');
|
|
4
|
+
var modelUtil = require('../../util/model');
|
|
5
|
+
|
|
6
|
+
var each = zrUtil.each;
|
|
7
|
+
var isObject = zrUtil.isObject;
|
|
4
8
|
|
|
5
9
|
var POSSIBLE_STYLES = [
|
|
6
10
|
'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',
|
|
@@ -9,68 +13,176 @@ define(function (require) {
|
|
|
9
13
|
|
|
10
14
|
function compatItemStyle(opt) {
|
|
11
15
|
var itemStyleOpt = opt && opt.itemStyle;
|
|
12
|
-
if (itemStyleOpt) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
normalItemStyleOpt[styleName] = null;
|
|
16
|
+
if (!itemStyleOpt) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {
|
|
20
|
+
var styleName = POSSIBLE_STYLES[i];
|
|
21
|
+
var normalItemStyleOpt = itemStyleOpt.normal;
|
|
22
|
+
var emphasisItemStyleOpt = itemStyleOpt.emphasis;
|
|
23
|
+
if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {
|
|
24
|
+
opt[styleName] = opt[styleName] || {};
|
|
25
|
+
if (!opt[styleName].normal) {
|
|
26
|
+
opt[styleName].normal = normalItemStyleOpt[styleName];
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
opt[styleName]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
else {
|
|
29
|
+
zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);
|
|
30
|
+
}
|
|
31
|
+
normalItemStyleOpt[styleName] = null;
|
|
32
|
+
}
|
|
33
|
+
if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {
|
|
34
|
+
opt[styleName] = opt[styleName] || {};
|
|
35
|
+
if (!opt[styleName].emphasis) {
|
|
36
|
+
opt[styleName].emphasis = emphasisItemStyleOpt[styleName];
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);
|
|
40
|
+
}
|
|
41
|
+
emphasisItemStyleOpt[styleName] = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function compatTextStyle(opt, propName) {
|
|
47
|
+
var labelOptSingle = isObject(opt) && opt[propName];
|
|
48
|
+
var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;
|
|
49
|
+
if (textStyle) {
|
|
50
|
+
for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {
|
|
51
|
+
var propName = modelUtil.TEXT_STYLE_OPTIONS[i];
|
|
52
|
+
if (textStyle.hasOwnProperty(propName)) {
|
|
53
|
+
labelOptSingle[propName] = textStyle[propName];
|
|
35
54
|
}
|
|
36
|
-
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function compatLabelTextStyle(labelOpt) {
|
|
60
|
+
if (isObject(labelOpt)) {
|
|
61
|
+
compatTextStyle(labelOpt, 'normal');
|
|
62
|
+
compatTextStyle(labelOpt, 'emphasis');
|
|
37
63
|
}
|
|
38
64
|
}
|
|
39
65
|
|
|
40
|
-
|
|
41
|
-
if (!seriesOpt) {
|
|
66
|
+
function processSeries(seriesOpt) {
|
|
67
|
+
if (!isObject(seriesOpt)) {
|
|
42
68
|
return;
|
|
43
69
|
}
|
|
70
|
+
|
|
44
71
|
compatItemStyle(seriesOpt);
|
|
45
|
-
|
|
72
|
+
compatLabelTextStyle(seriesOpt.label);
|
|
73
|
+
// treemap
|
|
74
|
+
compatLabelTextStyle(seriesOpt.upperLabel);
|
|
75
|
+
// graph
|
|
76
|
+
compatLabelTextStyle(seriesOpt.edgeLabel);
|
|
77
|
+
|
|
78
|
+
var markPoint = seriesOpt.markPoint;
|
|
79
|
+
compatItemStyle(markPoint);
|
|
80
|
+
compatLabelTextStyle(markPoint && markPoint.label);
|
|
81
|
+
|
|
82
|
+
var markLine = seriesOpt.markLine;
|
|
46
83
|
compatItemStyle(seriesOpt.markLine);
|
|
84
|
+
compatLabelTextStyle(markLine && markLine.label);
|
|
85
|
+
|
|
86
|
+
var markArea = seriesOpt.markArea;
|
|
87
|
+
compatLabelTextStyle(markArea && markArea.label);
|
|
88
|
+
|
|
89
|
+
// For gauge
|
|
90
|
+
compatTextStyle(seriesOpt, 'axisLabel');
|
|
91
|
+
compatTextStyle(seriesOpt, 'title');
|
|
92
|
+
compatTextStyle(seriesOpt, 'detail');
|
|
93
|
+
|
|
47
94
|
var data = seriesOpt.data;
|
|
48
95
|
if (data) {
|
|
49
96
|
for (var i = 0; i < data.length; i++) {
|
|
50
97
|
compatItemStyle(data[i]);
|
|
98
|
+
compatLabelTextStyle(data[i] && data[i].label);
|
|
51
99
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// mark point data
|
|
103
|
+
var markPoint = seriesOpt.markPoint;
|
|
104
|
+
if (markPoint && markPoint.data) {
|
|
105
|
+
var mpData = markPoint.data;
|
|
106
|
+
for (var i = 0; i < mpData.length; i++) {
|
|
107
|
+
compatItemStyle(mpData[i]);
|
|
108
|
+
compatLabelTextStyle(mpData[i] && mpData[i].label);
|
|
59
109
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
110
|
+
}
|
|
111
|
+
// mark line data
|
|
112
|
+
var markLine = seriesOpt.markLine;
|
|
113
|
+
if (markLine && markLine.data) {
|
|
114
|
+
var mlData = markLine.data;
|
|
115
|
+
for (var i = 0; i < mlData.length; i++) {
|
|
116
|
+
if (zrUtil.isArray(mlData[i])) {
|
|
117
|
+
compatItemStyle(mlData[i][0]);
|
|
118
|
+
compatLabelTextStyle(mlData[i][0] && mlData[i][0].label);
|
|
119
|
+
compatItemStyle(mlData[i][1]);
|
|
120
|
+
compatLabelTextStyle(mlData[i][1] && mlData[i][1].label);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
compatItemStyle(mlData[i]);
|
|
124
|
+
compatLabelTextStyle(mlData[i] && mlData[i].label);
|
|
72
125
|
}
|
|
73
126
|
}
|
|
74
127
|
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function toArr(o) {
|
|
131
|
+
return zrUtil.isArray(o) ? o : o ? [o] : [];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function toObj(o) {
|
|
135
|
+
return (zrUtil.isArray(o) ? o[0] : o) || {};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return function (option, isTheme) {
|
|
139
|
+
each(toArr(option.series), function (seriesOpt) {
|
|
140
|
+
isObject(seriesOpt) && processSeries(seriesOpt);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];
|
|
144
|
+
isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');
|
|
145
|
+
|
|
146
|
+
each(
|
|
147
|
+
axes,
|
|
148
|
+
function (axisName) {
|
|
149
|
+
each(toArr(option[axisName]), function (axisOpt) {
|
|
150
|
+
if (axisOpt) {
|
|
151
|
+
compatTextStyle(axisOpt, 'axisLabel');
|
|
152
|
+
compatTextStyle(axisOpt.axisPointer, 'label');
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
each(toArr(option.parallel), function (parallelOpt) {
|
|
159
|
+
var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;
|
|
160
|
+
compatTextStyle(parallelAxisDefault, 'axisLabel');
|
|
161
|
+
compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
each(toArr(option.calendar), function (calendarOpt) {
|
|
165
|
+
compatTextStyle(calendarOpt, 'dayLabel');
|
|
166
|
+
compatTextStyle(calendarOpt, 'monthLabel');
|
|
167
|
+
compatTextStyle(calendarOpt, 'yearLabel');
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// radar.name.textStyle
|
|
171
|
+
each(toArr(option.radar), function (radarOpt) {
|
|
172
|
+
compatTextStyle(radarOpt, 'name');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
each(toArr(option.geo), function (geoOpt) {
|
|
176
|
+
if (isObject(geoOpt)) {
|
|
177
|
+
compatLabelTextStyle(geoOpt.label);
|
|
178
|
+
each(toArr(geoOpt.regions), function (regionObj) {
|
|
179
|
+
compatLabelTextStyle(regionObj.label);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
compatLabelTextStyle(toObj(option.timeline).label);
|
|
185
|
+
compatTextStyle(toObj(option.axisPointer), 'label');
|
|
186
|
+
compatTextStyle(toObj(option.tooltip).axisPointer, 'label');
|
|
75
187
|
};
|
|
76
188
|
});
|
package/src/scale/Interval.js
CHANGED
|
@@ -58,6 +58,8 @@ define(function (require) {
|
|
|
58
58
|
// Dropped auto calculated niceExtent and use user setted extent
|
|
59
59
|
// We assume user wan't to set both interval, min, max to get a better result
|
|
60
60
|
this._niceExtent = this._extent.slice();
|
|
61
|
+
|
|
62
|
+
this._intervalPrecision = helper.getIntervalPrecision(interval);
|
|
61
63
|
},
|
|
62
64
|
|
|
63
65
|
/**
|
|
@@ -115,8 +117,9 @@ define(function (require) {
|
|
|
115
117
|
*
|
|
116
118
|
* @param {number} [splitNumber = 5] Desired number of ticks
|
|
117
119
|
* @param {number} [minInterval]
|
|
120
|
+
* @param {number} [maxInterval]
|
|
118
121
|
*/
|
|
119
|
-
niceTicks: function (splitNumber, minInterval) {
|
|
122
|
+
niceTicks: function (splitNumber, minInterval, maxInterval) {
|
|
120
123
|
splitNumber = splitNumber || 5;
|
|
121
124
|
var extent = this._extent;
|
|
122
125
|
var span = extent[1] - extent[0];
|
|
@@ -130,7 +133,9 @@ define(function (require) {
|
|
|
130
133
|
extent.reverse();
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
var result = helper.intervalScaleNiceTicks(
|
|
136
|
+
var result = helper.intervalScaleNiceTicks(
|
|
137
|
+
extent, splitNumber, minInterval, maxInterval
|
|
138
|
+
);
|
|
134
139
|
|
|
135
140
|
this._intervalPrecision = result.intervalPrecision;
|
|
136
141
|
this._interval = result.interval;
|
|
@@ -143,7 +148,8 @@ define(function (require) {
|
|
|
143
148
|
* @param {number} [opt.splitNumber = 5] Given approx tick number
|
|
144
149
|
* @param {boolean} [opt.fixMin=false]
|
|
145
150
|
* @param {boolean} [opt.fixMax=false]
|
|
146
|
-
* @param {boolean} [opt.minInterval
|
|
151
|
+
* @param {boolean} [opt.minInterval]
|
|
152
|
+
* @param {boolean} [opt.maxInterval]
|
|
147
153
|
*/
|
|
148
154
|
niceExtent: function (opt) {
|
|
149
155
|
var extent = this._extent;
|
|
@@ -176,7 +182,7 @@ define(function (require) {
|
|
|
176
182
|
extent[1] = 1;
|
|
177
183
|
}
|
|
178
184
|
|
|
179
|
-
this.niceTicks(opt.splitNumber, opt.minInterval);
|
|
185
|
+
this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);
|
|
180
186
|
|
|
181
187
|
// var extent = this._extent;
|
|
182
188
|
var interval = this._interval;
|
package/src/scale/Time.js
CHANGED
|
@@ -77,11 +77,11 @@ define(function (require) {
|
|
|
77
77
|
// If there are no data and extent are [Infinity, -Infinity]
|
|
78
78
|
if (extent[1] === -Infinity && extent[0] === Infinity) {
|
|
79
79
|
var d = new Date();
|
|
80
|
-
extent[1] = new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
80
|
+
extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
81
81
|
extent[0] = extent[1] - ONE_DAY;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
this.niceTicks(opt.splitNumber);
|
|
84
|
+
this.niceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);
|
|
85
85
|
|
|
86
86
|
// var extent = this._extent;
|
|
87
87
|
var interval = this._interval;
|
|
@@ -97,14 +97,20 @@ define(function (require) {
|
|
|
97
97
|
/**
|
|
98
98
|
* @override
|
|
99
99
|
*/
|
|
100
|
-
niceTicks: function (approxTickNum) {
|
|
101
|
-
var timezoneOffset = this.getSetting('useUTC')
|
|
102
|
-
? 0 : numberUtil.getTimezoneOffset() * 60 * 1000;
|
|
100
|
+
niceTicks: function (approxTickNum, minInterval, maxInterval) {
|
|
103
101
|
approxTickNum = approxTickNum || 10;
|
|
104
102
|
|
|
105
103
|
var extent = this._extent;
|
|
106
104
|
var span = extent[1] - extent[0];
|
|
107
105
|
var approxInterval = span / approxTickNum;
|
|
106
|
+
|
|
107
|
+
if (minInterval != null && approxInterval < minInterval) {
|
|
108
|
+
approxInterval = minInterval;
|
|
109
|
+
}
|
|
110
|
+
if (maxInterval != null && approxInterval > maxInterval) {
|
|
111
|
+
approxInterval = maxInterval;
|
|
112
|
+
}
|
|
113
|
+
|
|
108
114
|
var scaleLevelsLen = scaleLevels.length;
|
|
109
115
|
var idx = bisect(scaleLevels, approxInterval, 0, scaleLevelsLen);
|
|
110
116
|
|
|
@@ -121,9 +127,11 @@ define(function (require) {
|
|
|
121
127
|
interval *= yearStep;
|
|
122
128
|
}
|
|
123
129
|
|
|
130
|
+
var timezoneOffset = this.getSetting('useUTC')
|
|
131
|
+
? 0 : (new Date(+extent[0] || +extent[1])).getTimezoneOffset() * 60 * 1000;
|
|
124
132
|
var niceExtent = [
|
|
125
133
|
Math.round(mathCeil((extent[0] - timezoneOffset) / interval) * interval + timezoneOffset),
|
|
126
|
-
Math.round(mathFloor((extent[1] - timezoneOffset)/ interval) * interval + timezoneOffset)
|
|
134
|
+
Math.round(mathFloor((extent[1] - timezoneOffset) / interval) * interval + timezoneOffset)
|
|
127
135
|
];
|
|
128
136
|
|
|
129
137
|
scaleHelper.fixExtent(niceExtent, extent);
|
package/src/scale/helper.js
CHANGED
|
@@ -14,9 +14,10 @@ define(function (require) {
|
|
|
14
14
|
* Should be extent[0] < extent[1].
|
|
15
15
|
* @param {number} splitNumber splitNumber should be >= 1.
|
|
16
16
|
* @param {number} [minInterval]
|
|
17
|
+
* @param {number} [maxInterval]
|
|
17
18
|
* @return {Object} {interval, intervalPrecision, niceTickExtent}
|
|
18
19
|
*/
|
|
19
|
-
helper.intervalScaleNiceTicks = function (extent, splitNumber, minInterval) {
|
|
20
|
+
helper.intervalScaleNiceTicks = function (extent, splitNumber, minInterval, maxInterval) {
|
|
20
21
|
var result = {};
|
|
21
22
|
var span = extent[1] - extent[0];
|
|
22
23
|
|
|
@@ -24,8 +25,11 @@ define(function (require) {
|
|
|
24
25
|
if (minInterval != null && interval < minInterval) {
|
|
25
26
|
interval = result.interval = minInterval;
|
|
26
27
|
}
|
|
28
|
+
if (maxInterval != null && interval > maxInterval) {
|
|
29
|
+
interval = result.interval = maxInterval;
|
|
30
|
+
}
|
|
27
31
|
// Tow more digital for tick.
|
|
28
|
-
var precision = result.intervalPrecision =
|
|
32
|
+
var precision = result.intervalPrecision = helper.getIntervalPrecision(interval);
|
|
29
33
|
// Niced extent inside original extent
|
|
30
34
|
var niceTickExtent = result.niceTickExtent = [
|
|
31
35
|
roundNumber(Math.ceil(extent[0] / interval) * interval, precision),
|
|
@@ -37,6 +41,15 @@ define(function (require) {
|
|
|
37
41
|
return result;
|
|
38
42
|
};
|
|
39
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @param {number} interval
|
|
46
|
+
* @return {number} interval precision
|
|
47
|
+
*/
|
|
48
|
+
helper.getIntervalPrecision = function (interval) {
|
|
49
|
+
// Tow more digital for tick.
|
|
50
|
+
return numberUtil.getPrecisionSafe(interval) + 2;
|
|
51
|
+
};
|
|
52
|
+
|
|
40
53
|
function clamp(niceTickExtent, idx, extent) {
|
|
41
54
|
niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);
|
|
42
55
|
}
|
package/src/util/format.js
CHANGED
|
@@ -37,29 +37,7 @@ define(function (require) {
|
|
|
37
37
|
return str;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
* Normalize css liked array configuration
|
|
42
|
-
* e.g.
|
|
43
|
-
* 3 => [3, 3, 3, 3]
|
|
44
|
-
* [4, 2] => [4, 2, 4, 2]
|
|
45
|
-
* [4, 3, 2] => [4, 3, 2, 3]
|
|
46
|
-
* @param {number|Array.<number>} val
|
|
47
|
-
*/
|
|
48
|
-
formatUtil.normalizeCssArray = function (val) {
|
|
49
|
-
var len = val.length;
|
|
50
|
-
if (typeof (val) === 'number') {
|
|
51
|
-
return [val, val, val, val];
|
|
52
|
-
}
|
|
53
|
-
else if (len === 2) {
|
|
54
|
-
// vertical | horizontal
|
|
55
|
-
return [val[0], val[1], val[0], val[1]];
|
|
56
|
-
}
|
|
57
|
-
else if (len === 3) {
|
|
58
|
-
// top | horizontal | bottom
|
|
59
|
-
return [val[0], val[1], val[2], val[1]];
|
|
60
|
-
}
|
|
61
|
-
return val;
|
|
62
|
-
};
|
|
40
|
+
formatUtil.normalizeCssArray = zrUtil.normalizeCssArray;
|
|
63
41
|
|
|
64
42
|
var encodeHTML = formatUtil.encodeHTML = function (source) {
|
|
65
43
|
return String(source)
|
|
@@ -180,7 +158,7 @@ define(function (require) {
|
|
|
180
158
|
var s = date['get' + utc + 'Seconds']();
|
|
181
159
|
|
|
182
160
|
tpl = tpl.replace('MM', s2d(M))
|
|
183
|
-
.
|
|
161
|
+
.replace('M', M)
|
|
184
162
|
.replace('yyyy', y)
|
|
185
163
|
.replace('yy', y % 100)
|
|
186
164
|
.replace('dd', s2d(d))
|
|
@@ -206,5 +184,7 @@ define(function (require) {
|
|
|
206
184
|
|
|
207
185
|
formatUtil.truncateText = textContain.truncateText;
|
|
208
186
|
|
|
187
|
+
formatUtil.getTextRect = textContain.getBoundingRect;
|
|
188
|
+
|
|
209
189
|
return formatUtil;
|
|
210
190
|
});
|