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
package/dist/extension/bmap.js
CHANGED
|
@@ -52,7 +52,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
52
52
|
/************************************************************************/
|
|
53
53
|
/******/ ([
|
|
54
54
|
/* 0 */
|
|
55
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
55
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
56
56
|
|
|
57
57
|
var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
58
58
|
* BMap component extension
|
|
@@ -83,19 +83,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
83
83
|
};
|
|
84
84
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
85
85
|
|
|
86
|
-
/***/ },
|
|
86
|
+
/***/ }),
|
|
87
87
|
/* 1 */
|
|
88
|
-
/***/ function(module, exports) {
|
|
88
|
+
/***/ (function(module, exports) {
|
|
89
89
|
|
|
90
90
|
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
|
|
91
91
|
|
|
92
|
-
/***/ },
|
|
92
|
+
/***/ }),
|
|
93
93
|
/* 2 */
|
|
94
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
94
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
95
95
|
|
|
96
96
|
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
|
97
97
|
|
|
98
98
|
var echarts = __webpack_require__(1);
|
|
99
|
+
var zrUtil = echarts.util;
|
|
99
100
|
|
|
100
101
|
function BMapCoordSys(bmap, api) {
|
|
101
102
|
this._bmap = bmap;
|
|
@@ -160,6 +161,38 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
160
161
|
return echarts.matrix.create();
|
|
161
162
|
};
|
|
162
163
|
|
|
164
|
+
BMapCoordSys.prototype.prepareCustoms = function (data) {
|
|
165
|
+
var rect = this.getViewRect();
|
|
166
|
+
return {
|
|
167
|
+
coordSys: {
|
|
168
|
+
// The name exposed to user is always 'cartesian2d' but not 'grid'.
|
|
169
|
+
type: 'bmap',
|
|
170
|
+
x: rect.x,
|
|
171
|
+
y: rect.y,
|
|
172
|
+
width: rect.width,
|
|
173
|
+
height: rect.height
|
|
174
|
+
},
|
|
175
|
+
api: {
|
|
176
|
+
coord: zrUtil.bind(this.dataToPoint, this),
|
|
177
|
+
size: zrUtil.bind(dataToCoordSize, this)
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
function dataToCoordSize(dataSize, dataItem) {
|
|
183
|
+
dataItem = dataItem || [0, 0];
|
|
184
|
+
return zrUtil.map([0, 1], function (dimIdx) {
|
|
185
|
+
var val = dataItem[dimIdx];
|
|
186
|
+
var halfSize = dataSize[dimIdx] / 2;
|
|
187
|
+
var p1 = [];
|
|
188
|
+
var p2 = [];
|
|
189
|
+
p1[dimIdx] = val - halfSize;
|
|
190
|
+
p2[dimIdx] = val + halfSize;
|
|
191
|
+
p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
|
|
192
|
+
return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
|
|
193
|
+
}, this);
|
|
194
|
+
}
|
|
195
|
+
|
|
163
196
|
var Overlay;
|
|
164
197
|
|
|
165
198
|
// For deciding which dimensions to use when creating list data
|
|
@@ -195,7 +228,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
195
228
|
|
|
196
229
|
// TODO Dispose
|
|
197
230
|
ecModel.eachComponent('bmap', function (bmapModel) {
|
|
198
|
-
var
|
|
231
|
+
var painter = api.getZr().painter;
|
|
232
|
+
var viewportRoot = painter.getViewportRoot();
|
|
199
233
|
if (typeof BMap === 'undefined') {
|
|
200
234
|
throw new Error('BMap api is not loaded');
|
|
201
235
|
}
|
|
@@ -222,6 +256,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
222
256
|
|
|
223
257
|
var overlay = new Overlay(viewportRoot);
|
|
224
258
|
bmap.addOverlay(overlay);
|
|
259
|
+
|
|
260
|
+
// Override
|
|
261
|
+
painter.getViewportRootOffset = function () {
|
|
262
|
+
return {offsetLeft: 0, offsetTop: 0};
|
|
263
|
+
};
|
|
225
264
|
}
|
|
226
265
|
var bmap = bmapModel.__bmap;
|
|
227
266
|
|
|
@@ -252,9 +291,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
252
291
|
return BMapCoordSys;
|
|
253
292
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
254
293
|
|
|
255
|
-
/***/ },
|
|
294
|
+
/***/ }),
|
|
256
295
|
/* 3 */
|
|
257
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
296
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
258
297
|
|
|
259
298
|
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
|
260
299
|
|
|
@@ -293,9 +332,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
293
332
|
});
|
|
294
333
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
295
334
|
|
|
296
|
-
/***/ },
|
|
335
|
+
/***/ }),
|
|
297
336
|
/* 4 */
|
|
298
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
337
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
299
338
|
|
|
300
339
|
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
|
301
340
|
|
|
@@ -385,7 +424,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
385
424
|
});
|
|
386
425
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
387
426
|
|
|
388
|
-
/***/ }
|
|
427
|
+
/***/ })
|
|
389
428
|
/******/ ])
|
|
390
429
|
});
|
|
391
430
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],e):"object"==typeof exports?exports.bmap=e(require("echarts")):(t.echarts=t.echarts||{},t.echarts.bmap=e(t.echarts))}(this,function(t){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){var n;n=function(t){return o(1).registerCoordinateSystem("bmap",o(2)),o(3),o(4),o(1).registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,e){e.eachComponent("bmap",function(t){var e=t.getBMap(),o=e.getCenter();t.setCenterAndZoom([o.lng,o.lat],e.getZoom())})}),{version:"1.0.0"}}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))},function(e,o){e.exports=t},function(t,e,o){var n;n=function(t){function e(t,e){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=new BMap.MercatorProjection}function n(t,e){return e=e||[0,0],a.map([0,1],function(o){var n=e[o],r=t[o]/2,i=[],a=[];return i[o]=n-r,a[o]=n+r,i[1-o]=a[1-o]=e[1-o],Math.abs(this.dataToPoint(i)[o]-this.dataToPoint(a)[o])},this)}function r(){function t(t){this._root=t}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(t){return t.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}var i=o(1),a=i.util;e.prototype.dimensions=["lng","lat"],e.prototype.setZoom=function(t){this._zoom=t},e.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))},e.prototype.setMapOffset=function(t){this._mapOffset=t},e.prototype.getBMap=function(){return this._bmap},e.prototype.dataToPoint=function(t){var e=new BMap.Point(t[0],t[1]),o=this._bmap.pointToOverlayPixel(e),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},e.prototype.pointToData=function(t){var e=this._mapOffset,t=this._bmap.overlayPixelToPoint({x:t[0]+e[0],y:t[1]+e[1]});return[t.lng,t.lat]},e.prototype.getViewRect=function(){var t=this._api;return new i.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},e.prototype.getRoamTransform=function(){return i.matrix.create()},e.prototype.prepareCustoms=function(t){var e=this.getViewRect();return{coordSys:{type:"bmap",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:a.bind(this.dataToPoint,this),size:a.bind(n,this)}}};var p;return e.dimensions=e.prototype.dimensions,e.create=function(t,o){var n,i=o.getDom();t.eachComponent("bmap",function(t){var a=o.getZr().painter,s=a.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(p=p||r(),n)throw new Error("Only one bmap component can exist");if(!t.__bmap){var c=i.querySelector(".ec-extension-bmap");c&&(s.style.left="0px",s.style.top="0px",i.removeChild(c)),c=document.createElement("div"),c.style.cssText="width:100%;height:100%",c.classList.add("ec-extension-bmap"),i.appendChild(c);var m=t.__bmap=new BMap.Map(c),f=new p(s);m.addOverlay(f),a.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var m=t.__bmap,d=t.get("center"),l=t.get("zoom");if(d&&l){var u=new BMap.Point(d[0],d[1]);m.centerAndZoom(u,l)}n=new e(m,o),n.setMapOffset(t.__mapOffset||[0,0]),n.setZoom(l),n.setCenter(d),t.coordinateSystem=n}),t.eachSeries(function(t){"bmap"===t.get("coordinateSystem")&&(t.coordinateSystem=n)})},e}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,o){var n;n=function(t){function e(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}return o(1).extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged:function(t,o){var n=this.option;return!(e(t,n.center)&&o===n.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},roam:!1}})}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))},function(t,e,o){var n;n=function(t){return o(1).extendComponentView({type:"bmap",render:function(t,e,o){function n(){r||o.dispatchAction({type:"bmapRoam"})}var r=!0,i=t.getBMap(),a=o.getZr().painter.getViewportRoot(),p=t.coordinateSystem,s=function(e,n){if(!r){var i=a.parentNode.parentNode.parentNode,s=[-parseInt(i.style.left,10)||0,-parseInt(i.style.top,10)||0];a.style.left=s[0]+"px",a.style.top=s[1]+"px",p.setMapOffset(s),t.__mapOffset=s,o.dispatchAction({type:"bmapRoam"})}};i.removeEventListener("moving",this._oldMoveHandler),i.removeEventListener("zoomend",this._oldZoomEndHandler),i.addEventListener("moving",s),i.addEventListener("zoomend",n),this._oldMoveHandler=s,this._oldZoomEndHandler=n;var c=t.get("roam");c&&"scale"!==c?i.enableDragging():i.disableDragging(),c&&"move"!==c?(i.enableScrollWheelZoom(),i.enableDoubleClickZoom(),i.enablePinchToZoom()):(i.disableScrollWheelZoom(),i.disableDoubleClickZoom(),i.disablePinchToZoom());var m=t.__mapStyle,f=t.get("mapStyle")||{},d=JSON.stringify(f);JSON.stringify(m)!==d&&(Object.keys(f).length&&i.setMapStyle(f),t.__mapStyle=JSON.parse(d)),r=!1}})}.call(e,o,e,t),!(void 0!==n&&(t.exports=n))}])});
|
|
@@ -52,7 +52,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
52
52
|
/************************************************************************/
|
|
53
53
|
/******/ ([
|
|
54
54
|
/* 0 */
|
|
55
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
55
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
56
56
|
|
|
57
57
|
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
|
58
58
|
var echarts = __webpack_require__(1);
|
|
@@ -64,18 +64,18 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
64
64
|
return echarts.dataTool;
|
|
65
65
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
66
66
|
|
|
67
|
-
/***/ },
|
|
67
|
+
/***/ }),
|
|
68
68
|
/* 1 */
|
|
69
|
-
/***/ function(module, exports) {
|
|
69
|
+
/***/ (function(module, exports) {
|
|
70
70
|
|
|
71
71
|
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
|
|
72
72
|
|
|
73
|
-
/***/ },
|
|
73
|
+
/***/ }),
|
|
74
74
|
/* 2 */,
|
|
75
75
|
/* 3 */,
|
|
76
76
|
/* 4 */,
|
|
77
77
|
/* 5 */
|
|
78
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
78
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
79
79
|
|
|
80
80
|
var __WEBPACK_AMD_DEFINE_RESULT__;// GEXF File Parser
|
|
81
81
|
// http://gexf.net/1.2draft/gexf-12draft-primer.pdf
|
|
@@ -282,9 +282,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
282
282
|
};
|
|
283
283
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
284
284
|
|
|
285
|
-
/***/ },
|
|
285
|
+
/***/ }),
|
|
286
286
|
/* 6 */
|
|
287
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
287
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
288
288
|
|
|
289
289
|
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
|
290
290
|
|
|
@@ -350,9 +350,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
350
350
|
|
|
351
351
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
352
352
|
|
|
353
|
-
/***/ },
|
|
353
|
+
/***/ }),
|
|
354
354
|
/* 7 */
|
|
355
|
-
/***/ function(module, exports, __webpack_require__) {
|
|
355
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
356
356
|
|
|
357
357
|
var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
|
358
358
|
* Copyright (c) 2010-2015, Michael Bostock
|
|
@@ -399,7 +399,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
399
399
|
|
|
400
400
|
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
401
401
|
|
|
402
|
-
/***/ }
|
|
402
|
+
/***/ })
|
|
403
403
|
/******/ ])
|
|
404
404
|
});
|
|
405
405
|
;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(function (require) {
|
|
2
2
|
|
|
3
3
|
var echarts = require('echarts');
|
|
4
|
+
var zrUtil = echarts.util;
|
|
4
5
|
|
|
5
6
|
function BMapCoordSys(bmap, api) {
|
|
6
7
|
this._bmap = bmap;
|
|
@@ -65,6 +66,38 @@ define(function (require) {
|
|
|
65
66
|
return echarts.matrix.create();
|
|
66
67
|
};
|
|
67
68
|
|
|
69
|
+
BMapCoordSys.prototype.prepareCustoms = function (data) {
|
|
70
|
+
var rect = this.getViewRect();
|
|
71
|
+
return {
|
|
72
|
+
coordSys: {
|
|
73
|
+
// The name exposed to user is always 'cartesian2d' but not 'grid'.
|
|
74
|
+
type: 'bmap',
|
|
75
|
+
x: rect.x,
|
|
76
|
+
y: rect.y,
|
|
77
|
+
width: rect.width,
|
|
78
|
+
height: rect.height
|
|
79
|
+
},
|
|
80
|
+
api: {
|
|
81
|
+
coord: zrUtil.bind(this.dataToPoint, this),
|
|
82
|
+
size: zrUtil.bind(dataToCoordSize, this)
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
function dataToCoordSize(dataSize, dataItem) {
|
|
88
|
+
dataItem = dataItem || [0, 0];
|
|
89
|
+
return zrUtil.map([0, 1], function (dimIdx) {
|
|
90
|
+
var val = dataItem[dimIdx];
|
|
91
|
+
var halfSize = dataSize[dimIdx] / 2;
|
|
92
|
+
var p1 = [];
|
|
93
|
+
var p2 = [];
|
|
94
|
+
p1[dimIdx] = val - halfSize;
|
|
95
|
+
p2[dimIdx] = val + halfSize;
|
|
96
|
+
p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
|
|
97
|
+
return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
|
|
98
|
+
}, this);
|
|
99
|
+
}
|
|
100
|
+
|
|
68
101
|
var Overlay;
|
|
69
102
|
|
|
70
103
|
// For deciding which dimensions to use when creating list data
|
|
@@ -100,7 +133,8 @@ define(function (require) {
|
|
|
100
133
|
|
|
101
134
|
// TODO Dispose
|
|
102
135
|
ecModel.eachComponent('bmap', function (bmapModel) {
|
|
103
|
-
var
|
|
136
|
+
var painter = api.getZr().painter;
|
|
137
|
+
var viewportRoot = painter.getViewportRoot();
|
|
104
138
|
if (typeof BMap === 'undefined') {
|
|
105
139
|
throw new Error('BMap api is not loaded');
|
|
106
140
|
}
|
|
@@ -127,6 +161,11 @@ define(function (require) {
|
|
|
127
161
|
|
|
128
162
|
var overlay = new Overlay(viewportRoot);
|
|
129
163
|
bmap.addOverlay(overlay);
|
|
164
|
+
|
|
165
|
+
// Override
|
|
166
|
+
painter.getViewportRootOffset = function () {
|
|
167
|
+
return {offsetLeft: 0, offsetTop: 0};
|
|
168
|
+
};
|
|
130
169
|
}
|
|
131
170
|
var bmap = bmapModel.__bmap;
|
|
132
171
|
|
package/index.blank.js
ADDED
package/index.common.js
CHANGED
|
@@ -10,7 +10,7 @@ require('./lib/chart/scatter');
|
|
|
10
10
|
require('./lib/component/graphic');
|
|
11
11
|
require('./lib/component/tooltip');
|
|
12
12
|
require('./lib/component/axisPointer');
|
|
13
|
-
require('./lib/component/
|
|
13
|
+
require('./lib/component/legendScroll');
|
|
14
14
|
|
|
15
15
|
require('./lib/component/grid');
|
|
16
16
|
require('./lib/component/title');
|
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ require('./lib/chart/custom');
|
|
|
28
28
|
|
|
29
29
|
require('./lib/component/graphic');
|
|
30
30
|
require('./lib/component/grid');
|
|
31
|
-
require('./lib/component/
|
|
31
|
+
require('./lib/component/legendScroll');
|
|
32
32
|
require('./lib/component/tooltip');
|
|
33
33
|
require('./lib/component/axisPointer');
|
|
34
34
|
require('./lib/component/polar');
|
|
@@ -15,13 +15,17 @@
|
|
|
15
15
|
{mainType: 'series', subType: seriesType, query: payload},
|
|
16
16
|
function (seriesModel) {
|
|
17
17
|
if (seriesModel[actionInfo.method]) {
|
|
18
|
-
seriesModel[actionInfo.method](
|
|
18
|
+
seriesModel[actionInfo.method](
|
|
19
|
+
payload.name,
|
|
20
|
+
payload.dataIndex
|
|
21
|
+
);
|
|
19
22
|
}
|
|
20
23
|
var data = seriesModel.getData();
|
|
21
24
|
// Create selected map
|
|
22
25
|
data.each(function (idx) {
|
|
23
26
|
var name = data.getName(idx);
|
|
24
|
-
selected[name] = seriesModel.isSelected(name)
|
|
27
|
+
selected[name] = seriesModel.isSelected(name)
|
|
28
|
+
|| false;
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
);
|
package/lib/chart/bar/BarView.js
CHANGED
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
|
|
181
181
|
function removeRect(dataIndex, animationModel, el) {
|
|
182
182
|
// Not show text when animating
|
|
183
|
-
el.style.text =
|
|
183
|
+
el.style.text = null;
|
|
184
184
|
graphic.updateProps(el, {
|
|
185
185
|
shape: {
|
|
186
186
|
width: 0
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
|
|
193
193
|
function removeSector(dataIndex, animationModel, el) {
|
|
194
194
|
// Not show text when animating
|
|
195
|
-
el.style.text =
|
|
195
|
+
el.style.text = null;
|
|
196
196
|
graphic.updateProps(el, {
|
|
197
197
|
shape: {
|
|
198
198
|
r: el.shape.r0
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
var itemStyleModel = itemModel.getModel('itemStyle.normal');
|
|
240
240
|
var hoverStyle = itemModel.getModel('itemStyle.emphasis').getBarItemStyle();
|
|
241
241
|
|
|
242
|
-
if (!isPolar
|
|
242
|
+
if (!isPolar) {
|
|
243
243
|
el.setShape('r', itemStyleModel.get('barBorderRadius') || 0);
|
|
244
244
|
}
|
|
245
245
|
|
|
@@ -251,6 +251,9 @@
|
|
|
251
251
|
itemStyleModel.getBarItemStyle()
|
|
252
252
|
));
|
|
253
253
|
|
|
254
|
+
var cursorStyle = itemModel.getShallow('cursor');
|
|
255
|
+
cursorStyle && el.attr('cursor', cursorStyle);
|
|
256
|
+
|
|
254
257
|
var labelPositionOutside = isHorizontal
|
|
255
258
|
? (layout.height > 0 ? 'bottom' : 'top')
|
|
256
259
|
: (layout.width > 0 ? 'left' : 'right');
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
barMinHeight: 0,
|
|
43
43
|
// 最小角度为0,仅对极坐标系下的柱状图有效
|
|
44
44
|
barMinAngle: 0,
|
|
45
|
+
// cursor: null,
|
|
45
46
|
|
|
46
47
|
// barMaxWidth: null,
|
|
47
48
|
// 默认自适应
|
|
@@ -56,10 +57,10 @@
|
|
|
56
57
|
// }
|
|
57
58
|
// },
|
|
58
59
|
itemStyle: {
|
|
59
|
-
normal: {
|
|
60
|
+
// normal: {
|
|
60
61
|
// color: '各异'
|
|
61
|
-
},
|
|
62
|
-
emphasis: {}
|
|
62
|
+
// },
|
|
63
|
+
// emphasis: {}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
});
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
symbolRepeatDirection: 'end', // 'end' means from 'start' to 'end'.
|
|
23
23
|
|
|
24
24
|
symbolClip: false,
|
|
25
|
-
symbolBoundingData: null,
|
|
25
|
+
symbolBoundingData: null, // Can be 60 or -40 or [-40, 60]
|
|
26
26
|
symbolPatternSize: 400, // 400 * 400 px
|
|
27
27
|
|
|
28
28
|
barGap: '-100%', // In most case, overlap is needed.
|
|
@@ -183,12 +183,28 @@
|
|
|
183
183
|
var symbolBoundingData = itemModel.get('symbolBoundingData');
|
|
184
184
|
var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());
|
|
185
185
|
var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));
|
|
186
|
+
var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);
|
|
187
|
+
var boundingLength;
|
|
186
188
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
if (zrUtil.isArray(symbolBoundingData)) {
|
|
190
|
+
var symbolBoundingExtent = [
|
|
191
|
+
convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,
|
|
192
|
+
convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx
|
|
193
|
+
];
|
|
194
|
+
symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());
|
|
195
|
+
boundingLength = symbolBoundingExtent[pxSignIdx];
|
|
196
|
+
}
|
|
197
|
+
else if (symbolBoundingData != null) {
|
|
198
|
+
boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;
|
|
199
|
+
}
|
|
200
|
+
else if (symbolRepeat) {
|
|
201
|
+
boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
boundingLength = layout[valueDim.wh];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
output.boundingLength = boundingLength;
|
|
192
208
|
|
|
193
209
|
if (symbolRepeat) {
|
|
194
210
|
output.repeatCutLength = layout[valueDim.wh];
|
|
@@ -197,6 +213,10 @@
|
|
|
197
213
|
output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;
|
|
198
214
|
}
|
|
199
215
|
|
|
216
|
+
function convertToCoordOnAxis(axis, value) {
|
|
217
|
+
return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));
|
|
218
|
+
}
|
|
219
|
+
|
|
200
220
|
// Support ['100%', '100%']
|
|
201
221
|
function prepareSymbolSize(
|
|
202
222
|
data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength,
|
|
@@ -405,7 +425,7 @@
|
|
|
405
425
|
path.__pictorialRepeatTimes = repeatTimes;
|
|
406
426
|
bundle.add(path);
|
|
407
427
|
|
|
408
|
-
var target = makeTarget(index
|
|
428
|
+
var target = makeTarget(index);
|
|
409
429
|
|
|
410
430
|
updateAttr(
|
|
411
431
|
path,
|
|
@@ -654,7 +674,7 @@
|
|
|
654
674
|
function removeBar(data, dataIndex, animationModel, bar) {
|
|
655
675
|
// Not show text when animating
|
|
656
676
|
var labelRect = bar.__pictorialBarRect;
|
|
657
|
-
labelRect && (labelRect.style.text =
|
|
677
|
+
labelRect && (labelRect.style.text = null);
|
|
658
678
|
|
|
659
679
|
var pathes = [];
|
|
660
680
|
eachPath(bar, function (path) {
|
|
@@ -713,6 +733,7 @@
|
|
|
713
733
|
// Because symbol provide setColor individually to set fill and stroke
|
|
714
734
|
var normalStyle = itemModel.getModel('itemStyle.normal').getItemStyle(['color']);
|
|
715
735
|
var hoverStyle = itemModel.getModel('itemStyle.emphasis').getItemStyle();
|
|
736
|
+
var cursorStyle = itemModel.getShallow('cursor');
|
|
716
737
|
|
|
717
738
|
eachPath(bar, function (path) {
|
|
718
739
|
// PENDING setColor should be before setStyle!!!
|
|
@@ -726,6 +747,7 @@
|
|
|
726
747
|
));
|
|
727
748
|
graphic.setHoverStyle(path, hoverStyle);
|
|
728
749
|
|
|
750
|
+
cursorStyle && (path.cursor = cursorStyle);
|
|
729
751
|
path.z2 = symbolMeta.z2;
|
|
730
752
|
});
|
|
731
753
|
|
package/lib/chart/bar/helper.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
var zrUtil = require('zrender/lib/core/util');
|
|
4
3
|
var graphic = require('../../util/graphic');
|
|
5
4
|
|
|
6
5
|
var helper = {};
|
|
@@ -11,38 +10,22 @@
|
|
|
11
10
|
var labelModel = itemModel.getModel('label.normal');
|
|
12
11
|
var hoverLabelModel = itemModel.getModel('label.emphasis');
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (hoverLabelModel.get('show')) {
|
|
29
|
-
setLabel(
|
|
30
|
-
hoverStyle, hoverLabelModel, color,
|
|
31
|
-
zrUtil.retrieve(
|
|
32
|
-
seriesModel.getFormattedLabel(dataIndex, 'emphasis'),
|
|
33
|
-
seriesModel.getRawValue(dataIndex)
|
|
34
|
-
),
|
|
35
|
-
labelPositionOutside
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
hoverStyle.text = '';
|
|
40
|
-
}
|
|
13
|
+
graphic.setLabelStyle(
|
|
14
|
+
normalStyle, hoverStyle, labelModel, hoverLabelModel,
|
|
15
|
+
{
|
|
16
|
+
labelFetcher: seriesModel,
|
|
17
|
+
labelDataIndex: dataIndex,
|
|
18
|
+
defaultText: seriesModel.getRawValue(dataIndex),
|
|
19
|
+
isRectText: true,
|
|
20
|
+
autoColor: color
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
fixPosition(normalStyle);
|
|
25
|
+
fixPosition(hoverStyle);
|
|
41
26
|
};
|
|
42
27
|
|
|
43
|
-
function
|
|
44
|
-
graphic.setText(style, model, color);
|
|
45
|
-
style.text = labelText;
|
|
28
|
+
function fixPosition(style, labelPositionOutside) {
|
|
46
29
|
if (style.textPosition === 'outside') {
|
|
47
30
|
style.textPosition = labelPositionOutside;
|
|
48
31
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var zrUtil = require('zrender/lib/core/util');
|
|
4
4
|
var retrieve = require('zrender/lib/core/util').retrieve;
|
|
5
5
|
var parsePercent = require('../../util/number').parsePercent;
|
|
6
|
+
var graphic = require('../../util/graphic');
|
|
6
7
|
|
|
7
8
|
module.exports = function (ecModel) {
|
|
8
9
|
|
|
@@ -33,6 +34,8 @@
|
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
var dataIndex = 0;
|
|
38
|
+
|
|
36
39
|
data.each([cDim].concat(vDims), function () {
|
|
37
40
|
var args = arguments;
|
|
38
41
|
var axisDimVal = args[0];
|
|
@@ -52,17 +55,44 @@
|
|
|
52
55
|
var highestPoint = getPoint(highestVal);
|
|
53
56
|
|
|
54
57
|
var whiskerEnds = [
|
|
55
|
-
[
|
|
56
|
-
|
|
58
|
+
[
|
|
59
|
+
subPixelOptimizePoint(highestPoint),
|
|
60
|
+
subPixelOptimizePoint(ocHighPoint)
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
subPixelOptimizePoint(lowestPoint),
|
|
64
|
+
subPixelOptimizePoint(ocLowPoint)
|
|
65
|
+
]
|
|
57
66
|
];
|
|
58
67
|
|
|
59
68
|
var bodyEnds = [];
|
|
60
69
|
addBodyEnd(ocHighPoint, 0);
|
|
61
70
|
addBodyEnd(ocLowPoint, 1);
|
|
62
71
|
|
|
72
|
+
var sign;
|
|
73
|
+
if (openVal > closeVal) {
|
|
74
|
+
sign = -1;
|
|
75
|
+
}
|
|
76
|
+
else if (openVal < closeVal) {
|
|
77
|
+
sign = 1;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// If close === open, compare with close of last record
|
|
81
|
+
if (dataIndex > 0) {
|
|
82
|
+
sign = data.getItemModel(dataIndex - 1).get()[2]
|
|
83
|
+
<= closeVal
|
|
84
|
+
? 1
|
|
85
|
+
: -1;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// No record of previous, set to be positive
|
|
89
|
+
sign = 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
63
93
|
data.setItemLayout(idx, {
|
|
64
94
|
chartLayout: chartLayout,
|
|
65
|
-
sign:
|
|
95
|
+
sign: sign,
|
|
66
96
|
initBaseline: openVal > closeVal
|
|
67
97
|
? ocHighPoint[constDim] : ocLowPoint[constDim], // open point.
|
|
68
98
|
bodyEnds: bodyEnds,
|
|
@@ -70,6 +100,8 @@
|
|
|
70
100
|
brushRect: makeBrushRect()
|
|
71
101
|
});
|
|
72
102
|
|
|
103
|
+
++dataIndex;
|
|
104
|
+
|
|
73
105
|
function getPoint(val) {
|
|
74
106
|
var p = [];
|
|
75
107
|
p[variableDim] = axisDimVal;
|
|
@@ -82,8 +114,14 @@
|
|
|
82
114
|
function addBodyEnd(point, start) {
|
|
83
115
|
var point1 = point.slice();
|
|
84
116
|
var point2 = point.slice();
|
|
85
|
-
|
|
86
|
-
|
|
117
|
+
|
|
118
|
+
point1[variableDim] = graphic.subPixelOptimize(
|
|
119
|
+
point1[variableDim] + candleWidth / 2, 1, false
|
|
120
|
+
);
|
|
121
|
+
point2[variableDim] = graphic.subPixelOptimize(
|
|
122
|
+
point2[variableDim] - candleWidth / 2, 1, true
|
|
123
|
+
);
|
|
124
|
+
|
|
87
125
|
start
|
|
88
126
|
? bodyEnds.push(point1, point2)
|
|
89
127
|
: bodyEnds.push(point2, point1);
|
|
@@ -104,6 +142,11 @@
|
|
|
104
142
|
};
|
|
105
143
|
}
|
|
106
144
|
|
|
145
|
+
function subPixelOptimizePoint(point) {
|
|
146
|
+
point[variableDim] = graphic.subPixelOptimize(point[variableDim], 1);
|
|
147
|
+
return point;
|
|
148
|
+
}
|
|
149
|
+
|
|
107
150
|
}, true);
|
|
108
151
|
});
|
|
109
152
|
};
|
|
@@ -132,5 +175,5 @@
|
|
|
132
175
|
? parsePercent(barWidth, bandWidth)
|
|
133
176
|
// Put max outer to ensure bar visible in spite of overlap.
|
|
134
177
|
: Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);
|
|
135
|
-
|
|
178
|
+
}
|
|
136
179
|
|