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
|
@@ -47,7 +47,7 @@ define(function (require) {
|
|
|
47
47
|
if (opts.sort && opts.sort != 'none') {
|
|
48
48
|
groups.sort(compareGroups);
|
|
49
49
|
if (opts.sort === 'descending') {
|
|
50
|
-
groups.
|
|
50
|
+
groups.reverse();
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -58,7 +58,7 @@ define(function (require) {
|
|
|
58
58
|
if (opts.sortSub && opts.sortSub != 'none') {
|
|
59
59
|
group.subGroups.sort(compareGroups);
|
|
60
60
|
if (opts.sortSub === 'descending') {
|
|
61
|
-
group.subGroups.
|
|
61
|
+
group.subGroups.reverse();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
package/src/chart/custom.js
CHANGED
|
@@ -6,11 +6,15 @@ define(function (require) {
|
|
|
6
6
|
var labelHelper = require('./helper/labelHelper');
|
|
7
7
|
var createListFromArray = require('./helper/createListFromArray');
|
|
8
8
|
var barGrid = require('../layout/barGrid');
|
|
9
|
+
var DataDiffer = require('../data/DataDiffer');
|
|
9
10
|
|
|
10
11
|
var ITEM_STYLE_NORMAL_PATH = ['itemStyle', 'normal'];
|
|
11
12
|
var ITEM_STYLE_EMPHASIS_PATH = ['itemStyle', 'emphasis'];
|
|
12
13
|
var LABEL_NORMAL = ['label', 'normal'];
|
|
13
14
|
var LABEL_EMPHASIS = ['label', 'emphasis'];
|
|
15
|
+
// Use prefix to avoid index to be the same as el.name,
|
|
16
|
+
// which will cause weird udpate animation.
|
|
17
|
+
var GROUP_DIFF_PREFIX = 'e\0\0';
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
* To reduce total package size of each coordinate systems, the modules `prepareCustom`
|
|
@@ -42,7 +46,7 @@ define(function (require) {
|
|
|
42
46
|
dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'],
|
|
43
47
|
|
|
44
48
|
defaultOption: {
|
|
45
|
-
coordinateSystem: 'cartesian2d',
|
|
49
|
+
coordinateSystem: 'cartesian2d', // Can be set as 'none'
|
|
46
50
|
zlevel: 0,
|
|
47
51
|
z: 2,
|
|
48
52
|
legendHoverLink: true
|
|
@@ -110,7 +114,12 @@ define(function (require) {
|
|
|
110
114
|
.execute();
|
|
111
115
|
|
|
112
116
|
this._data = data;
|
|
113
|
-
}
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @override
|
|
121
|
+
*/
|
|
122
|
+
dispose: zrUtil.noop
|
|
114
123
|
});
|
|
115
124
|
|
|
116
125
|
|
|
@@ -154,6 +163,7 @@ define(function (require) {
|
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
el.__customGraphicType = graphicType;
|
|
166
|
+
el.name = elOption.name;
|
|
157
167
|
|
|
158
168
|
return el;
|
|
159
169
|
}
|
|
@@ -180,6 +190,14 @@ define(function (require) {
|
|
|
180
190
|
zrUtil.each(['x', 'y'], function (prop) {
|
|
181
191
|
prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit);
|
|
182
192
|
});
|
|
193
|
+
// Compatible with previous: both support
|
|
194
|
+
// textFill and fill, textStroke and stroke in 'text' element.
|
|
195
|
+
!elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && (
|
|
196
|
+
elOptionStyle.textFill = elOptionStyle.fill
|
|
197
|
+
);
|
|
198
|
+
!elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && (
|
|
199
|
+
elOptionStyle.textStroke = elOptionStyle.stroke
|
|
200
|
+
);
|
|
183
201
|
}
|
|
184
202
|
|
|
185
203
|
if (el.type !== 'group') {
|
|
@@ -204,7 +222,7 @@ define(function (require) {
|
|
|
204
222
|
// z2 must not be null/undefined, otherwise sort error may occur.
|
|
205
223
|
el.attr({z2: elOption.z2 || 0, silent: elOption.silent});
|
|
206
224
|
|
|
207
|
-
|
|
225
|
+
elOption.styleEmphasis !== false && graphicUtil.setHoverStyle(el, elOption.styleEmphasis);
|
|
208
226
|
}
|
|
209
227
|
|
|
210
228
|
function prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) {
|
|
@@ -217,13 +235,21 @@ define(function (require) {
|
|
|
217
235
|
function makeRenderItem(customSeries, data, ecModel, api) {
|
|
218
236
|
var renderItem = customSeries.get('renderItem');
|
|
219
237
|
var coordSys = customSeries.coordinateSystem;
|
|
238
|
+
var prepareResult = {};
|
|
220
239
|
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
240
|
+
if (coordSys) {
|
|
241
|
+
if (__DEV__) {
|
|
242
|
+
zrUtil.assert(renderItem, 'series.render is required.');
|
|
243
|
+
zrUtil.assert(
|
|
244
|
+
coordSys.prepareCustoms || prepareCustoms[coordSys.type],
|
|
245
|
+
'This coordSys does not support custom series.'
|
|
246
|
+
);
|
|
247
|
+
}
|
|
225
248
|
|
|
226
|
-
|
|
249
|
+
prepareResult = coordSys.prepareCustoms
|
|
250
|
+
? coordSys.prepareCustoms()
|
|
251
|
+
: prepareCustoms[coordSys.type](coordSys);
|
|
252
|
+
}
|
|
227
253
|
|
|
228
254
|
var userAPI = zrUtil.defaults({
|
|
229
255
|
getWidth: api.getWidth,
|
|
@@ -237,7 +263,7 @@ define(function (require) {
|
|
|
237
263
|
barLayout: barLayout,
|
|
238
264
|
currentSeriesIndices: currentSeriesIndices,
|
|
239
265
|
font: font
|
|
240
|
-
}, prepareResult.api);
|
|
266
|
+
}, prepareResult.api || {});
|
|
241
267
|
|
|
242
268
|
var userParams = {
|
|
243
269
|
context: {},
|
|
@@ -286,7 +312,7 @@ define(function (require) {
|
|
|
286
312
|
|
|
287
313
|
/**
|
|
288
314
|
* @public
|
|
289
|
-
* @param {
|
|
315
|
+
* @param {number|string} dim
|
|
290
316
|
* @param {number} [dataIndexInside=currDataIndexInside]
|
|
291
317
|
* @return {number|string} value
|
|
292
318
|
*/
|
|
@@ -314,10 +340,19 @@ define(function (require) {
|
|
|
314
340
|
var opacity = data.getItemVisual(dataIndexInside, 'opacity');
|
|
315
341
|
opacity != null && (itemStyle.opacity = opacity);
|
|
316
342
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
343
|
+
if (currLabelValueDim != null) {
|
|
344
|
+
graphicUtil.setTextStyle(itemStyle, currLabelNormalModel, null, {
|
|
345
|
+
autoColor: currVisualColor,
|
|
346
|
+
isRectText: true
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
itemStyle.text = currLabelNormalModel.getShallow('show')
|
|
350
|
+
? zrUtil.retrieve2(
|
|
351
|
+
customSeries.getFormattedLabel(dataIndexInside, 'normal'),
|
|
352
|
+
data.get(currLabelValueDim, dataIndexInside)
|
|
353
|
+
)
|
|
354
|
+
: null;
|
|
355
|
+
}
|
|
321
356
|
|
|
322
357
|
extra && zrUtil.extend(itemStyle, extra);
|
|
323
358
|
return itemStyle;
|
|
@@ -334,10 +369,19 @@ define(function (require) {
|
|
|
334
369
|
|
|
335
370
|
var itemStyle = currItemModel.getModel(ITEM_STYLE_EMPHASIS_PATH).getItemStyle();
|
|
336
371
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
372
|
+
if (currLabelValueDim != null) {
|
|
373
|
+
graphicUtil.setTextStyle(itemStyle, currLabelEmphasisModel, null, {
|
|
374
|
+
isRectText: true
|
|
375
|
+
}, true);
|
|
376
|
+
|
|
377
|
+
itemStyle.text = currLabelEmphasisModel.getShallow('show')
|
|
378
|
+
? zrUtil.retrieve3(
|
|
379
|
+
customSeries.getFormattedLabel(dataIndexInside, 'emphasis'),
|
|
380
|
+
customSeries.getFormattedLabel(dataIndexInside, 'normal'),
|
|
381
|
+
data.get(currLabelValueDim, dataIndexInside)
|
|
382
|
+
)
|
|
383
|
+
: null;
|
|
384
|
+
}
|
|
341
385
|
|
|
342
386
|
extra && zrUtil.extend(itemStyle, extra);
|
|
343
387
|
return itemStyle;
|
|
@@ -430,13 +474,83 @@ define(function (require) {
|
|
|
430
474
|
!el && (el = createEl(elOption));
|
|
431
475
|
updateEl(el, dataIndex, elOption, animatableModel, data, isInit);
|
|
432
476
|
|
|
433
|
-
elOptionType === 'group'
|
|
434
|
-
|
|
435
|
-
|
|
477
|
+
if (elOptionType === 'group') {
|
|
478
|
+
var oldChildren = el.children() || [];
|
|
479
|
+
var newChildren = elOption.children || [];
|
|
480
|
+
|
|
481
|
+
if (elOption.diffChildrenByName) {
|
|
482
|
+
// lower performance.
|
|
483
|
+
diffGroupChildren({
|
|
484
|
+
oldChildren: oldChildren,
|
|
485
|
+
newChildren: newChildren,
|
|
486
|
+
dataIndex: dataIndex,
|
|
487
|
+
animatableModel: animatableModel,
|
|
488
|
+
group: el,
|
|
489
|
+
data: data
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
// better performance.
|
|
494
|
+
var index = 0;
|
|
495
|
+
for (; index < newChildren.length; index++) {
|
|
496
|
+
doCreateOrUpdate(
|
|
497
|
+
el.childAt(index),
|
|
498
|
+
dataIndex,
|
|
499
|
+
newChildren[index],
|
|
500
|
+
animatableModel,
|
|
501
|
+
el,
|
|
502
|
+
data
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
for (; index < oldChildren.length; index++) {
|
|
506
|
+
oldChildren[index] && el.remove(oldChildren[index]);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
436
510
|
|
|
437
511
|
group.add(el);
|
|
438
512
|
|
|
439
513
|
return el;
|
|
440
514
|
}
|
|
441
515
|
|
|
516
|
+
function diffGroupChildren(context) {
|
|
517
|
+
(new DataDiffer(
|
|
518
|
+
context.oldChildren,
|
|
519
|
+
context.newChildren,
|
|
520
|
+
getKey,
|
|
521
|
+
getKey,
|
|
522
|
+
context
|
|
523
|
+
))
|
|
524
|
+
.add(processAddUpdate)
|
|
525
|
+
.update(processAddUpdate)
|
|
526
|
+
.remove(processRemove)
|
|
527
|
+
.execute();
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function getKey(item, idx) {
|
|
531
|
+
var name = item && item.name;
|
|
532
|
+
return name != null ? name : GROUP_DIFF_PREFIX + idx;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function processAddUpdate(newIndex, oldIndex) {
|
|
536
|
+
var context = this.context;
|
|
537
|
+
var childOption = newIndex != null ? context.newChildren[newIndex] : null;
|
|
538
|
+
var child = oldIndex != null ? context.oldChildren[oldIndex] : null;
|
|
539
|
+
|
|
540
|
+
doCreateOrUpdate(
|
|
541
|
+
child,
|
|
542
|
+
context.dataIndex,
|
|
543
|
+
childOption,
|
|
544
|
+
context.animatableModel,
|
|
545
|
+
context.group,
|
|
546
|
+
context.data
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function processRemove(oldIndex) {
|
|
551
|
+
var context = this.context;
|
|
552
|
+
var child = context.oldChildren[oldIndex];
|
|
553
|
+
child && context.group.remove(child);
|
|
554
|
+
}
|
|
555
|
+
|
|
442
556
|
});
|
|
@@ -38,21 +38,6 @@ define(function (require) {
|
|
|
38
38
|
|
|
39
39
|
var funnelPieceProto = FunnelPiece.prototype;
|
|
40
40
|
|
|
41
|
-
function getLabelStyle(data, idx, state, labelModel) {
|
|
42
|
-
var textStyleModel = labelModel.getModel('textStyle');
|
|
43
|
-
var position = labelModel.get('position');
|
|
44
|
-
var isLabelInside = position === 'inside' || position === 'inner' || position === 'center';
|
|
45
|
-
return {
|
|
46
|
-
fill: textStyleModel.getTextColor()
|
|
47
|
-
|| (isLabelInside ? '#fff' : data.getItemVisual(idx, 'color')),
|
|
48
|
-
textFont: textStyleModel.getFont(),
|
|
49
|
-
text: zrUtil.retrieve(
|
|
50
|
-
data.hostModel.getFormattedLabel(idx, state),
|
|
51
|
-
data.getName(idx)
|
|
52
|
-
)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
41
|
var opacityAccessPath = ['itemStyle', 'normal', 'opacity'];
|
|
57
42
|
funnelPieceProto.updateData = function (data, idx, firstCreate) {
|
|
58
43
|
|
|
@@ -133,11 +118,6 @@ define(function (require) {
|
|
|
133
118
|
}
|
|
134
119
|
}, seriesModel, idx);
|
|
135
120
|
labelText.attr({
|
|
136
|
-
style: {
|
|
137
|
-
textAlign: labelLayout.textAlign,
|
|
138
|
-
textVerticalAlign: labelLayout.verticalAlign,
|
|
139
|
-
textFont: labelLayout.font
|
|
140
|
-
},
|
|
141
121
|
rotation: labelLayout.rotation,
|
|
142
122
|
origin: [labelLayout.x, labelLayout.y],
|
|
143
123
|
z2: 10
|
|
@@ -147,8 +127,22 @@ define(function (require) {
|
|
|
147
127
|
var labelHoverModel = itemModel.getModel('label.emphasis');
|
|
148
128
|
var labelLineModel = itemModel.getModel('labelLine.normal');
|
|
149
129
|
var labelLineHoverModel = itemModel.getModel('labelLine.emphasis');
|
|
130
|
+
var visualColor = data.getItemVisual(idx, 'color');
|
|
150
131
|
|
|
151
|
-
|
|
132
|
+
graphic.setLabelStyle(
|
|
133
|
+
labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel,
|
|
134
|
+
{
|
|
135
|
+
labelFetcher: data.hostModel,
|
|
136
|
+
labelDataIndex: idx,
|
|
137
|
+
defaultText: data.getName(idx),
|
|
138
|
+
autoColor: visualColor,
|
|
139
|
+
useInsideStyle: !!labelLayout.inside
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
textAlign: labelLayout.textAlign,
|
|
143
|
+
textVerticalAlign: labelLayout.verticalAlign
|
|
144
|
+
}
|
|
145
|
+
);
|
|
152
146
|
|
|
153
147
|
labelText.ignore = labelText.normalIgnore = !labelModel.get('show');
|
|
154
148
|
labelText.hoverIgnore = !labelHoverModel.get('show');
|
|
@@ -162,7 +156,6 @@ define(function (require) {
|
|
|
162
156
|
});
|
|
163
157
|
labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle());
|
|
164
158
|
|
|
165
|
-
labelText.hoverStyle = getLabelStyle(data, idx, 'emphasis', labelHoverModel);
|
|
166
159
|
labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle();
|
|
167
160
|
};
|
|
168
161
|
|
|
@@ -76,9 +76,7 @@ define(function (require) {
|
|
|
76
76
|
show: true,
|
|
77
77
|
distance: 5,
|
|
78
78
|
// formatter: null,
|
|
79
|
-
|
|
80
|
-
color: 'auto'
|
|
81
|
-
}
|
|
79
|
+
color: 'auto'
|
|
82
80
|
},
|
|
83
81
|
pointer: {
|
|
84
82
|
show: true,
|
|
@@ -95,10 +93,8 @@ define(function (require) {
|
|
|
95
93
|
// x, y,单位px
|
|
96
94
|
offsetCenter: [0, '-40%'],
|
|
97
95
|
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
fontSize: 15
|
|
101
|
-
}
|
|
96
|
+
color: '#333',
|
|
97
|
+
fontSize: 15
|
|
102
98
|
},
|
|
103
99
|
detail: {
|
|
104
100
|
show: true,
|
|
@@ -106,15 +102,14 @@ define(function (require) {
|
|
|
106
102
|
borderWidth: 0,
|
|
107
103
|
borderColor: '#ccc',
|
|
108
104
|
width: 100,
|
|
109
|
-
height:
|
|
105
|
+
height: null, // self-adaption
|
|
106
|
+
padding: [5, 10],
|
|
110
107
|
// x, y,单位px
|
|
111
108
|
offsetCenter: [0, '40%'],
|
|
112
109
|
// formatter: null,
|
|
113
110
|
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
fontSize: 30
|
|
117
|
-
}
|
|
111
|
+
color: 'auto',
|
|
112
|
+
fontSize: 30
|
|
118
113
|
}
|
|
119
114
|
}
|
|
120
115
|
});
|
|
@@ -174,7 +174,6 @@ define(function (require) {
|
|
|
174
174
|
|
|
175
175
|
var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();
|
|
176
176
|
var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();
|
|
177
|
-
var textStyleModel = labelModel.getModel('textStyle');
|
|
178
177
|
|
|
179
178
|
for (var i = 0; i <= splitNumber; i++) {
|
|
180
179
|
var unitX = Math.cos(angle);
|
|
@@ -207,26 +206,18 @@ define(function (require) {
|
|
|
207
206
|
labelModel.get('formatter')
|
|
208
207
|
);
|
|
209
208
|
var distance = labelModel.get('distance');
|
|
209
|
+
var autoColor = getColor(i / splitNumber);
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
style: {
|
|
211
|
+
group.add(new graphic.Text({
|
|
212
|
+
style: graphic.setTextStyle({}, labelModel, {
|
|
213
213
|
text: label,
|
|
214
214
|
x: unitX * (r - splitLineLen - distance) + cx,
|
|
215
215
|
y: unitY * (r - splitLineLen - distance) + cy,
|
|
216
|
-
fill: textStyleModel.getTextColor(),
|
|
217
|
-
textFont: textStyleModel.getFont(),
|
|
218
216
|
textVerticalAlign: unitY < -0.4 ? 'top' : (unitY > 0.4 ? 'bottom' : 'middle'),
|
|
219
217
|
textAlign: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')
|
|
220
|
-
},
|
|
218
|
+
}, {autoColor: autoColor}),
|
|
221
219
|
silent: true
|
|
222
|
-
});
|
|
223
|
-
if (text.style.fill === 'auto') {
|
|
224
|
-
text.setStyle({
|
|
225
|
-
fill: getColor(i / splitNumber)
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
group.add(text);
|
|
220
|
+
}));
|
|
230
221
|
}
|
|
231
222
|
|
|
232
223
|
// Axis tick
|
|
@@ -352,34 +343,28 @@ define(function (require) {
|
|
|
352
343
|
) {
|
|
353
344
|
var titleModel = seriesModel.getModel('title');
|
|
354
345
|
if (titleModel.get('show')) {
|
|
355
|
-
var textStyleModel = titleModel.getModel('textStyle');
|
|
356
346
|
var offsetCenter = titleModel.get('offsetCenter');
|
|
357
347
|
var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r);
|
|
358
348
|
var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r);
|
|
359
349
|
|
|
360
|
-
var
|
|
361
|
-
|
|
350
|
+
var minVal = +seriesModel.get('min');
|
|
351
|
+
var maxVal = +seriesModel.get('max');
|
|
352
|
+
var value = seriesModel.getData().get('value', 0);
|
|
353
|
+
var autoColor = getColor(
|
|
354
|
+
numberUtil.linearMap(value, [minVal, maxVal], [0, 1], true)
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
this.group.add(new graphic.Text({
|
|
358
|
+
silent: true,
|
|
359
|
+
style: graphic.setTextStyle({}, titleModel, {
|
|
362
360
|
x: x,
|
|
363
361
|
y: y,
|
|
364
362
|
// FIXME First data name ?
|
|
365
363
|
text: seriesModel.getData().getName(0),
|
|
366
|
-
fill: textStyleModel.getTextColor(),
|
|
367
|
-
textFont: textStyleModel.getFont(),
|
|
368
364
|
textAlign: 'center',
|
|
369
365
|
textVerticalAlign: 'middle'
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
if (text.style.fill === 'auto') {
|
|
374
|
-
var minVal = +seriesModel.get('min');
|
|
375
|
-
var maxVal = +seriesModel.get('max');
|
|
376
|
-
var value = seriesModel.getData().get('value', 0);
|
|
377
|
-
text.setStyle('fill', getColor(
|
|
378
|
-
numberUtil.linearMap(value, [minVal, maxVal], [0, 1], true)
|
|
379
|
-
));
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
this.group.add(text);
|
|
366
|
+
}, {autoColor: autoColor, forceRich: true})
|
|
367
|
+
}));
|
|
383
368
|
}
|
|
384
369
|
},
|
|
385
370
|
|
|
@@ -390,37 +375,31 @@ define(function (require) {
|
|
|
390
375
|
var minVal = +seriesModel.get('min');
|
|
391
376
|
var maxVal = +seriesModel.get('max');
|
|
392
377
|
if (detailModel.get('show')) {
|
|
393
|
-
var textStyleModel = detailModel.getModel('textStyle');
|
|
394
378
|
var offsetCenter = detailModel.get('offsetCenter');
|
|
395
379
|
var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r);
|
|
396
380
|
var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r);
|
|
397
381
|
var width = parsePercent(detailModel.get('width'), posInfo.r);
|
|
398
382
|
var height = parsePercent(detailModel.get('height'), posInfo.r);
|
|
399
383
|
var value = seriesModel.getData().get('value', 0);
|
|
400
|
-
var
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
},
|
|
407
|
-
|
|
384
|
+
var autoColor = getColor(
|
|
385
|
+
numberUtil.linearMap(value, [minVal, maxVal], [0, 1], true)
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
this.group.add(new graphic.Text({
|
|
389
|
+
silent: true,
|
|
390
|
+
style: graphic.setTextStyle({}, detailModel, {
|
|
391
|
+
x: x,
|
|
392
|
+
y: y,
|
|
408
393
|
text: formatLabel(
|
|
409
394
|
// FIXME First data name ?
|
|
410
395
|
value, detailModel.get('formatter')
|
|
411
396
|
),
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
rect.setStyle('textFill', getColor(
|
|
419
|
-
numberUtil.linearMap(value, [minVal, maxVal], [0, 1], true)
|
|
420
|
-
));
|
|
421
|
-
}
|
|
422
|
-
rect.setStyle(detailModel.getItemStyle(['color']));
|
|
423
|
-
this.group.add(rect);
|
|
397
|
+
textWidth: isNaN(width) ? null : width,
|
|
398
|
+
textHeight: isNaN(height) ? null : height,
|
|
399
|
+
textAlign: 'center',
|
|
400
|
+
textVerticalAlign: 'middle'
|
|
401
|
+
}, {autoColor: autoColor, forceRich: true})
|
|
402
|
+
}));
|
|
424
403
|
}
|
|
425
404
|
}
|
|
426
405
|
});
|
|
@@ -37,7 +37,7 @@ define(function (require) {
|
|
|
37
37
|
|
|
38
38
|
mergeDefaultAndTheme: function (option) {
|
|
39
39
|
GraphSeries.superApply(this, 'mergeDefaultAndTheme', arguments);
|
|
40
|
-
modelUtil.defaultEmphasis(option.edgeLabel,
|
|
40
|
+
modelUtil.defaultEmphasis(option.edgeLabel, ['show']);
|
|
41
41
|
},
|
|
42
42
|
|
|
43
43
|
getInitialData: function (option, ecModel) {
|
|
@@ -228,6 +228,7 @@ define(function (require) {
|
|
|
228
228
|
zoom: 1,
|
|
229
229
|
// Symbol size scale ratio in roam
|
|
230
230
|
nodeScaleRatio: 0.6,
|
|
231
|
+
// cursor: null,
|
|
231
232
|
|
|
232
233
|
// categories: [],
|
|
233
234
|
|
|
@@ -18,6 +18,35 @@ define(function (require) {
|
|
|
18
18
|
return item.getVisual('opacity') || item.getModel().get(opacityPath);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function fadeOutItem(item, opacityPath, opacityRatio) {
|
|
22
|
+
var el = item.getGraphicEl();
|
|
23
|
+
|
|
24
|
+
var opacity = getItemOpacity(item, opacityPath);
|
|
25
|
+
if (opacityRatio != null) {
|
|
26
|
+
opacity == null && (opacity = 1);
|
|
27
|
+
opacity *= opacityRatio;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
el.downplay && el.downplay();
|
|
31
|
+
el.traverse(function (child) {
|
|
32
|
+
if (child.type !== 'group') {
|
|
33
|
+
child.setStyle('opacity', opacity);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function fadeInItem(item, opacityPath) {
|
|
39
|
+
var opacity = getItemOpacity(item, opacityPath);
|
|
40
|
+
var el = item.getGraphicEl();
|
|
41
|
+
|
|
42
|
+
el.highlight && el.highlight();
|
|
43
|
+
el.traverse(function (child) {
|
|
44
|
+
if (child.type !== 'group') {
|
|
45
|
+
child.setStyle('opacity', opacity);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
21
50
|
require('../../echarts').extendChartView({
|
|
22
51
|
|
|
23
52
|
type: 'graph',
|
|
@@ -125,7 +154,8 @@ define(function (require) {
|
|
|
125
154
|
|
|
126
155
|
}, this);
|
|
127
156
|
|
|
128
|
-
var circularRotateLabel = seriesModel.get('layout') === 'circular'
|
|
157
|
+
var circularRotateLabel = seriesModel.get('layout') === 'circular'
|
|
158
|
+
&& seriesModel.get('circular.rotateLabel');
|
|
129
159
|
var cx = data.getLayout('cx');
|
|
130
160
|
var cy = data.getLayout('cy');
|
|
131
161
|
data.eachItemGraphicEl(function (el, idx) {
|
|
@@ -142,8 +172,9 @@ define(function (require) {
|
|
|
142
172
|
}
|
|
143
173
|
var textPosition = isLeft ? 'left' : 'right';
|
|
144
174
|
symbolPath.setStyle({
|
|
145
|
-
textRotation: rad,
|
|
146
|
-
textPosition: textPosition
|
|
175
|
+
textRotation: -rad,
|
|
176
|
+
textPosition: textPosition,
|
|
177
|
+
textOrigin: 'center'
|
|
147
178
|
});
|
|
148
179
|
symbolPath.hoverStyle && (symbolPath.hoverStyle.textPosition = textPosition);
|
|
149
180
|
}
|
|
@@ -174,38 +205,12 @@ define(function (require) {
|
|
|
174
205
|
var graph = data.graph;
|
|
175
206
|
var dataType = el.dataType;
|
|
176
207
|
|
|
177
|
-
function fadeOutItem(item, opacityPath) {
|
|
178
|
-
var opacity = getItemOpacity(item, opacityPath);
|
|
179
|
-
var el = item.getGraphicEl();
|
|
180
|
-
if (opacity == null) {
|
|
181
|
-
opacity = 1;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
el.traverse(function (child) {
|
|
185
|
-
child.trigger('normal');
|
|
186
|
-
if (child.type !== 'group') {
|
|
187
|
-
child.setStyle('opacity', opacity * 0.1);
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function fadeInItem(item, opacityPath) {
|
|
193
|
-
var opacity = getItemOpacity(item, opacityPath);
|
|
194
|
-
var el = item.getGraphicEl();
|
|
195
|
-
|
|
196
|
-
el.traverse(function (child) {
|
|
197
|
-
child.trigger('emphasis');
|
|
198
|
-
if (child.type !== 'group') {
|
|
199
|
-
child.setStyle('opacity', opacity);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
208
|
if (dataIndex !== null && dataType !== 'edge') {
|
|
204
209
|
graph.eachNode(function (node) {
|
|
205
|
-
fadeOutItem(node, nodeOpacityPath);
|
|
210
|
+
fadeOutItem(node, nodeOpacityPath, 0.1);
|
|
206
211
|
});
|
|
207
212
|
graph.eachEdge(function (edge) {
|
|
208
|
-
fadeOutItem(edge, lineOpacityPath);
|
|
213
|
+
fadeOutItem(edge, lineOpacityPath, 0.1);
|
|
209
214
|
});
|
|
210
215
|
|
|
211
216
|
var node = graph.getNodeByIndex(dataIndex);
|
|
@@ -223,23 +228,12 @@ define(function (require) {
|
|
|
223
228
|
|
|
224
229
|
unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) {
|
|
225
230
|
var graph = this._model.getData().graph;
|
|
231
|
+
|
|
226
232
|
graph.eachNode(function (node) {
|
|
227
|
-
|
|
228
|
-
node.getGraphicEl().traverse(function (child) {
|
|
229
|
-
child.trigger('normal');
|
|
230
|
-
if (child.type !== 'group') {
|
|
231
|
-
child.setStyle('opacity', opacity);
|
|
232
|
-
}
|
|
233
|
-
});
|
|
233
|
+
fadeOutItem(node, nodeOpacityPath);
|
|
234
234
|
});
|
|
235
235
|
graph.eachEdge(function (edge) {
|
|
236
|
-
|
|
237
|
-
edge.getGraphicEl().traverse(function (child) {
|
|
238
|
-
child.trigger('normal');
|
|
239
|
-
if (child.type !== 'group') {
|
|
240
|
-
child.setStyle('opacity', opacity);
|
|
241
|
-
}
|
|
242
|
-
});
|
|
236
|
+
fadeOutItem(edge, lineOpacityPath);
|
|
243
237
|
});
|
|
244
238
|
},
|
|
245
239
|
|