echarts 4.5.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- package/.gitattributes +3 -0
- package/.github/pull_request_template.md +66 -0
- package/.github/workflows/nodejs.yml +15 -3
- package/.huskyrc +5 -0
- package/CONTRIBUTING.md +16 -160
- package/NOTICE +1 -1
- package/README.md +3 -3
- package/asset/.DS_Store +0 -0
- package/build/.DS_Store +0 -0
- package/dist/echarts-en.common.js +3072 -1261
- package/dist/echarts-en.common.min.js +1 -1
- package/dist/echarts-en.js +4339 -1685
- package/dist/echarts-en.js.map +1 -1
- package/dist/echarts-en.min.js +1 -1
- package/dist/echarts-en.simple.js +2496 -1011
- package/dist/echarts-en.simple.min.js +1 -1
- package/dist/echarts.common.js +3046 -1261
- package/dist/echarts.common.min.js +1 -1
- package/dist/echarts.js +4313 -1685
- package/dist/echarts.js.map +1 -1
- package/dist/echarts.min.js +1 -1
- package/dist/echarts.simple.js +2470 -1011
- package/dist/echarts.simple.min.js +1 -1
- package/dist/extension/bmap.js +33 -11
- package/dist/extension/bmap.js.map +1 -1
- package/dist/extension/bmap.min.js +1 -1
- package/dist/extension/dataTool.js.map +1 -1
- package/extension/.DS_Store +0 -0
- package/extension/bmap/BMapCoordSys.js +14 -4
- package/extension/bmap/BMapModel.js +4 -0
- package/extension/bmap/BMapView.js +18 -10
- package/extension-src/bmap/BMapCoordSys.js +14 -4
- package/extension-src/bmap/BMapModel.js +6 -1
- package/extension-src/bmap/BMapView.js +16 -9
- package/lib/chart/bar/BarSeries.js +14 -1
- package/lib/chart/bar/BarView.js +196 -18
- package/lib/chart/bar/BaseBarSeries.js +3 -1
- package/lib/chart/bar/PictorialBarSeries.js +1 -1
- package/lib/chart/candlestick/candlestickVisual.js +1 -1
- package/lib/chart/effectScatter/EffectScatterSeries.js +3 -1
- package/lib/chart/funnel/FunnelSeries.js +14 -5
- package/lib/chart/funnel/funnelLayout.js +162 -46
- package/lib/chart/gauge/GaugeSeries.js +0 -2
- package/lib/chart/graph/GraphSeries.js +23 -7
- package/lib/chart/graph/GraphView.js +30 -12
- package/lib/chart/graph/circularLayoutHelper.js +8 -2
- package/lib/chart/graph/forceLayout.js +6 -1
- package/lib/chart/graph/simpleLayout.js +1 -1
- package/lib/chart/graph/simpleLayoutHelper.js +10 -4
- package/lib/chart/heatmap/HeatmapView.js +4 -4
- package/lib/chart/helper/EffectLine.js +23 -1
- package/lib/chart/helper/EffectSymbol.js +2 -1
- package/lib/chart/helper/Line.js +129 -42
- package/lib/chart/helper/LineDraw.js +5 -1
- package/lib/chart/helper/Symbol.js +2 -3
- package/lib/chart/helper/createClipPathFromCoordSys.js +4 -1
- package/lib/chart/helper/createListFromArray.js +14 -8
- package/lib/chart/helper/createRenderPlanner.js +6 -3
- package/lib/chart/helper/multipleGraphEdgeHelper.js +258 -0
- package/lib/chart/helper/whiskerBoxCommon.js +22 -16
- package/lib/chart/line/LineSeries.js +3 -1
- package/lib/chart/line/LineView.js +41 -2
- package/lib/chart/lines/LinesSeries.js +0 -2
- package/lib/chart/map/MapSeries.js +14 -5
- package/lib/chart/pie/PieSeries.js +27 -6
- package/lib/chart/pie/PieView.js +22 -15
- package/lib/chart/pie/labelLayout.js +102 -19
- package/lib/chart/pie/pieLayout.js +19 -7
- package/lib/chart/radar/RadarSeries.js +27 -6
- package/lib/chart/radar/RadarView.js +3 -1
- package/lib/chart/sankey/SankeySeries.js +13 -1
- package/lib/chart/sankey/SankeyView.js +70 -32
- package/lib/chart/sankey/sankeyLayout.js +22 -3
- package/lib/chart/scatter/ScatterSeries.js +3 -1
- package/lib/chart/sunburst/SunburstPiece.js +5 -1
- package/lib/chart/sunburst/SunburstSeries.js +29 -12
- package/lib/chart/sunburst/SunburstView.js +5 -1
- package/lib/chart/themeRiver/ThemeRiverSeries.js +24 -33
- package/lib/chart/tree/TreeSeries.js +20 -3
- package/lib/chart/tree/TreeView.js +149 -23
- package/lib/chart/treemap/TreemapSeries.js +25 -4
- package/lib/chart/treemap/TreemapView.js +80 -38
- package/lib/chart/treemap/treemapLayout.js +1 -1
- package/lib/chart/treemap/treemapVisual.js +9 -15
- package/lib/component/axis/AngleAxisView.js +64 -7
- package/lib/component/axis/AxisBuilder.js +62 -24
- package/lib/component/axis/CartesianAxisView.js +52 -85
- package/lib/component/axis/RadiusAxisView.js +36 -4
- package/lib/component/axis/SingleAxisView.js +21 -6
- package/lib/component/axis/axisSplitHelper.js +132 -0
- package/lib/component/axisPointer/axisTrigger.js +1 -1
- package/lib/component/brush/BrushView.js +11 -1
- package/lib/component/brush/visualEncoding.js +13 -2
- package/lib/component/dataZoom/SliderZoomView.js +4 -10
- package/lib/component/helper/BrushController.js +33 -43
- package/lib/component/helper/MapDraw.js +30 -4
- package/lib/component/legend/LegendModel.js +3 -3
- package/lib/component/legend/LegendView.js +17 -13
- package/lib/component/legend/ScrollableLegendView.js +18 -18
- package/lib/component/marker/MarkAreaView.js +53 -15
- package/lib/component/marker/MarkLineModel.js +2 -1
- package/lib/component/marker/MarkLineView.js +3 -0
- package/lib/component/marker/MarkPointView.js +8 -1
- package/lib/component/marker/MarkerModel.js +3 -2
- package/lib/component/marker/markerHelper.js +7 -4
- package/lib/component/timeline/SliderTimelineView.js +7 -1
- package/lib/component/title.js +6 -2
- package/lib/component/toolbox/ToolboxView.js +5 -1
- package/lib/component/toolbox/feature/DataView.js +23 -8
- package/lib/component/toolbox/feature/DataZoom.js +6 -6
- package/lib/component/toolbox/feature/MagicType.js +20 -14
- package/lib/component/toolbox/feature/SaveAsImage.js +4 -2
- package/lib/component/tooltip/TooltipContent.js +101 -30
- package/lib/component/tooltip/TooltipRichContent.js +56 -8
- package/lib/component/tooltip/TooltipView.js +11 -12
- package/lib/component/visualMap/PiecewiseModel.js +3 -6
- package/lib/component/visualMap/VisualMapModel.js +1 -1
- package/lib/coord/Axis.js +30 -2
- package/lib/coord/View.js +9 -0
- package/lib/coord/axisDefault.js +22 -3
- package/lib/coord/axisHelper.js +24 -18
- package/lib/coord/calendar/Calendar.js +8 -4
- package/lib/coord/geo/GeoModel.js +2 -1
- package/lib/coord/geo/geoJSONLoader.js +3 -2
- package/lib/coord/geo/geoSourceManager.js +3 -2
- package/lib/coord/geo/parseGeoJson.js +3 -2
- package/lib/coord/radar/Radar.js +5 -5
- package/lib/data/DataDimensionInfo.js +157 -0
- package/lib/data/Graph.js +1 -6
- package/lib/data/List.js +26 -20
- package/lib/data/Tree.js +5 -42
- package/lib/data/helper/completeDimensions.js +43 -32
- package/lib/data/helper/createDimensions.js +2 -0
- package/lib/data/helper/sourceHelper.js +214 -114
- package/lib/echarts.js +57 -34
- package/lib/langEN.js +26 -0
- package/lib/layout/barGrid.js +19 -13
- package/lib/layout/barPolar.js +1 -6
- package/lib/loading/default.js +43 -27
- package/lib/model/Series.js +4 -4
- package/lib/model/referHelper.js +40 -12
- package/lib/processor/dataSample.js +1 -1
- package/lib/scale/Interval.js +87 -2
- package/lib/scale/Log.js +9 -2
- package/lib/scale/helper.js +1 -43
- package/lib/stream/Scheduler.js +10 -2
- package/lib/theme/dark.js +3 -0
- package/lib/util/format.js +19 -2
- package/lib/util/graphic.js +14 -12
- package/lib/visual/LegendVisualProvider.js +75 -0
- package/lib/visual/VisualMapping.js +1 -1
- package/lib/visual/dataColor.js +2 -12
- package/lib/visual/seriesColor.js +15 -7
- package/lib/visual/symbol.js +12 -2
- package/map/.DS_Store +0 -0
- package/map/js/.DS_Store +0 -0
- package/map/js/china.js +1 -1
- package/map/js/province/.DS_Store +0 -0
- package/map/js/province/chongqing.js +1 -1
- package/map/js/province/gansu.js +2 -2
- package/map/js/province/tianjin.js +1 -28
- package/map/json/.DS_Store +0 -0
- package/map/json/china.json +1 -1
- package/map/json/province/chongqing.json +1 -1
- package/map/json/province/tianjin.json +1 -1
- package/package.json +12 -6
- package/src/.DS_Store +0 -0
- package/src/chart/.DS_Store +0 -0
- package/src/chart/bar/BarSeries.js +15 -1
- package/src/chart/bar/BarView.js +198 -17
- package/src/chart/bar/BaseBarSeries.js +1 -1
- package/src/chart/bar/PictorialBarSeries.js +2 -2
- package/src/chart/candlestick/candlestickVisual.js +1 -1
- package/src/chart/effectScatter/EffectScatterSeries.js +1 -1
- package/src/chart/funnel/FunnelSeries.js +11 -4
- package/src/chart/funnel/funnelLayout.js +179 -53
- package/src/chart/gauge/GaugeSeries.js +0 -1
- package/src/chart/graph/GraphSeries.js +19 -7
- package/src/chart/graph/GraphView.js +28 -10
- package/src/chart/graph/circularLayoutHelper.js +8 -2
- package/src/chart/graph/forceLayout.js +7 -1
- package/src/chart/graph/simpleLayout.js +1 -1
- package/src/chart/graph/simpleLayoutHelper.js +12 -5
- package/src/chart/heatmap/HeatmapView.js +4 -4
- package/src/chart/helper/EffectLine.js +23 -1
- package/src/chart/helper/EffectSymbol.js +2 -1
- package/src/chart/helper/Line.js +122 -37
- package/src/chart/helper/LineDraw.js +5 -1
- package/src/chart/helper/Symbol.js +4 -4
- package/src/chart/helper/createClipPathFromCoordSys.js +4 -0
- package/src/chart/helper/createGraphFromNodeEdge.js +2 -1
- package/src/chart/helper/createListFromArray.js +13 -8
- package/src/chart/helper/createRenderPlanner.js +5 -2
- package/src/chart/helper/multipleGraphEdgeHelper.js +229 -0
- package/src/chart/helper/whiskerBoxCommon.js +21 -16
- package/src/chart/line/LineSeries.js +1 -1
- package/src/chart/line/LineView.js +45 -1
- package/src/chart/lines/LinesSeries.js +1 -3
- package/src/chart/map/MapSeries.js +11 -5
- package/src/chart/pie/PieSeries.js +26 -5
- package/src/chart/pie/PieView.js +20 -15
- package/src/chart/pie/labelLayout.js +114 -22
- package/src/chart/pie/pieLayout.js +20 -7
- package/src/chart/radar/RadarSeries.js +31 -6
- package/src/chart/radar/RadarView.js +4 -2
- package/src/chart/sankey/SankeySeries.js +12 -1
- package/src/chart/sankey/SankeyView.js +75 -30
- package/src/chart/sankey/sankeyLayout.js +25 -5
- package/src/chart/scatter/ScatterSeries.js +1 -1
- package/src/chart/sunburst/SunburstPiece.js +7 -1
- package/src/chart/sunburst/SunburstSeries.js +28 -15
- package/src/chart/sunburst/SunburstView.js +2 -1
- package/src/chart/themeRiver/ThemeRiverSeries.js +25 -30
- package/src/chart/tree/TreeSeries.js +19 -6
- package/src/chart/tree/TreeView.js +156 -23
- package/src/chart/treemap/TreemapSeries.js +23 -5
- package/src/chart/treemap/TreemapView.js +77 -41
- package/src/chart/treemap/treemapLayout.js +2 -2
- package/src/chart/treemap/treemapVisual.js +8 -25
- package/src/component/axis/AngleAxisView.js +75 -7
- package/src/component/axis/AxisBuilder.js +77 -32
- package/src/component/axis/CartesianAxisView.js +47 -83
- package/src/component/axis/RadiusAxisView.js +37 -4
- package/src/component/axis/SingleAxisView.js +21 -4
- package/src/component/axis/axisSplitHelper.js +114 -0
- package/src/component/axisPointer/axisTrigger.js +1 -1
- package/src/component/brush/BrushView.js +8 -1
- package/src/component/brush/visualEncoding.js +6 -3
- package/src/component/dataZoom/SliderZoomView.js +4 -9
- package/src/component/helper/BrushController.js +40 -47
- package/src/component/helper/MapDraw.js +27 -4
- package/src/component/legend/LegendModel.js +3 -3
- package/src/component/legend/LegendView.js +18 -12
- package/src/component/legend/ScrollableLegendView.js +18 -16
- package/src/component/marker/MarkAreaView.js +53 -15
- package/src/component/marker/MarkLineModel.js +2 -1
- package/src/component/marker/MarkLineView.js +3 -1
- package/src/component/marker/MarkPointView.js +7 -1
- package/src/component/marker/MarkerModel.js +3 -2
- package/src/component/marker/markerHelper.js +8 -5
- package/src/component/timeline/SliderTimelineView.js +9 -6
- package/src/component/title.js +4 -3
- package/src/component/toolbox/.DS_Store +0 -0
- package/src/component/toolbox/ToolboxView.js +5 -0
- package/src/component/toolbox/feature/DataView.js +20 -8
- package/src/component/toolbox/feature/DataZoom.js +6 -6
- package/src/component/toolbox/feature/MagicType.js +19 -13
- package/src/component/toolbox/feature/SaveAsImage.js +4 -2
- package/src/component/tooltip/TooltipContent.js +94 -28
- package/src/component/tooltip/TooltipRichContent.js +52 -9
- package/src/component/tooltip/TooltipView.js +14 -12
- package/src/component/visualMap/PiecewiseModel.js +5 -9
- package/src/component/visualMap/VisualMapModel.js +1 -1
- package/src/coord/Axis.js +29 -2
- package/src/coord/View.js +10 -1
- package/src/coord/axisDefault.js +26 -2
- package/src/coord/axisHelper.js +30 -21
- package/src/coord/calendar/Calendar.js +12 -5
- package/src/coord/geo/GeoModel.js +3 -6
- package/src/coord/geo/geoJSONLoader.js +3 -2
- package/src/coord/geo/geoSourceManager.js +3 -2
- package/src/coord/geo/parseGeoJson.js +3 -2
- package/src/coord/radar/Radar.js +6 -8
- package/src/data/DataDimensionInfo.js +135 -0
- package/src/data/Graph.js +0 -5
- package/src/data/List.js +30 -17
- package/src/data/Tree.js +6 -39
- package/src/data/helper/completeDimensions.js +49 -30
- package/src/data/helper/createDimensions.js +2 -0
- package/src/data/helper/sourceHelper.js +216 -124
- package/src/echarts.js +60 -36
- package/src/langEN.js +26 -0
- package/src/layout/barGrid.js +22 -10
- package/src/layout/barPolar.js +4 -6
- package/src/loading/default.js +46 -34
- package/src/model/.DS_Store +0 -0
- package/src/model/Series.js +4 -4
- package/src/model/referHelper.js +34 -11
- package/src/preprocessor/.DS_Store +0 -0
- package/src/processor/dataSample.js +1 -1
- package/src/scale/Interval.js +84 -4
- package/src/scale/Log.js +9 -2
- package/src/scale/helper.js +1 -39
- package/src/stream/Scheduler.js +9 -1
- package/src/theme/dark.js +3 -0
- package/src/util/.DS_Store +0 -0
- package/src/util/format.js +17 -1
- package/src/util/graphic.js +13 -11
- package/src/visual/LegendVisualProvider.js +55 -0
- package/src/visual/VisualMapping.js +1 -1
- package/src/visual/dataColor.js +0 -13
- package/src/visual/seriesColor.js +13 -7
- package/src/visual/symbol.js +11 -2
- package/theme/.DS_Store +0 -0
- package/theme/azul.js +163 -0
- package/theme/bee-inspired.js +178 -0
- package/theme/blue.js +178 -0
- package/theme/caravan.js +178 -0
- package/theme/carp.js +163 -0
- package/theme/cool.js +180 -0
- package/theme/dark-blue.js +168 -0
- package/theme/dark-bold.js +168 -0
- package/theme/dark-digerati.js +168 -0
- package/theme/dark-fresh-cut.js +168 -0
- package/theme/dark-mushroom.js +168 -0
- package/theme/dark.js +69 -62
- package/theme/eduardo.js +178 -0
- package/theme/forest.js +163 -0
- package/theme/fresh-cut.js +163 -0
- package/theme/fruit.js +178 -0
- package/theme/gray.js +220 -0
- package/theme/green.js +222 -0
- package/theme/helianthus.js +263 -0
- package/theme/infographic.js +72 -57
- package/theme/inspired.js +163 -0
- package/theme/jazz.js +163 -0
- package/theme/london.js +163 -0
- package/theme/macarons.js +80 -57
- package/theme/macarons2.js +251 -0
- package/theme/mint.js +155 -0
- package/theme/red-velvet.js +163 -0
- package/theme/red.js +225 -0
- package/theme/roma.js +55 -22
- package/theme/royal.js +163 -0
- package/theme/sakura.js +140 -0
- package/theme/shine.js +52 -45
- package/theme/tech-blue.js +180 -0
- package/theme/vintage.js +37 -23
|
@@ -83,7 +83,11 @@ DataZoom.defaultOption = {
|
|
|
83
83
|
back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'
|
|
84
84
|
},
|
|
85
85
|
// `zoom`, `back`
|
|
86
|
-
title: zrUtil.clone(dataZoomLang.title)
|
|
86
|
+
title: zrUtil.clone(dataZoomLang.title),
|
|
87
|
+
brushStyle: {
|
|
88
|
+
borderWidth: 0,
|
|
89
|
+
color: 'rgba(0,0,0,0.2)'
|
|
90
|
+
}
|
|
87
91
|
};
|
|
88
92
|
var proto = DataZoom.prototype;
|
|
89
93
|
|
|
@@ -243,11 +247,7 @@ function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {
|
|
|
243
247
|
return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect';
|
|
244
248
|
})).enableBrush(zoomActive ? {
|
|
245
249
|
brushType: 'auto',
|
|
246
|
-
brushStyle:
|
|
247
|
-
// FIXME user customized?
|
|
248
|
-
lineWidth: 0,
|
|
249
|
-
fill: 'rgba(0,0,0,0.2)'
|
|
250
|
-
}
|
|
250
|
+
brushStyle: featureModel.getModel('brushStyle').getItemStyle()
|
|
251
251
|
} : false);
|
|
252
252
|
}
|
|
253
253
|
|
|
@@ -45,6 +45,7 @@ var featureManager = require("../featureManager");
|
|
|
45
45
|
* under the License.
|
|
46
46
|
*/
|
|
47
47
|
var magicTypeLang = lang.toolbox.magicType;
|
|
48
|
+
var INNER_STACK_KEYWORD = '__ec_magicType_stack__';
|
|
48
49
|
|
|
49
50
|
function MagicType(model) {
|
|
50
51
|
this.model = model;
|
|
@@ -58,9 +59,8 @@ MagicType.defaultOption = {
|
|
|
58
59
|
/* eslint-disable */
|
|
59
60
|
line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',
|
|
60
61
|
bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',
|
|
61
|
-
stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z'
|
|
62
|
-
|
|
63
|
-
tiled: 'M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z'
|
|
62
|
+
stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z' // jshint ignore:line
|
|
63
|
+
|
|
64
64
|
/* eslint-enable */
|
|
65
65
|
|
|
66
66
|
},
|
|
@@ -111,23 +111,18 @@ var seriesOptGenreator = {
|
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
'stack': function (seriesType, seriesId, seriesModel, model) {
|
|
114
|
+
var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;
|
|
115
|
+
|
|
114
116
|
if (seriesType === 'line' || seriesType === 'bar') {
|
|
117
|
+
model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');
|
|
115
118
|
return zrUtil.merge({
|
|
116
119
|
id: seriesId,
|
|
117
|
-
stack: '
|
|
120
|
+
stack: isStack ? '' : INNER_STACK_KEYWORD
|
|
118
121
|
}, model.get('option.stack') || {}, true);
|
|
119
122
|
}
|
|
120
|
-
},
|
|
121
|
-
'tiled': function (seriesType, seriesId, seriesModel, model) {
|
|
122
|
-
if (seriesType === 'line' || seriesType === 'bar') {
|
|
123
|
-
return zrUtil.merge({
|
|
124
|
-
id: seriesId,
|
|
125
|
-
stack: ''
|
|
126
|
-
}, model.get('option.tiled') || {}, true);
|
|
127
|
-
}
|
|
128
123
|
}
|
|
129
124
|
};
|
|
130
|
-
var radioTypes = [['line', 'bar'], ['stack'
|
|
125
|
+
var radioTypes = [['line', 'bar'], ['stack']];
|
|
131
126
|
|
|
132
127
|
proto.onclick = function (ecModel, api, type) {
|
|
133
128
|
var model = this.model;
|
|
@@ -192,10 +187,21 @@ proto.onclick = function (ecModel, api, type) {
|
|
|
192
187
|
seriesIndex: seriesIndex
|
|
193
188
|
}
|
|
194
189
|
}, generateNewSeriesTypes);
|
|
190
|
+
var newTitle; // Change title of stack
|
|
191
|
+
|
|
192
|
+
if (type === 'stack') {
|
|
193
|
+
var isStack = newOption.series && newOption.series[0] && newOption.series[0].stack === INNER_STACK_KEYWORD;
|
|
194
|
+
newTitle = isStack ? zrUtil.merge({
|
|
195
|
+
stack: magicTypeLang.title.tiled
|
|
196
|
+
}, magicTypeLang.title) : zrUtil.clone(magicTypeLang.title);
|
|
197
|
+
}
|
|
198
|
+
|
|
195
199
|
api.dispatchAction({
|
|
196
200
|
type: 'changeMagicType',
|
|
197
201
|
currentType: type,
|
|
198
|
-
newOption: newOption
|
|
202
|
+
newOption: newOption,
|
|
203
|
+
newTitle: newTitle,
|
|
204
|
+
featureName: 'magicType'
|
|
199
205
|
});
|
|
200
206
|
};
|
|
201
207
|
|
|
@@ -69,7 +69,8 @@ var proto = SaveAsImage.prototype;
|
|
|
69
69
|
proto.onclick = function (ecModel, api) {
|
|
70
70
|
var model = this.model;
|
|
71
71
|
var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';
|
|
72
|
-
var
|
|
72
|
+
var isSvg = api.getZr().painter.getType() === 'svg';
|
|
73
|
+
var type = isSvg ? 'svg' : model.get('type', true) || 'png';
|
|
73
74
|
var url = api.getConnectedDataURL({
|
|
74
75
|
type: type,
|
|
75
76
|
backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff',
|
|
@@ -84,7 +85,8 @@ proto.onclick = function (ecModel, api) {
|
|
|
84
85
|
$a.target = '_blank';
|
|
85
86
|
$a.href = url;
|
|
86
87
|
var evt = new MouseEvent('click', {
|
|
87
|
-
|
|
88
|
+
// some micro front-end framework, window maybe is a Proxy
|
|
89
|
+
view: document.defaultView,
|
|
88
90
|
bubbles: true,
|
|
89
91
|
cancelable: false
|
|
90
92
|
});
|
|
@@ -24,6 +24,8 @@ var zrColor = require("zrender/lib/tool/color");
|
|
|
24
24
|
|
|
25
25
|
var eventUtil = require("zrender/lib/core/event");
|
|
26
26
|
|
|
27
|
+
var domUtil = require("zrender/lib/core/dom");
|
|
28
|
+
|
|
27
29
|
var env = require("zrender/lib/core/env");
|
|
28
30
|
|
|
29
31
|
var formatUtil = require("../../util/format");
|
|
@@ -76,7 +78,18 @@ function assembleFont(textStyleModel) {
|
|
|
76
78
|
var color = textStyleModel.getTextColor();
|
|
77
79
|
color && cssText.push('color:' + color);
|
|
78
80
|
cssText.push('font:' + textStyleModel.getFont());
|
|
79
|
-
|
|
81
|
+
var lineHeight = textStyleModel.get('lineHeight');
|
|
82
|
+
|
|
83
|
+
if (lineHeight == null) {
|
|
84
|
+
lineHeight = Math.round(fontSize * 3 / 2);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
fontSize && cssText.push('line-height:' + lineHeight + 'px');
|
|
88
|
+
var shadowColor = textStyleModel.get('textShadowColor');
|
|
89
|
+
var shadowBlur = textStyleModel.get('textShadowBlur') || 0;
|
|
90
|
+
var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;
|
|
91
|
+
var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;
|
|
92
|
+
shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor);
|
|
80
93
|
each(['decoration', 'align'], function (name) {
|
|
81
94
|
var val = textStyleModel.get(name);
|
|
82
95
|
val && cssText.push('text-' + name + ':' + val);
|
|
@@ -124,24 +137,70 @@ function assembleCssText(tooltipModel) {
|
|
|
124
137
|
}
|
|
125
138
|
|
|
126
139
|
return cssText.join(';') + ';';
|
|
140
|
+
} // If not able to make, do not modify the input `out`.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
function makeStyleCoord(out, zr, appendToBody, zrX, zrY) {
|
|
144
|
+
var zrPainter = zr && zr.painter;
|
|
145
|
+
|
|
146
|
+
if (appendToBody) {
|
|
147
|
+
var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();
|
|
148
|
+
|
|
149
|
+
if (zrViewportRoot) {
|
|
150
|
+
// Some APPs might use scale on body, so we support CSS transform here.
|
|
151
|
+
domUtil.transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
out[0] = zrX;
|
|
155
|
+
out[1] = zrY; // xy should be based on canvas root. But tooltipContent is
|
|
156
|
+
// the sibling of canvas root. So padding of ec container
|
|
157
|
+
// should be considered here.
|
|
158
|
+
|
|
159
|
+
var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();
|
|
160
|
+
|
|
161
|
+
if (viewportRootOffset) {
|
|
162
|
+
out[0] += viewportRootOffset.offsetLeft;
|
|
163
|
+
out[1] += viewportRootOffset.offsetTop;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
out[2] = out[0] / zr.getWidth(); // The ratio of left to width
|
|
168
|
+
|
|
169
|
+
out[3] = out[1] / zr.getHeight(); // The ratio of top to height
|
|
127
170
|
}
|
|
128
171
|
/**
|
|
129
172
|
* @alias module:echarts/component/tooltip/TooltipContent
|
|
173
|
+
* @param {HTMLElement} container
|
|
174
|
+
* @param {ExtensionAPI} api
|
|
175
|
+
* @param {Object} [opt]
|
|
176
|
+
* @param {boolean} [opt.appendToBody]
|
|
177
|
+
* `false`: the DOM element will be inside the container. Default value.
|
|
178
|
+
* `true`: the DOM element will be appended to HTML body, which avoid
|
|
179
|
+
* some overflow clip but intrude outside of the container.
|
|
130
180
|
* @constructor
|
|
131
181
|
*/
|
|
132
182
|
|
|
133
183
|
|
|
134
|
-
function TooltipContent(container, api) {
|
|
184
|
+
function TooltipContent(container, api, opt) {
|
|
135
185
|
if (env.wxa) {
|
|
136
186
|
return null;
|
|
137
187
|
}
|
|
138
188
|
|
|
139
189
|
var el = document.createElement('div');
|
|
140
|
-
|
|
190
|
+
el.domBelongToZr = true;
|
|
141
191
|
this.el = el;
|
|
142
|
-
this.
|
|
143
|
-
this.
|
|
144
|
-
|
|
192
|
+
var zr = this._zr = api.getZr();
|
|
193
|
+
var appendToBody = this._appendToBody = opt && opt.appendToBody;
|
|
194
|
+
this._styleCoord = [0, 0, 0, 0]; // [left, top, left/width, top/height]
|
|
195
|
+
|
|
196
|
+
makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);
|
|
197
|
+
|
|
198
|
+
if (appendToBody) {
|
|
199
|
+
document.body.appendChild(el);
|
|
200
|
+
} else {
|
|
201
|
+
container.appendChild(el);
|
|
202
|
+
}
|
|
203
|
+
|
|
145
204
|
this._container = container;
|
|
146
205
|
this._show = false;
|
|
147
206
|
/**
|
|
@@ -175,7 +234,8 @@ function TooltipContent(container, api) {
|
|
|
175
234
|
// Try trigger zrender event to avoid mouse
|
|
176
235
|
// in and out shape too frequently
|
|
177
236
|
var handler = zr.handler;
|
|
178
|
-
|
|
237
|
+
var zrViewportRoot = zr.painter.getViewportRoot();
|
|
238
|
+
eventUtil.normalizeEvent(zrViewportRoot, e, true);
|
|
179
239
|
handler.dispatch('mousemove', e);
|
|
180
240
|
}
|
|
181
241
|
};
|
|
@@ -203,7 +263,7 @@ TooltipContent.prototype = {
|
|
|
203
263
|
/**
|
|
204
264
|
* Update when tooltip is rendered
|
|
205
265
|
*/
|
|
206
|
-
update: function () {
|
|
266
|
+
update: function (tooltipModel) {
|
|
207
267
|
// FIXME
|
|
208
268
|
// Move this logic to ec main?
|
|
209
269
|
var container = this._container;
|
|
@@ -212,22 +272,41 @@ TooltipContent.prototype = {
|
|
|
212
272
|
|
|
213
273
|
if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {
|
|
214
274
|
domStyle.position = 'relative';
|
|
215
|
-
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
var alwaysShowContent = tooltipModel.get('alwaysShowContent');
|
|
278
|
+
alwaysShowContent && this._moveTooltipIfResized(); // Hide the tooltip
|
|
216
279
|
// PENDING
|
|
217
280
|
// this.hide();
|
|
281
|
+
},
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* when `alwaysShowContent` is true,
|
|
285
|
+
* we should move the tooltip after chart resized
|
|
286
|
+
*/
|
|
287
|
+
_moveTooltipIfResized: function () {
|
|
288
|
+
var ratioX = this._styleCoord[2]; // The ratio of left to width
|
|
218
289
|
|
|
290
|
+
var ratioY = this._styleCoord[3]; // The ratio of top to height
|
|
291
|
+
|
|
292
|
+
var realX = ratioX * this._zr.getWidth();
|
|
293
|
+
|
|
294
|
+
var realY = ratioY * this._zr.getHeight();
|
|
295
|
+
|
|
296
|
+
this.moveTo(realX, realY);
|
|
219
297
|
},
|
|
220
298
|
show: function (tooltipModel) {
|
|
221
299
|
clearTimeout(this._hideTimeout);
|
|
222
300
|
var el = this.el;
|
|
301
|
+
var styleCoord = this._styleCoord;
|
|
223
302
|
el.style.cssText = gCssText + assembleCssText(tooltipModel) // Because of the reason described in:
|
|
224
303
|
// http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore
|
|
225
304
|
// we should set initial value to `left` and `top`.
|
|
226
|
-
+ ';left:' +
|
|
227
|
-
el.style.display = el.innerHTML ? 'block' : 'none'; // If mouse
|
|
228
|
-
// triggered by canvas, and
|
|
305
|
+
+ ';left:' + styleCoord[0] + 'px;top:' + styleCoord[1] + 'px;' + (tooltipModel.get('extraCssText') || '');
|
|
306
|
+
el.style.display = el.innerHTML ? 'block' : 'none'; // If mouse occasionally move over the tooltip, a mouseout event will be
|
|
307
|
+
// triggered by canvas, and cause some unexpectable result like dragging
|
|
229
308
|
// stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve
|
|
230
|
-
// it. Although it is not
|
|
309
|
+
// it. Although it is not supported by IE8~IE10, fortunately it is a rare
|
|
231
310
|
// scenario.
|
|
232
311
|
|
|
233
312
|
el.style.pointerEvents = this._enterable ? 'auto' : 'none';
|
|
@@ -243,23 +322,12 @@ TooltipContent.prototype = {
|
|
|
243
322
|
var el = this.el;
|
|
244
323
|
return [el.clientWidth, el.clientHeight];
|
|
245
324
|
},
|
|
246
|
-
moveTo: function (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
// should be considered here.
|
|
250
|
-
var zr = this._zr;
|
|
251
|
-
var viewportRootOffset;
|
|
252
|
-
|
|
253
|
-
if (zr && zr.painter && (viewportRootOffset = zr.painter.getViewportRootOffset())) {
|
|
254
|
-
x += viewportRootOffset.offsetLeft;
|
|
255
|
-
y += viewportRootOffset.offsetTop;
|
|
256
|
-
}
|
|
257
|
-
|
|
325
|
+
moveTo: function (zrX, zrY) {
|
|
326
|
+
var styleCoord = this._styleCoord;
|
|
327
|
+
makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);
|
|
258
328
|
var style = this.el.style;
|
|
259
|
-
style.left =
|
|
260
|
-
style.top =
|
|
261
|
-
this._x = x;
|
|
262
|
-
this._y = y;
|
|
329
|
+
style.left = styleCoord[0] + 'px';
|
|
330
|
+
style.top = styleCoord[1] + 'px';
|
|
263
331
|
},
|
|
264
332
|
hide: function () {
|
|
265
333
|
this.el.style.display = 'none';
|
|
@@ -268,7 +336,7 @@ TooltipContent.prototype = {
|
|
|
268
336
|
hideLater: function (time) {
|
|
269
337
|
if (this._show && !(this._inContent && this._enterable)) {
|
|
270
338
|
if (time) {
|
|
271
|
-
this._hideDelay = time; // Set show false to avoid invoke hideLater
|
|
339
|
+
this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times
|
|
272
340
|
|
|
273
341
|
this._show = false;
|
|
274
342
|
this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);
|
|
@@ -280,6 +348,9 @@ TooltipContent.prototype = {
|
|
|
280
348
|
isShow: function () {
|
|
281
349
|
return this._show;
|
|
282
350
|
},
|
|
351
|
+
dispose: function () {
|
|
352
|
+
this.el.parentNode.removeChild(this.el);
|
|
353
|
+
},
|
|
283
354
|
getOuterSize: function () {
|
|
284
355
|
var width = this.el.clientWidth;
|
|
285
356
|
var height = this.el.clientHeight; // Consider browser compatibility.
|
|
@@ -22,6 +22,8 @@ var zrUtil = require("zrender/lib/core/util");
|
|
|
22
22
|
|
|
23
23
|
var Text = require("zrender/lib/graphic/Text");
|
|
24
24
|
|
|
25
|
+
var graphicUtil = require("../../util/graphic");
|
|
26
|
+
|
|
25
27
|
/*
|
|
26
28
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
27
29
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -41,13 +43,24 @@ var Text = require("zrender/lib/graphic/Text");
|
|
|
41
43
|
* under the License.
|
|
42
44
|
*/
|
|
43
45
|
// import Group from 'zrender/src/container/Group';
|
|
46
|
+
function makeStyleCoord(out, zr, zrX, zrY) {
|
|
47
|
+
out[0] = zrX;
|
|
48
|
+
out[1] = zrY;
|
|
49
|
+
out[2] = out[0] / zr.getWidth(); // The ratio of left to width
|
|
44
50
|
|
|
51
|
+
out[3] = out[1] / zr.getHeight(); // The ratio of top to height
|
|
52
|
+
}
|
|
45
53
|
/**
|
|
46
54
|
* @alias module:echarts/component/tooltip/TooltipRichContent
|
|
47
55
|
* @constructor
|
|
48
56
|
*/
|
|
57
|
+
|
|
58
|
+
|
|
49
59
|
function TooltipRichContent(api) {
|
|
50
|
-
this._zr = api.getZr();
|
|
60
|
+
var zr = this._zr = api.getZr();
|
|
61
|
+
this._styleCoord = [0, 0, 0, 0]; // [left, top, left/width, top/height]
|
|
62
|
+
|
|
63
|
+
makeStyleCoord(this._styleCoord, zr, api.getWidth() / 2, api.getHeight() / 2);
|
|
51
64
|
this._show = false;
|
|
52
65
|
/**
|
|
53
66
|
* @private
|
|
@@ -68,7 +81,25 @@ TooltipRichContent.prototype = {
|
|
|
68
81
|
/**
|
|
69
82
|
* Update when tooltip is rendered
|
|
70
83
|
*/
|
|
71
|
-
update: function () {
|
|
84
|
+
update: function (tooltipModel) {
|
|
85
|
+
var alwaysShowContent = tooltipModel.get('alwaysShowContent');
|
|
86
|
+
alwaysShowContent && this._moveTooltipIfResized();
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* when `alwaysShowContent` is true,
|
|
91
|
+
* we should move the tooltip after chart resized
|
|
92
|
+
*/
|
|
93
|
+
_moveTooltipIfResized: function () {
|
|
94
|
+
var ratioX = this._styleCoord[2]; // The ratio of left to width
|
|
95
|
+
|
|
96
|
+
var ratioY = this._styleCoord[3]; // The ratio of top to height
|
|
97
|
+
|
|
98
|
+
var realX = ratioX * this._zr.getWidth();
|
|
99
|
+
|
|
100
|
+
var realY = ratioY * this._zr.getHeight();
|
|
101
|
+
|
|
102
|
+
this.moveTo(realX, realY);
|
|
72
103
|
},
|
|
73
104
|
show: function (tooltipModel) {
|
|
74
105
|
if (this._hideTimeout) {
|
|
@@ -123,16 +154,24 @@ TooltipRichContent.prototype = {
|
|
|
123
154
|
startId = text.indexOf('{marker');
|
|
124
155
|
}
|
|
125
156
|
|
|
157
|
+
var textStyleModel = tooltipModel.getModel('textStyle');
|
|
158
|
+
var fontSize = textStyleModel.get('fontSize');
|
|
159
|
+
var lineHeight = tooltipModel.get('textLineHeight');
|
|
160
|
+
|
|
161
|
+
if (lineHeight == null) {
|
|
162
|
+
lineHeight = Math.round(fontSize * 3 / 2);
|
|
163
|
+
}
|
|
164
|
+
|
|
126
165
|
this.el = new Text({
|
|
127
|
-
style: {
|
|
166
|
+
style: graphicUtil.setTextStyle({}, textStyleModel, {
|
|
128
167
|
rich: markers,
|
|
129
168
|
text: content,
|
|
130
|
-
textLineHeight: 20,
|
|
131
169
|
textBackgroundColor: tooltipModel.get('backgroundColor'),
|
|
132
170
|
textBorderRadius: tooltipModel.get('borderRadius'),
|
|
133
171
|
textFill: tooltipModel.get('textStyle.color'),
|
|
134
|
-
textPadding: tooltipModel.get('padding')
|
|
135
|
-
|
|
172
|
+
textPadding: tooltipModel.get('padding'),
|
|
173
|
+
textLineHeight: lineHeight
|
|
174
|
+
}),
|
|
136
175
|
z: tooltipModel.get('z')
|
|
137
176
|
});
|
|
138
177
|
|
|
@@ -167,7 +206,9 @@ TooltipRichContent.prototype = {
|
|
|
167
206
|
},
|
|
168
207
|
moveTo: function (x, y) {
|
|
169
208
|
if (this.el) {
|
|
170
|
-
this.
|
|
209
|
+
var styleCoord = this._styleCoord;
|
|
210
|
+
makeStyleCoord(styleCoord, this._zr, x, y);
|
|
211
|
+
this.el.attr('position', [styleCoord[0], styleCoord[1]]);
|
|
171
212
|
}
|
|
172
213
|
},
|
|
173
214
|
hide: function () {
|
|
@@ -180,7 +221,7 @@ TooltipRichContent.prototype = {
|
|
|
180
221
|
hideLater: function (time) {
|
|
181
222
|
if (this._show && !(this._inContent && this._enterable)) {
|
|
182
223
|
if (time) {
|
|
183
|
-
this._hideDelay = time; // Set show false to avoid invoke hideLater
|
|
224
|
+
this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times
|
|
184
225
|
|
|
185
226
|
this._show = false;
|
|
186
227
|
this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);
|
|
@@ -192,6 +233,13 @@ TooltipRichContent.prototype = {
|
|
|
192
233
|
isShow: function () {
|
|
193
234
|
return this._show;
|
|
194
235
|
},
|
|
236
|
+
dispose: function () {
|
|
237
|
+
clearTimeout(this._hideTimeout);
|
|
238
|
+
|
|
239
|
+
if (this.el) {
|
|
240
|
+
this._zr.remove(this.el);
|
|
241
|
+
}
|
|
242
|
+
},
|
|
195
243
|
getOuterSize: function () {
|
|
196
244
|
var size = this.getSize();
|
|
197
245
|
return {
|
|
@@ -93,7 +93,9 @@ var _default = echarts.extendComponentView({
|
|
|
93
93
|
var tooltipContent;
|
|
94
94
|
|
|
95
95
|
if (this._renderMode === 'html') {
|
|
96
|
-
tooltipContent = new TooltipContent(api.getDom(), api
|
|
96
|
+
tooltipContent = new TooltipContent(api.getDom(), api, {
|
|
97
|
+
appendToBody: tooltipModel.get('appendToBody', true)
|
|
98
|
+
});
|
|
97
99
|
this._newLine = '<br/>';
|
|
98
100
|
} else {
|
|
99
101
|
tooltipContent = new TooltipRichContent(api);
|
|
@@ -141,7 +143,7 @@ var _default = echarts.extendComponentView({
|
|
|
141
143
|
|
|
142
144
|
this._alwaysShowContent = tooltipModel.get('alwaysShowContent');
|
|
143
145
|
var tooltipContent = this._tooltipContent;
|
|
144
|
-
tooltipContent.update();
|
|
146
|
+
tooltipContent.update(tooltipModel);
|
|
145
147
|
tooltipContent.setEnterable(tooltipModel.get('enterable'));
|
|
146
148
|
|
|
147
149
|
this._initGlobalListener();
|
|
@@ -228,7 +230,6 @@ var _default = echarts.extendComponentView({
|
|
|
228
230
|
offsetX: payload.x,
|
|
229
231
|
offsetY: payload.y,
|
|
230
232
|
position: payload.position,
|
|
231
|
-
event: {},
|
|
232
233
|
dataByCoordSys: payload.dataByCoordSys,
|
|
233
234
|
tooltipOption: payload.tooltipOption
|
|
234
235
|
}, dispatchAction);
|
|
@@ -246,8 +247,7 @@ var _default = echarts.extendComponentView({
|
|
|
246
247
|
offsetX: cx,
|
|
247
248
|
offsetY: cy,
|
|
248
249
|
position: payload.position,
|
|
249
|
-
target: pointInfo.el
|
|
250
|
-
event: {}
|
|
250
|
+
target: pointInfo.el
|
|
251
251
|
}, dispatchAction);
|
|
252
252
|
}
|
|
253
253
|
} else if (payload.x != null && payload.y != null) {
|
|
@@ -263,8 +263,7 @@ var _default = echarts.extendComponentView({
|
|
|
263
263
|
offsetX: payload.x,
|
|
264
264
|
offsetY: payload.y,
|
|
265
265
|
position: payload.position,
|
|
266
|
-
target: api.getZr().findHover(payload.x, payload.y).target
|
|
267
|
-
event: {}
|
|
266
|
+
target: api.getZr().findHover(payload.x, payload.y).target
|
|
268
267
|
}, dispatchAction);
|
|
269
268
|
}
|
|
270
269
|
},
|
|
@@ -348,7 +347,7 @@ var _default = echarts.extendComponentView({
|
|
|
348
347
|
_showOrMove: function (tooltipModel, cb) {
|
|
349
348
|
// showDelay is used in this case: tooltip.enterable is set
|
|
350
349
|
// as true. User intent to move mouse into tooltip and click
|
|
351
|
-
// something. `showDelay` makes it
|
|
350
|
+
// something. `showDelay` makes it easier to enter the content
|
|
352
351
|
// but tooltip do not move immediately.
|
|
353
352
|
var delay = tooltipModel.get('showDelay');
|
|
354
353
|
cb = zrUtil.bind(cb, this);
|
|
@@ -414,7 +413,7 @@ var _default = echarts.extendComponentView({
|
|
|
414
413
|
}
|
|
415
414
|
}); // Default tooltip content
|
|
416
415
|
// FIXME
|
|
417
|
-
// (1)
|
|
416
|
+
// (1) should be the first data which has name?
|
|
418
417
|
// (2) themeRiver, firstDataIndex is array, and first line is unnecessary.
|
|
419
418
|
|
|
420
419
|
var firstLine = valueLabel;
|
|
@@ -452,7 +451,7 @@ var _default = echarts.extendComponentView({
|
|
|
452
451
|
var dataModel = el.dataModel || seriesModel;
|
|
453
452
|
var dataIndex = el.dataIndex;
|
|
454
453
|
var dataType = el.dataType;
|
|
455
|
-
var data = dataModel.getData();
|
|
454
|
+
var data = dataModel.getData(dataType);
|
|
456
455
|
var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model, this._tooltipModel]);
|
|
457
456
|
var tooltipTrigger = tooltipModel.get('trigger');
|
|
458
457
|
|
|
@@ -504,7 +503,7 @@ var _default = echarts.extendComponentView({
|
|
|
504
503
|
var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel);
|
|
505
504
|
var defaultHtml = subTooltipModel.get('content');
|
|
506
505
|
var asyncTicket = Math.random(); // Do not check whether `trigger` is 'none' here, because `trigger`
|
|
507
|
-
// only works on
|
|
506
|
+
// only works on coordinate system. In fact, we have not found case
|
|
508
507
|
// that requires setting `trigger` nothing on component yet.
|
|
509
508
|
|
|
510
509
|
this._showOrMove(subTooltipModel, function () {
|
|
@@ -658,7 +657,7 @@ var _default = echarts.extendComponentView({
|
|
|
658
657
|
return;
|
|
659
658
|
}
|
|
660
659
|
|
|
661
|
-
this._tooltipContent.
|
|
660
|
+
this._tooltipContent.dispose();
|
|
662
661
|
|
|
663
662
|
globalListener.unregister('itemTooltip', api);
|
|
664
663
|
}
|
|
@@ -417,20 +417,17 @@ var resetMethods = {
|
|
|
417
417
|
|
|
418
418
|
thisOption.precision = precision;
|
|
419
419
|
splitStep = +splitStep.toFixed(precision);
|
|
420
|
-
var index = 0;
|
|
421
420
|
|
|
422
421
|
if (thisOption.minOpen) {
|
|
423
422
|
pieceList.push({
|
|
424
|
-
index: index++,
|
|
425
423
|
interval: [-Infinity, dataExtent[0]],
|
|
426
424
|
close: [0, 0]
|
|
427
425
|
});
|
|
428
426
|
}
|
|
429
427
|
|
|
430
|
-
for (var
|
|
428
|
+
for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {
|
|
431
429
|
var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;
|
|
432
430
|
pieceList.push({
|
|
433
|
-
index: index++,
|
|
434
431
|
interval: [curr, max],
|
|
435
432
|
close: [1, 1]
|
|
436
433
|
});
|
|
@@ -438,14 +435,14 @@ var resetMethods = {
|
|
|
438
435
|
|
|
439
436
|
if (thisOption.maxOpen) {
|
|
440
437
|
pieceList.push({
|
|
441
|
-
index: index++,
|
|
442
438
|
interval: [dataExtent[1], Infinity],
|
|
443
439
|
close: [0, 0]
|
|
444
440
|
});
|
|
445
441
|
}
|
|
446
442
|
|
|
447
443
|
reformIntervals(pieceList);
|
|
448
|
-
zrUtil.each(pieceList, function (piece) {
|
|
444
|
+
zrUtil.each(pieceList, function (piece, index) {
|
|
445
|
+
piece.index = index;
|
|
449
446
|
piece.text = this.formatValueText(piece.interval);
|
|
450
447
|
}, this);
|
|
451
448
|
},
|
|
@@ -398,7 +398,7 @@ var VisualMapModel = echarts.extendComponentModel({
|
|
|
398
398
|
// Originally we use visualMap.color as the default color, but setOption at
|
|
399
399
|
// the second time the default color will be erased. So we change to use
|
|
400
400
|
// constant DEFAULT_COLOR.
|
|
401
|
-
// If user do not want the
|
|
401
|
+
// If user do not want the default color, set inRange: {color: null}.
|
|
402
402
|
|
|
403
403
|
|
|
404
404
|
base.inRange = base.inRange || {
|
package/lib/coord/Axis.js
CHANGED
|
@@ -111,7 +111,7 @@ Axis.prototype = {
|
|
|
111
111
|
* @return {boolean}
|
|
112
112
|
*/
|
|
113
113
|
containData: function (data) {
|
|
114
|
-
return this.contain(
|
|
114
|
+
return this.scale.contain(data);
|
|
115
115
|
},
|
|
116
116
|
|
|
117
117
|
/**
|
|
@@ -194,7 +194,7 @@ Axis.prototype = {
|
|
|
194
194
|
* `axis.getTicksCoords` considers `onBand`, which is used by
|
|
195
195
|
* `boundaryGap:true` of category axis and splitLine and splitArea.
|
|
196
196
|
* @param {Object} [opt]
|
|
197
|
-
* @param {
|
|
197
|
+
* @param {Model} [opt.tickModel=axis.model.getModel('axisTick')]
|
|
198
198
|
* @param {boolean} [opt.clamp] If `true`, the first and the last
|
|
199
199
|
* tick must be at the axis end points. Otherwise, clip ticks
|
|
200
200
|
* that outside the axis extent.
|
|
@@ -219,6 +219,34 @@ Axis.prototype = {
|
|
|
219
219
|
return ticksCoords;
|
|
220
220
|
},
|
|
221
221
|
|
|
222
|
+
/**
|
|
223
|
+
* @return {Array.<Array.<Object>>} [{ coord: ..., tickValue: ...}]
|
|
224
|
+
*/
|
|
225
|
+
getMinorTicksCoords: function () {
|
|
226
|
+
if (this.scale.type === 'ordinal') {
|
|
227
|
+
// Category axis doesn't support minor ticks
|
|
228
|
+
return [];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
var minorTickModel = this.model.getModel('minorTick');
|
|
232
|
+
var splitNumber = minorTickModel.get('splitNumber'); // Protection.
|
|
233
|
+
|
|
234
|
+
if (!(splitNumber > 0 && splitNumber < 100)) {
|
|
235
|
+
splitNumber = 5;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
var minorTicks = this.scale.getMinorTicks(splitNumber);
|
|
239
|
+
var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {
|
|
240
|
+
return map(minorTicksGroup, function (minorTick) {
|
|
241
|
+
return {
|
|
242
|
+
coord: this.dataToCoord(minorTick),
|
|
243
|
+
tickValue: minorTick
|
|
244
|
+
};
|
|
245
|
+
}, this);
|
|
246
|
+
}, this);
|
|
247
|
+
return minorTicksCoords;
|
|
248
|
+
},
|
|
249
|
+
|
|
222
250
|
/**
|
|
223
251
|
* @return {Array.<Object>} [{
|
|
224
252
|
* formattedLabel: string,
|
package/lib/coord/View.js
CHANGED
|
@@ -230,6 +230,15 @@ View.prototype = {
|
|
|
230
230
|
matrix.invert(this.invTransform, this.transform);
|
|
231
231
|
this.decomposeTransform();
|
|
232
232
|
},
|
|
233
|
+
getTransformInfo: function () {
|
|
234
|
+
var roamTransform = this._roamTransformable.transform;
|
|
235
|
+
var rawTransformable = this._rawTransformable;
|
|
236
|
+
return {
|
|
237
|
+
roamTransform: roamTransform ? zrUtil.slice(roamTransform) : matrix.create(),
|
|
238
|
+
rawScale: zrUtil.slice(rawTransformable.scale),
|
|
239
|
+
rawPosition: zrUtil.slice(rawTransformable.position)
|
|
240
|
+
};
|
|
241
|
+
},
|
|
233
242
|
|
|
234
243
|
/**
|
|
235
244
|
* @return {module:zrender/core/BoundingRect}
|