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
|
@@ -428,7 +428,7 @@ define(function (require) {
|
|
|
428
428
|
|
|
429
429
|
barGroup.add(displaybles.filler = new Rect({
|
|
430
430
|
draggable: true,
|
|
431
|
-
cursor:
|
|
431
|
+
cursor: getCursor(this._orient),
|
|
432
432
|
drift: bind(this._onDragMove, this, 'all'),
|
|
433
433
|
onmousemove: function (e) {
|
|
434
434
|
// Fot mobile devicem, prevent screen slider on the button.
|
|
@@ -461,38 +461,23 @@ define(function (require) {
|
|
|
461
461
|
}
|
|
462
462
|
})));
|
|
463
463
|
|
|
464
|
-
var iconStr = dataZoomModel.get('handleIcon');
|
|
465
464
|
each([0, 1], function (handleIndex) {
|
|
466
|
-
var
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
465
|
+
var path = graphic.createIcon(
|
|
466
|
+
dataZoomModel.get('handleIcon'),
|
|
467
|
+
{
|
|
468
|
+
cursor: getCursor(this._orient),
|
|
469
|
+
draggable: true,
|
|
470
|
+
drift: bind(this._onDragMove, this, handleIndex),
|
|
471
|
+
onmousemove: function (e) {
|
|
472
|
+
// Fot mobile devicem, prevent screen slider on the button.
|
|
473
|
+
eventTool.stop(e.event);
|
|
474
|
+
},
|
|
475
|
+
ondragend: bind(this._onDragEnd, this),
|
|
476
|
+
onmouseover: bind(this._showDataInfo, this, true),
|
|
477
|
+
onmouseout: bind(this._showDataInfo, this, false)
|
|
477
478
|
},
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
onmouseout: bind(this._showDataInfo, this, false)
|
|
481
|
-
};
|
|
482
|
-
var iconStyle = {x: -1, y: 0, width: 2, height: 2};
|
|
483
|
-
|
|
484
|
-
var path = iconStr.indexOf('image://') === 0
|
|
485
|
-
? (
|
|
486
|
-
iconStyle.image = iconStr.slice(8),
|
|
487
|
-
iconOpt.style = iconStyle,
|
|
488
|
-
new graphic.Image(iconOpt)
|
|
489
|
-
)
|
|
490
|
-
: graphic.makePath(
|
|
491
|
-
iconStr.replace('path://', ''),
|
|
492
|
-
iconOpt,
|
|
493
|
-
iconStyle,
|
|
494
|
-
'center'
|
|
495
|
-
);
|
|
479
|
+
{x: -1, y: 0, width: 2, height: 2}
|
|
480
|
+
);
|
|
496
481
|
|
|
497
482
|
var bRect = path.getBoundingRect();
|
|
498
483
|
this._handleHeight = numberUtil.parsePercent(dataZoomModel.get('handleSize'), this._size[1]);
|
|
@@ -517,7 +502,7 @@ define(function (require) {
|
|
|
517
502
|
x: 0, y: 0, text: '',
|
|
518
503
|
textVerticalAlign: 'middle',
|
|
519
504
|
textAlign: 'center',
|
|
520
|
-
|
|
505
|
+
textFill: textStyleModel.getTextColor(),
|
|
521
506
|
textFont: textStyleModel.getFont()
|
|
522
507
|
},
|
|
523
508
|
z2: 10
|
|
@@ -797,6 +782,10 @@ define(function (require) {
|
|
|
797
782
|
return map[thisDim];
|
|
798
783
|
}
|
|
799
784
|
|
|
785
|
+
function getCursor(orient) {
|
|
786
|
+
return orient === 'vertical' ? 'ns-resize' : 'ew-resize';
|
|
787
|
+
}
|
|
788
|
+
|
|
800
789
|
return SliderZoomView;
|
|
801
790
|
|
|
802
791
|
});
|
|
@@ -62,10 +62,13 @@ define(function(require) {
|
|
|
62
62
|
record.controller = createController(api, record);
|
|
63
63
|
record.dispatchAction = zrUtil.curry(dispatchAction, api);
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
|
|
66
|
+
// Update reference of dataZoom.
|
|
67
|
+
!(record.dataZoomInfos[theDataZoomId]) && record.count++;
|
|
68
|
+
record.dataZoomInfos[theDataZoomId] = dataZoomInfo;
|
|
69
|
+
|
|
70
|
+
var controllerParams = mergeControllerParams(record.dataZoomInfos);
|
|
71
|
+
record.controller.enable(controllerParams.controlType, controllerParams.opt);
|
|
69
72
|
|
|
70
73
|
// Consider resize, area should be always updated.
|
|
71
74
|
record.controller.setPointerChecker(dataZoomInfo.containsPoint);
|
|
@@ -77,10 +80,6 @@ define(function(require) {
|
|
|
77
80
|
dataZoomInfo.throttleRate,
|
|
78
81
|
'fixRate'
|
|
79
82
|
);
|
|
80
|
-
|
|
81
|
-
// Update reference of dataZoom.
|
|
82
|
-
!(record.dataZoomInfos[theDataZoomId]) && record.count++;
|
|
83
|
-
record.dataZoomInfos[theDataZoomId] = dataZoomInfo;
|
|
84
83
|
},
|
|
85
84
|
|
|
86
85
|
/**
|
|
@@ -170,7 +169,7 @@ define(function(require) {
|
|
|
170
169
|
|
|
171
170
|
zrUtil.each(record.dataZoomInfos, function (info) {
|
|
172
171
|
var range = getRange(info);
|
|
173
|
-
range && batch.push({
|
|
172
|
+
!info.disabled && range && batch.push({
|
|
174
173
|
dataZoomId: info.dataZoomId,
|
|
175
174
|
start: range[0],
|
|
176
175
|
end: range[1]
|
|
@@ -190,6 +189,31 @@ define(function(require) {
|
|
|
190
189
|
});
|
|
191
190
|
}
|
|
192
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Merge roamController settings when multiple dataZooms share one roamController.
|
|
194
|
+
*/
|
|
195
|
+
function mergeControllerParams(dataZoomInfos) {
|
|
196
|
+
var controlType;
|
|
197
|
+
var opt = {};
|
|
198
|
+
var typePriority = {
|
|
199
|
+
'true': 2,
|
|
200
|
+
'move': 1,
|
|
201
|
+
'false': 0,
|
|
202
|
+
'undefined': -1
|
|
203
|
+
};
|
|
204
|
+
zrUtil.each(dataZoomInfos, function (dataZoomInfo) {
|
|
205
|
+
var oneType = dataZoomInfo.disabled ? false : dataZoomInfo.zoomLock ? 'move' : true;
|
|
206
|
+
typePriority[oneType] > typePriority[controlType] && (controlType = oneType);
|
|
207
|
+
// Do not support that different 'shift'/'ctrl'/'alt' setting used in one coord sys.
|
|
208
|
+
zrUtil.extend(opt, dataZoomInfo.roamControllerOpt);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
return {
|
|
212
|
+
controlType: controlType,
|
|
213
|
+
opt: opt
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
193
217
|
return roams;
|
|
194
218
|
|
|
195
219
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
define(function (require) {
|
|
2
2
|
|
|
3
|
-
require('../../model/Component').registerSubTypeDefaulter('dataZoom', function (
|
|
3
|
+
require('../../model/Component').registerSubTypeDefaulter('dataZoom', function () {
|
|
4
4
|
// Default 'slider' when no type specified.
|
|
5
5
|
return 'slider';
|
|
6
6
|
});
|
package/src/component/graphic.js
CHANGED
|
@@ -274,11 +274,23 @@ define(function (require) {
|
|
|
274
274
|
var parentId = elOption.parentId;
|
|
275
275
|
var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;
|
|
276
276
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
if (elOption.type === 'text') {
|
|
278
|
+
var elOptionStyle = elOption.style;
|
|
279
|
+
|
|
280
|
+
// In top/bottom mode, textVerticalAlign should not be used, which cause
|
|
281
|
+
// inaccurately locating.
|
|
282
|
+
if (elOption.hv && elOption.hv[1]) {
|
|
283
|
+
elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Compatible with previous setting: both support fill and textFill,
|
|
287
|
+
// stroke and textStroke.
|
|
288
|
+
!elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && (
|
|
289
|
+
elOptionStyle.textFill = elOptionStyle.fill
|
|
290
|
+
);
|
|
291
|
+
!elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && (
|
|
292
|
+
elOptionStyle.textStroke = elOptionStyle.stroke
|
|
293
|
+
);
|
|
282
294
|
}
|
|
283
295
|
|
|
284
296
|
// Remove unnecessary props to avoid potential problems.
|
|
@@ -200,7 +200,7 @@ define(function(require) {
|
|
|
200
200
|
*
|
|
201
201
|
* @param {Object} area
|
|
202
202
|
* @param {Array} targetInfoList
|
|
203
|
-
* @return {
|
|
203
|
+
* @return {Object|boolean}
|
|
204
204
|
*/
|
|
205
205
|
proto.findTargetInfo = function (area, ecModel) {
|
|
206
206
|
var targetInfoList = this._targetInfoList;
|
|
@@ -123,8 +123,8 @@ define(function (require) {
|
|
|
123
123
|
|
|
124
124
|
var isGeo = mapOrGeoModel.mainType === 'geo';
|
|
125
125
|
|
|
126
|
-
//
|
|
127
|
-
//
|
|
126
|
+
// Map series has data. GEO model that controlled by map series
|
|
127
|
+
// will be assigned with map data. Other GEO model has no data.
|
|
128
128
|
var data = mapOrGeoModel.getData && mapOrGeoModel.getData();
|
|
129
129
|
isGeo && ecModel.eachComponent({mainType: 'series', subType: 'map'}, function (mapSeries) {
|
|
130
130
|
if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {
|
|
@@ -199,9 +199,6 @@ define(function (require) {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
var textStyleModel = labelModel.getModel('textStyle');
|
|
203
|
-
var hoverTextStyleModel = hoverLabelModel.getModel('textStyle');
|
|
204
|
-
|
|
205
202
|
zrUtil.each(region.geometries, function (geometry) {
|
|
206
203
|
if (geometry.type !== 'polygon') {
|
|
207
204
|
return;
|
|
@@ -238,29 +235,36 @@ define(function (require) {
|
|
|
238
235
|
(isGeo || isDataNaN && (showLabel || hoverShowLabel))
|
|
239
236
|
|| (itemLayout && itemLayout.showLabel)
|
|
240
237
|
) {
|
|
241
|
-
var query =
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
textVerticalAlign: 'middle'
|
|
251
|
-
},
|
|
252
|
-
hoverStyle: {
|
|
253
|
-
text: hoverShowLabel ? (hoverFormattedStr || region.name) : '',
|
|
254
|
-
fill: hoverTextStyleModel.getTextColor(),
|
|
255
|
-
textFont: hoverTextStyleModel.getFont()
|
|
256
|
-
},
|
|
238
|
+
var query = !isGeo ? dataIdx : region.name;
|
|
239
|
+
var labelFetcher;
|
|
240
|
+
|
|
241
|
+
// Consider dataIdx not found.
|
|
242
|
+
if (!data || dataIdx >= 0) {
|
|
243
|
+
labelFetcher = mapOrGeoModel;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
var textEl = new graphic.Text({
|
|
257
247
|
position: region.center.slice(),
|
|
258
248
|
scale: [1 / scale[0], 1 / scale[1]],
|
|
259
249
|
z2: 10,
|
|
260
250
|
silent: true
|
|
261
251
|
});
|
|
262
252
|
|
|
263
|
-
|
|
253
|
+
graphic.setLabelStyle(
|
|
254
|
+
textEl.style, textEl.hoverStyle = {}, labelModel, hoverLabelModel,
|
|
255
|
+
{
|
|
256
|
+
labelFetcher: labelFetcher,
|
|
257
|
+
labelDataIndex: query,
|
|
258
|
+
defaultText: region.name,
|
|
259
|
+
useInsideStyle: false
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
textAlign: 'center',
|
|
263
|
+
textVerticalAlign: 'middle'
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
regionGroup.add(textEl);
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
// setItemGraphicEl, setHoverStyle after all polygons and labels
|
|
@@ -113,7 +113,9 @@ define(function (require) {
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
function mousedown(e) {
|
|
116
|
-
if (
|
|
116
|
+
if (eventTool.notLeftMouse(e)
|
|
117
|
+
|| (e.target && e.target.draggable)
|
|
118
|
+
) {
|
|
117
119
|
return;
|
|
118
120
|
}
|
|
119
121
|
|
|
@@ -130,15 +132,12 @@ define(function (require) {
|
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
function mousemove(e) {
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (interactionMutex.isTaken(this._zr, 'globalPan')) {
|
|
135
|
+
if (eventTool.notLeftMouse(e)
|
|
136
|
+
|| !checkKeyBinding(this, 'moveOnMouseMove', e)
|
|
137
|
+
|| !this._dragging
|
|
138
|
+
|| e.gestureEvent === 'pinch'
|
|
139
|
+
|| interactionMutex.isTaken(this._zr, 'globalPan')
|
|
140
|
+
) {
|
|
142
141
|
return;
|
|
143
142
|
}
|
|
144
143
|
|
|
@@ -160,7 +159,9 @@ define(function (require) {
|
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
function mouseup(e) {
|
|
163
|
-
|
|
162
|
+
if (!eventTool.notLeftMouse(e)) {
|
|
163
|
+
this._dragging = false;
|
|
164
|
+
}
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
function mousewheel(e) {
|
|
@@ -4,17 +4,6 @@ define(function (require) {
|
|
|
4
4
|
var formatUtil = require('../../util/format');
|
|
5
5
|
var graphic = require('../../util/graphic');
|
|
6
6
|
|
|
7
|
-
function positionGroup(group, model, api) {
|
|
8
|
-
layout.positionElement(
|
|
9
|
-
group, model.getBoxLayoutParams(),
|
|
10
|
-
{
|
|
11
|
-
width: api.getWidth(),
|
|
12
|
-
height: api.getHeight()
|
|
13
|
-
},
|
|
14
|
-
model.get('padding')
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
7
|
return {
|
|
19
8
|
/**
|
|
20
9
|
* Layout list like component.
|
|
@@ -24,10 +13,16 @@ define(function (require) {
|
|
|
24
13
|
* @param {module:echarts/ExtensionAPI}
|
|
25
14
|
*/
|
|
26
15
|
layout: function (group, componentModel, api) {
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
var boxLayoutParams = componentModel.getBoxLayoutParams();
|
|
17
|
+
var padding = componentModel.get('padding');
|
|
18
|
+
var viewportSize = {width: api.getWidth(), height: api.getHeight()};
|
|
19
|
+
|
|
20
|
+
var rect = layout.getLayoutRect(
|
|
21
|
+
boxLayoutParams,
|
|
22
|
+
viewportSize,
|
|
23
|
+
padding
|
|
24
|
+
);
|
|
25
|
+
|
|
31
26
|
layout.box(
|
|
32
27
|
componentModel.get('orient'),
|
|
33
28
|
group,
|
|
@@ -36,30 +31,38 @@ define(function (require) {
|
|
|
36
31
|
rect.height
|
|
37
32
|
);
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
layout.positionElement(
|
|
35
|
+
group,
|
|
36
|
+
boxLayoutParams,
|
|
37
|
+
viewportSize,
|
|
38
|
+
padding
|
|
39
|
+
);
|
|
40
40
|
},
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
makeBackground: function (rect, componentModel) {
|
|
43
43
|
var padding = formatUtil.normalizeCssArray(
|
|
44
44
|
componentModel.get('padding')
|
|
45
45
|
);
|
|
46
|
-
var boundingRect = group.getBoundingRect();
|
|
47
46
|
var style = componentModel.getItemStyle(['color', 'opacity']);
|
|
48
47
|
style.fill = componentModel.get('backgroundColor');
|
|
49
48
|
var rect = new graphic.Rect({
|
|
50
49
|
shape: {
|
|
51
|
-
x:
|
|
52
|
-
y:
|
|
53
|
-
width:
|
|
54
|
-
height:
|
|
50
|
+
x: rect.x - padding[3],
|
|
51
|
+
y: rect.y - padding[0],
|
|
52
|
+
width: rect.width + padding[1] + padding[3],
|
|
53
|
+
height: rect.height + padding[0] + padding[2],
|
|
54
|
+
r: componentModel.get('borderRadius')
|
|
55
55
|
},
|
|
56
56
|
style: style,
|
|
57
57
|
silent: true,
|
|
58
58
|
z2: -1
|
|
59
59
|
});
|
|
60
|
-
|
|
60
|
+
// FIXME
|
|
61
|
+
// `subPixelOptimizeRect` may bring some gap between edge of viewpart
|
|
62
|
+
// and background rect when setting like `left: 0`, `top: 0`.
|
|
63
|
+
// graphic.subPixelOptimizeRect(rect);
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
return rect;
|
|
63
66
|
}
|
|
64
67
|
};
|
|
65
68
|
});
|
|
@@ -12,21 +12,28 @@ define(function (require) {
|
|
|
12
12
|
return {
|
|
13
13
|
|
|
14
14
|
updateSelectedMap: function (targetList) {
|
|
15
|
+
this._targetList = targetList.slice();
|
|
15
16
|
this._selectTargetMap = zrUtil.reduce(targetList || [], function (targetMap, target) {
|
|
16
17
|
targetMap.set(target.name, target);
|
|
17
18
|
return targetMap;
|
|
18
19
|
}, zrUtil.createHashMap());
|
|
19
20
|
},
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Either name or id should be passed as input here.
|
|
24
|
+
* If both of them are defined, id is used.
|
|
25
|
+
*
|
|
26
|
+
* @param {string|undefined} name name of data
|
|
27
|
+
* @param {number|undefined} id dataIndex of data
|
|
22
28
|
*/
|
|
23
29
|
// PENGING If selectedMode is null ?
|
|
24
|
-
select: function (name) {
|
|
25
|
-
var
|
|
26
|
-
|
|
30
|
+
select: function (name, id) {
|
|
31
|
+
var target = id != null
|
|
32
|
+
? this._targetList[id]
|
|
33
|
+
: this._selectTargetMap.get(name);
|
|
27
34
|
var selectedMode = this.get('selectedMode');
|
|
28
35
|
if (selectedMode === 'single') {
|
|
29
|
-
|
|
36
|
+
this._selectTargetMap.each(function (target) {
|
|
30
37
|
target.selected = false;
|
|
31
38
|
});
|
|
32
39
|
}
|
|
@@ -34,31 +41,49 @@ define(function (require) {
|
|
|
34
41
|
},
|
|
35
42
|
|
|
36
43
|
/**
|
|
37
|
-
*
|
|
44
|
+
* Either name or id should be passed as input here.
|
|
45
|
+
* If both of them are defined, id is used.
|
|
46
|
+
*
|
|
47
|
+
* @param {string|undefined} name name of data
|
|
48
|
+
* @param {number|undefined} id dataIndex of data
|
|
38
49
|
*/
|
|
39
|
-
unSelect: function (name) {
|
|
40
|
-
var target =
|
|
50
|
+
unSelect: function (name, id) {
|
|
51
|
+
var target = id != null
|
|
52
|
+
? this._targetList[id]
|
|
53
|
+
: this._selectTargetMap.get(name);
|
|
41
54
|
// var selectedMode = this.get('selectedMode');
|
|
42
55
|
// selectedMode !== 'single' && target && (target.selected = false);
|
|
43
56
|
target && (target.selected = false);
|
|
44
57
|
},
|
|
45
58
|
|
|
46
59
|
/**
|
|
47
|
-
*
|
|
60
|
+
* Either name or id should be passed as input here.
|
|
61
|
+
* If both of them are defined, id is used.
|
|
62
|
+
*
|
|
63
|
+
* @param {string|undefined} name name of data
|
|
64
|
+
* @param {number|undefined} id dataIndex of data
|
|
48
65
|
*/
|
|
49
|
-
toggleSelected: function (name) {
|
|
50
|
-
var target =
|
|
66
|
+
toggleSelected: function (name, id) {
|
|
67
|
+
var target = id != null
|
|
68
|
+
? this._targetList[id]
|
|
69
|
+
: this._selectTargetMap.get(name);
|
|
51
70
|
if (target != null) {
|
|
52
|
-
this[target.selected ? 'unSelect' : 'select'](name);
|
|
71
|
+
this[target.selected ? 'unSelect' : 'select'](name, id);
|
|
53
72
|
return target.selected;
|
|
54
73
|
}
|
|
55
74
|
},
|
|
56
75
|
|
|
57
76
|
/**
|
|
58
|
-
*
|
|
77
|
+
* Either name or id should be passed as input here.
|
|
78
|
+
* If both of them are defined, id is used.
|
|
79
|
+
*
|
|
80
|
+
* @param {string|undefined} name name of data
|
|
81
|
+
* @param {number|undefined} id dataIndex of data
|
|
59
82
|
*/
|
|
60
|
-
isSelected: function (name) {
|
|
61
|
-
var target =
|
|
83
|
+
isSelected: function (name, id) {
|
|
84
|
+
var target = id != null
|
|
85
|
+
? this._targetList[id]
|
|
86
|
+
: this._selectTargetMap.get(name);
|
|
62
87
|
return target && target.selected;
|
|
63
88
|
}
|
|
64
89
|
};
|
|
@@ -7,12 +7,19 @@ define(function(require) {
|
|
|
7
7
|
|
|
8
8
|
var LegendModel = require('../../echarts').extendComponentModel({
|
|
9
9
|
|
|
10
|
-
type: 'legend',
|
|
10
|
+
type: 'legend.plain',
|
|
11
11
|
|
|
12
12
|
dependencies: ['series'],
|
|
13
13
|
|
|
14
14
|
layoutMode: {
|
|
15
15
|
type: 'box',
|
|
16
|
+
// legend.width/height are maxWidth/maxHeight actually,
|
|
17
|
+
// whereas realy width/height is calculated by its content.
|
|
18
|
+
// (Setting {left: 10, right: 10} does not make sense).
|
|
19
|
+
// So consider the case:
|
|
20
|
+
// `setOption({legend: {left: 10});`
|
|
21
|
+
// then `setOption({legend: {right: 10});`
|
|
22
|
+
// The previous `left` should be cleared by setting `ignoreSize`.
|
|
16
23
|
ignoreSize: true
|
|
17
24
|
},
|
|
18
25
|
|
|
@@ -143,8 +150,8 @@ define(function(require) {
|
|
|
143
150
|
left: 'center',
|
|
144
151
|
// right: 'center',
|
|
145
152
|
|
|
146
|
-
top:
|
|
147
|
-
// bottom:
|
|
153
|
+
top: 0,
|
|
154
|
+
// bottom: null,
|
|
148
155
|
|
|
149
156
|
// 水平对齐
|
|
150
157
|
// 'auto' | 'left' | 'right'
|
|
@@ -154,6 +161,7 @@ define(function(require) {
|
|
|
154
161
|
backgroundColor: 'rgba(0,0,0,0)',
|
|
155
162
|
// 图例边框颜色
|
|
156
163
|
borderColor: '#ccc',
|
|
164
|
+
borderRadius: 0,
|
|
157
165
|
// 图例边框线宽,单位px,默认为0(无边框)
|
|
158
166
|
borderWidth: 0,
|
|
159
167
|
// 图例内边距,单位px,默认各方向内边距为5,
|