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
|
@@ -27,6 +27,60 @@ import View from '../../coord/View';
|
|
|
27
27
|
import * as roamHelper from '../../component/helper/roamHelper';
|
|
28
28
|
import RoamController from '../../component/helper/RoamController';
|
|
29
29
|
import {onIrrelevantElement} from '../../component/helper/cursorHelper';
|
|
30
|
+
import { __DEV__ } from '../../config';
|
|
31
|
+
import {parsePercent} from '../../util/number';
|
|
32
|
+
|
|
33
|
+
var TreeShape = graphic.extendShape({
|
|
34
|
+
shape: {
|
|
35
|
+
parentPoint: [],
|
|
36
|
+
childPoints: [],
|
|
37
|
+
orient: '',
|
|
38
|
+
forkPosition: ''
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
style: {
|
|
42
|
+
stroke: '#000',
|
|
43
|
+
fill: null
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
buildPath: function (ctx, shape) {
|
|
47
|
+
var childPoints = shape.childPoints;
|
|
48
|
+
var childLen = childPoints.length;
|
|
49
|
+
var parentPoint = shape.parentPoint;
|
|
50
|
+
var firstChildPos = childPoints[0];
|
|
51
|
+
var lastChildPos = childPoints[childLen - 1];
|
|
52
|
+
|
|
53
|
+
if (childLen === 1) {
|
|
54
|
+
ctx.moveTo(parentPoint[0], parentPoint[1]);
|
|
55
|
+
ctx.lineTo(firstChildPos[0], firstChildPos[1]);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var orient = shape.orient;
|
|
60
|
+
var forkDim = (orient === 'TB' || orient === 'BT') ? 0 : 1;
|
|
61
|
+
var otherDim = 1 - forkDim;
|
|
62
|
+
var forkPosition = parsePercent(shape.forkPosition, 1);
|
|
63
|
+
var tmpPoint = [];
|
|
64
|
+
tmpPoint[forkDim] = parentPoint[forkDim];
|
|
65
|
+
tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;
|
|
66
|
+
|
|
67
|
+
ctx.moveTo(parentPoint[0], parentPoint[1]);
|
|
68
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
69
|
+
ctx.moveTo(firstChildPos[0], firstChildPos[1]);
|
|
70
|
+
tmpPoint[forkDim] = firstChildPos[forkDim];
|
|
71
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
72
|
+
tmpPoint[forkDim] = lastChildPos[forkDim];
|
|
73
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
74
|
+
ctx.lineTo(lastChildPos[0], lastChildPos[1]);
|
|
75
|
+
|
|
76
|
+
for (var i = 1; i < childLen - 1; i++) {
|
|
77
|
+
var point = childPoints[i];
|
|
78
|
+
ctx.moveTo(point[0], point[1]);
|
|
79
|
+
tmpPoint[forkDim] = point[forkDim];
|
|
80
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
30
84
|
|
|
31
85
|
export default echarts.extendChartView({
|
|
32
86
|
|
|
@@ -87,6 +141,8 @@ export default echarts.extendChartView({
|
|
|
87
141
|
var seriesScope = {
|
|
88
142
|
expandAndCollapse: seriesModel.get('expandAndCollapse'),
|
|
89
143
|
layout: layout,
|
|
144
|
+
edgeShape: seriesModel.get('edgeShape'),
|
|
145
|
+
edgeForkPosition: seriesModel.get('edgeForkPosition'),
|
|
90
146
|
orient: seriesModel.getOrient(),
|
|
91
147
|
curvature: seriesModel.get('lineStyle.curveness'),
|
|
92
148
|
symbolRotate: seriesModel.get('symbolRotate'),
|
|
@@ -388,22 +444,72 @@ function updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
|
|
|
388
444
|
});
|
|
389
445
|
}
|
|
390
446
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout),
|
|
396
|
-
style: zrUtil.defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle)
|
|
397
|
-
});
|
|
398
|
-
}
|
|
447
|
+
drawEdge(
|
|
448
|
+
seriesModel, node, virtualRoot, symbolEl, sourceOldLayout,
|
|
449
|
+
sourceLayout, targetLayout, group, seriesScope
|
|
450
|
+
);
|
|
399
451
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function drawEdge(
|
|
455
|
+
seriesModel, node, virtualRoot, symbolEl, sourceOldLayout,
|
|
456
|
+
sourceLayout, targetLayout, group, seriesScope
|
|
457
|
+
) {
|
|
458
|
+
|
|
459
|
+
var edgeShape = seriesScope.edgeShape;
|
|
460
|
+
var edge = symbolEl.__edge;
|
|
461
|
+
if (edgeShape === 'curve') {
|
|
462
|
+
if (node.parentNode && node.parentNode !== virtualRoot) {
|
|
463
|
+
if (!edge) {
|
|
464
|
+
edge = symbolEl.__edge = new graphic.BezierCurve({
|
|
465
|
+
shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout),
|
|
466
|
+
style: zrUtil.defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle)
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
graphic.updateProps(edge, {
|
|
471
|
+
shape: getEdgeShape(seriesScope, sourceLayout, targetLayout),
|
|
472
|
+
style: zrUtil.defaults({opacity: 1}, seriesScope.lineStyle)
|
|
473
|
+
}, seriesModel);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
else if (edgeShape === 'polyline') {
|
|
477
|
+
if (seriesScope.layout === 'orthogonal') {
|
|
478
|
+
if (node !== virtualRoot && node.children && (node.children.length !== 0) && (node.isExpand === true)) {
|
|
479
|
+
var children = node.children;
|
|
480
|
+
var childPoints = [];
|
|
481
|
+
for (var i = 0; i < children.length; i++) {
|
|
482
|
+
var childLayout = children[i].getLayout();
|
|
483
|
+
childPoints.push([childLayout.x, childLayout.y]);
|
|
484
|
+
}
|
|
404
485
|
|
|
405
|
-
|
|
486
|
+
if (!edge) {
|
|
487
|
+
edge = symbolEl.__edge = new TreeShape({
|
|
488
|
+
shape: {
|
|
489
|
+
parentPoint: [targetLayout.x, targetLayout.y],
|
|
490
|
+
childPoints: [[targetLayout.x, targetLayout.y]],
|
|
491
|
+
orient: seriesScope.orient,
|
|
492
|
+
forkPosition: seriesScope.edgeForkPosition
|
|
493
|
+
},
|
|
494
|
+
style: zrUtil.defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle)
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
graphic.updateProps(edge, {
|
|
498
|
+
shape: {
|
|
499
|
+
parentPoint: [targetLayout.x, targetLayout.y],
|
|
500
|
+
childPoints: childPoints
|
|
501
|
+
},
|
|
502
|
+
style: zrUtil.defaults({opacity: 1}, seriesScope.lineStyle)
|
|
503
|
+
}, seriesModel);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
if (__DEV__) {
|
|
508
|
+
throw new Error('The polyline edgeShape can only be used in orthogonal layout');
|
|
509
|
+
}
|
|
510
|
+
}
|
|
406
511
|
}
|
|
512
|
+
group.add(edge);
|
|
407
513
|
}
|
|
408
514
|
|
|
409
515
|
function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) {
|
|
@@ -413,6 +519,7 @@ function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
|
|
|
413
519
|
var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope);
|
|
414
520
|
|
|
415
521
|
var source = node.parentNode === virtualRoot ? node : node.parentNode || node;
|
|
522
|
+
var edgeShape = seriesScope.edgeShape;
|
|
416
523
|
var sourceLayout;
|
|
417
524
|
while (sourceLayout = source.getLayout(), sourceLayout == null) {
|
|
418
525
|
source = source.parentNode === virtualRoot ? source : source.parentNode || source;
|
|
@@ -427,16 +534,42 @@ function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
|
|
|
427
534
|
|
|
428
535
|
symbolEl.fadeOut(null, {keepLabel: true});
|
|
429
536
|
|
|
430
|
-
var
|
|
537
|
+
var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);
|
|
538
|
+
var sourceEdge = sourceSymbolEl.__edge;
|
|
539
|
+
|
|
540
|
+
// 1. when expand the sub tree, delete the children node should delete the edge of
|
|
541
|
+
// the source at the same time. because the polyline edge shape is only owned by the source.
|
|
542
|
+
// 2.when the node is the only children of the source, delete the node should delete the edge of
|
|
543
|
+
// the source at the same time. the same reason as above.
|
|
544
|
+
var edge = symbolEl.__edge
|
|
545
|
+
|| ((source.isExpand === false || source.children.length === 1) ? sourceEdge : undefined);
|
|
546
|
+
|
|
547
|
+
var edgeShape = seriesScope.edgeShape;
|
|
548
|
+
|
|
431
549
|
if (edge) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
550
|
+
if (edgeShape === 'curve') {
|
|
551
|
+
graphic.updateProps(edge, {
|
|
552
|
+
shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout),
|
|
553
|
+
style: {
|
|
554
|
+
opacity: 0
|
|
555
|
+
}
|
|
556
|
+
}, seriesModel, function () {
|
|
557
|
+
group.remove(edge);
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
else if (edgeShape === 'polyline' && seriesScope.layout === 'orthogonal') {
|
|
561
|
+
graphic.updateProps(edge, {
|
|
562
|
+
shape: {
|
|
563
|
+
parentPoint: [sourceLayout.x, sourceLayout.y],
|
|
564
|
+
childPoints: [[sourceLayout.x, sourceLayout.y]]
|
|
565
|
+
},
|
|
566
|
+
style: {
|
|
567
|
+
opacity: 0
|
|
568
|
+
}
|
|
569
|
+
}, seriesModel, function () {
|
|
570
|
+
group.remove(edge);
|
|
571
|
+
});
|
|
572
|
+
}
|
|
440
573
|
}
|
|
441
574
|
}
|
|
442
575
|
|
|
@@ -504,4 +637,4 @@ function getEdgeShape(seriesScope, sourceLayout, targetLayout) {
|
|
|
504
637
|
cpy2: cpy2
|
|
505
638
|
};
|
|
506
639
|
|
|
507
|
-
}
|
|
640
|
+
}
|
|
@@ -182,16 +182,34 @@ export default SeriesModel.extend({
|
|
|
182
182
|
|
|
183
183
|
var levels = option.levels || [];
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
// Used in "visual priority" in `treemapVisual.js`.
|
|
186
|
+
// This way is a little tricky, must satisfy the precondition:
|
|
187
|
+
// 1. There is no `treeNode.getModel('itemStyle.xxx')` used.
|
|
188
|
+
// 2. The `Model.prototype.getModel()` will not use any clone-like way.
|
|
189
|
+
var designatedVisualItemStyle = this.designatedVisualItemStyle = {};
|
|
190
|
+
var designatedVisualModel = new Model({itemStyle: designatedVisualItemStyle}, this, ecModel);
|
|
188
191
|
|
|
189
|
-
|
|
192
|
+
levels = option.levels = setDefault(levels, ecModel);
|
|
193
|
+
var levelModels = zrUtil.map(levels || [], function (levelDefine) {
|
|
194
|
+
return new Model(levelDefine, designatedVisualModel, ecModel);
|
|
195
|
+
}, this);
|
|
190
196
|
|
|
191
197
|
// Make sure always a new tree is created when setOption,
|
|
192
198
|
// in TreemapView, we check whether oldTree === newTree
|
|
193
199
|
// to choose mappings approach among old shapes and new shapes.
|
|
194
|
-
|
|
200
|
+
var tree = Tree.createTree(root, this, beforeLink);
|
|
201
|
+
|
|
202
|
+
function beforeLink(nodeData) {
|
|
203
|
+
nodeData.wrapMethod('getItemModel', function (model, idx) {
|
|
204
|
+
var node = tree.getNodeByDataIndex(idx);
|
|
205
|
+
var levelModel = levelModels[node.depth];
|
|
206
|
+
// If no levelModel, we also need `designatedVisualModel`.
|
|
207
|
+
model.parentModel = levelModel || designatedVisualModel;
|
|
208
|
+
return model;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return tree.data;
|
|
195
213
|
},
|
|
196
214
|
|
|
197
215
|
optionUpdated: function () {
|
|
@@ -28,6 +28,7 @@ import BoundingRect from 'zrender/src/core/BoundingRect';
|
|
|
28
28
|
import * as matrix from 'zrender/src/core/matrix';
|
|
29
29
|
import * as animationUtil from '../../util/animation';
|
|
30
30
|
import makeStyleMapper from '../../model/mixin/makeStyleMapper';
|
|
31
|
+
import {windowOpen} from '../../util/format';
|
|
31
32
|
|
|
32
33
|
var bind = zrUtil.bind;
|
|
33
34
|
var Group = graphic.Group;
|
|
@@ -187,6 +188,7 @@ export default echarts.extendChartView({
|
|
|
187
188
|
var thisStorage = createStorage();
|
|
188
189
|
var oldStorage = this._storage;
|
|
189
190
|
var willInvisibleEls = [];
|
|
191
|
+
|
|
190
192
|
var doRenderNode = zrUtil.curry(
|
|
191
193
|
renderNode, seriesModel,
|
|
192
194
|
thisStorage, oldStorage, reRoot,
|
|
@@ -543,7 +545,7 @@ export default echarts.extendChartView({
|
|
|
543
545
|
var itemModel = node.hostTree.data.getItemModel(node.dataIndex);
|
|
544
546
|
var link = itemModel.get('link', true);
|
|
545
547
|
var linkTarget = itemModel.get('target', true) || 'blank';
|
|
546
|
-
link &&
|
|
548
|
+
link && windowOpen(link, linkTarget);
|
|
547
549
|
}
|
|
548
550
|
}
|
|
549
551
|
|
|
@@ -685,6 +687,11 @@ function renderNode(
|
|
|
685
687
|
// Start of closure variables available in "Procedures in renderNode".
|
|
686
688
|
|
|
687
689
|
var thisLayout = thisNode.getLayout();
|
|
690
|
+
var data = seriesModel.getData();
|
|
691
|
+
|
|
692
|
+
// Only for enabling highlight/downplay. Clear firstly.
|
|
693
|
+
// Because some node will not be rendered.
|
|
694
|
+
data.setItemGraphicEl(thisNode.dataIndex, null);
|
|
688
695
|
|
|
689
696
|
if (!thisLayout || !thisLayout.isInView) {
|
|
690
697
|
return;
|
|
@@ -724,14 +731,36 @@ function renderNode(
|
|
|
724
731
|
return group;
|
|
725
732
|
}
|
|
726
733
|
|
|
734
|
+
var nodeModel = thisNode.getModel();
|
|
735
|
+
|
|
727
736
|
// Background
|
|
728
737
|
var bg = giveGraphic('background', Rect, depth, Z_BG);
|
|
729
|
-
bg && renderBackground(group, bg, isParent && thisLayout.
|
|
738
|
+
bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);
|
|
730
739
|
|
|
731
740
|
// No children, render content.
|
|
732
|
-
if (
|
|
741
|
+
if (isParent) {
|
|
742
|
+
// Because of the implementation about "traverse" in graphic hover style, we
|
|
743
|
+
// can not set hover listener on the "group" of non-leaf node. Otherwise the
|
|
744
|
+
// hover event from the descendents will be listenered.
|
|
745
|
+
if (graphic.isHighDownDispatcher(group)) {
|
|
746
|
+
graphic.setAsHighDownDispatcher(group, false);
|
|
747
|
+
}
|
|
748
|
+
if (bg) {
|
|
749
|
+
graphic.setAsHighDownDispatcher(bg, true);
|
|
750
|
+
// Only for enabling highlight/downplay.
|
|
751
|
+
data.setItemGraphicEl(thisNode.dataIndex, bg);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
else {
|
|
733
755
|
var content = giveGraphic('content', Rect, depth, Z_CONTENT);
|
|
734
756
|
content && renderContent(group, content);
|
|
757
|
+
|
|
758
|
+
if (bg && graphic.isHighDownDispatcher(bg)) {
|
|
759
|
+
graphic.setAsHighDownDispatcher(bg, false);
|
|
760
|
+
}
|
|
761
|
+
graphic.setAsHighDownDispatcher(group, true);
|
|
762
|
+
// Only for enabling highlight/downplay.
|
|
763
|
+
data.setItemGraphicEl(thisNode.dataIndex, group);
|
|
735
764
|
}
|
|
736
765
|
|
|
737
766
|
return group;
|
|
@@ -746,10 +775,17 @@ function renderNode(
|
|
|
746
775
|
bg.seriesIndex = seriesModel.seriesIndex;
|
|
747
776
|
|
|
748
777
|
bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight});
|
|
749
|
-
var visualBorderColor = thisNode.getVisual('borderColor', true);
|
|
750
|
-
var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');
|
|
751
778
|
|
|
752
|
-
|
|
779
|
+
if (thisInvisible) {
|
|
780
|
+
// If invisible, do not set visual, otherwise the element will
|
|
781
|
+
// change immediately before animation. We think it is OK to
|
|
782
|
+
// remain its origin color when moving out of the view window.
|
|
783
|
+
processInvisible(bg);
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
bg.invisible = false;
|
|
787
|
+
var visualBorderColor = thisNode.getVisual('borderColor', true);
|
|
788
|
+
var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');
|
|
753
789
|
var normalStyle = getItemStyleNormal(itemStyleNormalModel);
|
|
754
790
|
normalStyle.fill = visualBorderColor;
|
|
755
791
|
var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);
|
|
@@ -769,8 +805,8 @@ function renderNode(
|
|
|
769
805
|
}
|
|
770
806
|
|
|
771
807
|
bg.setStyle(normalStyle);
|
|
772
|
-
graphic.
|
|
773
|
-
}
|
|
808
|
+
graphic.setElementHoverStyle(bg, emphasisStyle);
|
|
809
|
+
}
|
|
774
810
|
|
|
775
811
|
group.add(bg);
|
|
776
812
|
}
|
|
@@ -791,8 +827,15 @@ function renderNode(
|
|
|
791
827
|
height: contentHeight
|
|
792
828
|
});
|
|
793
829
|
|
|
794
|
-
|
|
795
|
-
|
|
830
|
+
if (thisInvisible) {
|
|
831
|
+
// If invisible, do not set visual, otherwise the element will
|
|
832
|
+
// change immediately before animation. We think it is OK to
|
|
833
|
+
// remain its origin color when moving out of the view window.
|
|
834
|
+
processInvisible(content);
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
content.invisible = false;
|
|
838
|
+
var visualColor = thisNode.getVisual('color', true);
|
|
796
839
|
var normalStyle = getItemStyleNormal(itemStyleNormalModel);
|
|
797
840
|
normalStyle.fill = visualColor;
|
|
798
841
|
var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);
|
|
@@ -800,42 +843,20 @@ function renderNode(
|
|
|
800
843
|
prepareText(normalStyle, emphasisStyle, visualColor, contentWidth, contentHeight);
|
|
801
844
|
|
|
802
845
|
content.setStyle(normalStyle);
|
|
803
|
-
graphic.
|
|
804
|
-
}
|
|
846
|
+
graphic.setElementHoverStyle(content, emphasisStyle);
|
|
847
|
+
}
|
|
805
848
|
|
|
806
849
|
group.add(content);
|
|
807
850
|
}
|
|
808
851
|
|
|
809
|
-
function
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
// remain its origin color when moving out of the view window.
|
|
814
|
-
cb();
|
|
815
|
-
|
|
816
|
-
if (!element.__tmWillVisible) {
|
|
817
|
-
element.invisible = false;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
else {
|
|
821
|
-
// Delay invisible setting utill animation finished,
|
|
822
|
-
// avoid element vanish suddenly before animation.
|
|
823
|
-
!element.invisible && willInvisibleEls.push(element);
|
|
824
|
-
}
|
|
852
|
+
function processInvisible(element) {
|
|
853
|
+
// Delay invisible setting utill animation finished,
|
|
854
|
+
// avoid element vanish suddenly before animation.
|
|
855
|
+
!element.invisible && willInvisibleEls.push(element);
|
|
825
856
|
}
|
|
826
857
|
|
|
827
858
|
function prepareText(normalStyle, emphasisStyle, visualColor, width, height, upperLabelRect) {
|
|
828
|
-
var
|
|
829
|
-
var text = zrUtil.retrieve(
|
|
830
|
-
seriesModel.getFormattedLabel(
|
|
831
|
-
thisNode.dataIndex, 'normal', null, null, upperLabelRect ? 'upperLabel' : 'label'
|
|
832
|
-
),
|
|
833
|
-
nodeModel.get('name')
|
|
834
|
-
);
|
|
835
|
-
if (!upperLabelRect && thisLayout.isLeafRoot) {
|
|
836
|
-
var iconChar = seriesModel.get('drillDownIcon', true);
|
|
837
|
-
text = iconChar ? iconChar + ' ' + text : text;
|
|
838
|
-
}
|
|
859
|
+
var defaultText = nodeModel.get('name');
|
|
839
860
|
|
|
840
861
|
var normalLabelModel = nodeModel.getModel(
|
|
841
862
|
upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL
|
|
@@ -849,12 +870,18 @@ function renderNode(
|
|
|
849
870
|
graphic.setLabelStyle(
|
|
850
871
|
normalStyle, emphasisStyle, normalLabelModel, emphasisLabelModel,
|
|
851
872
|
{
|
|
852
|
-
defaultText: isShow ?
|
|
873
|
+
defaultText: isShow ? defaultText : null,
|
|
853
874
|
autoColor: visualColor,
|
|
854
|
-
isRectText: true
|
|
875
|
+
isRectText: true,
|
|
876
|
+
labelFetcher: seriesModel,
|
|
877
|
+
labelDataIndex: thisNode.dataIndex,
|
|
878
|
+
labelProp: upperLabelRect ? 'upperLabel' : 'label'
|
|
855
879
|
}
|
|
856
880
|
);
|
|
857
881
|
|
|
882
|
+
addDrillDownIcon(normalStyle, upperLabelRect, thisLayout);
|
|
883
|
+
addDrillDownIcon(emphasisStyle, upperLabelRect, thisLayout);
|
|
884
|
+
|
|
858
885
|
upperLabelRect && (normalStyle.textRect = zrUtil.clone(upperLabelRect));
|
|
859
886
|
|
|
860
887
|
normalStyle.truncate = (isShow && normalLabelModel.get('ellipsis'))
|
|
@@ -866,6 +893,14 @@ function renderNode(
|
|
|
866
893
|
: null;
|
|
867
894
|
}
|
|
868
895
|
|
|
896
|
+
function addDrillDownIcon(style, upperLabelRect, thisLayout) {
|
|
897
|
+
var text = style.text;
|
|
898
|
+
if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {
|
|
899
|
+
var iconChar = seriesModel.get('drillDownIcon', true);
|
|
900
|
+
style.text = iconChar ? iconChar + ' ' + text : text;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
869
904
|
function giveGraphic(storageName, Ctor, depth, z) {
|
|
870
905
|
var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];
|
|
871
906
|
var lasts = lastsForAnimation[storageName];
|
|
@@ -922,6 +957,7 @@ function renderNode(
|
|
|
922
957
|
// Fade in, user can be aware that these nodes are new.
|
|
923
958
|
lastCfg.fadein = storageName !== 'nodeGroup';
|
|
924
959
|
}
|
|
960
|
+
|
|
925
961
|
}
|
|
926
962
|
|
|
927
963
|
// We can not set all backgroud with the same z, Because the behaviour of
|
|
@@ -474,7 +474,7 @@ function position(row, rowFixedLength, rect, halfGapWidth, flush) {
|
|
|
474
474
|
rect[wh[idx1WhenH]] -= rowOtherLength;
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
// Return [containerWidth, containerHeight] as
|
|
477
|
+
// Return [containerWidth, containerHeight] as default.
|
|
478
478
|
function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
|
|
479
479
|
// If targetInfo.node exists, we zoom to the node,
|
|
480
480
|
// so estimate whold width and heigth by target node.
|
|
@@ -596,4 +596,4 @@ function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {
|
|
|
596
596
|
|
|
597
597
|
function getUpperLabelHeight(model) {
|
|
598
598
|
return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;
|
|
599
|
-
}
|
|
599
|
+
}
|
|
@@ -30,21 +30,14 @@ export default {
|
|
|
30
30
|
reset: function (seriesModel, ecModel, api, payload) {
|
|
31
31
|
var tree = seriesModel.getData().tree;
|
|
32
32
|
var root = tree.root;
|
|
33
|
-
var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL);
|
|
34
33
|
|
|
35
34
|
if (root.isRemoved()) {
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
var levelItemStyles = zrUtil.map(tree.levelModels, function (levelModel) {
|
|
40
|
-
return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null;
|
|
41
|
-
});
|
|
42
|
-
|
|
43
38
|
travelTree(
|
|
44
39
|
root, // Visual should calculate from tree root but not view root.
|
|
45
40
|
{},
|
|
46
|
-
levelItemStyles,
|
|
47
|
-
seriesItemStyleModel,
|
|
48
41
|
seriesModel.getViewRoot().getAncestors(),
|
|
49
42
|
seriesModel
|
|
50
43
|
);
|
|
@@ -52,8 +45,7 @@ export default {
|
|
|
52
45
|
};
|
|
53
46
|
|
|
54
47
|
function travelTree(
|
|
55
|
-
node, designatedVisual,
|
|
56
|
-
viewRootAncestors, seriesModel
|
|
48
|
+
node, designatedVisual, viewRootAncestors, seriesModel
|
|
57
49
|
) {
|
|
58
50
|
var nodeModel = node.getModel();
|
|
59
51
|
var nodeLayout = node.getLayout();
|
|
@@ -64,10 +56,7 @@ function travelTree(
|
|
|
64
56
|
}
|
|
65
57
|
|
|
66
58
|
var nodeItemStyleModel = node.getModel(ITEM_STYLE_NORMAL);
|
|
67
|
-
var
|
|
68
|
-
var visuals = buildVisuals(
|
|
69
|
-
nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel
|
|
70
|
-
);
|
|
59
|
+
var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);
|
|
71
60
|
|
|
72
61
|
// calculate border color
|
|
73
62
|
var borderColor = nodeItemStyleModel.get('borderColor');
|
|
@@ -100,27 +89,21 @@ function travelTree(
|
|
|
100
89
|
var childVisual = mapVisual(
|
|
101
90
|
nodeModel, visuals, child, index, mapping, seriesModel
|
|
102
91
|
);
|
|
103
|
-
travelTree(
|
|
104
|
-
child, childVisual, levelItemStyles, seriesItemStyleModel,
|
|
105
|
-
viewRootAncestors, seriesModel
|
|
106
|
-
);
|
|
92
|
+
travelTree(child, childVisual, viewRootAncestors, seriesModel);
|
|
107
93
|
}
|
|
108
94
|
});
|
|
109
95
|
}
|
|
110
96
|
}
|
|
111
97
|
|
|
112
|
-
function buildVisuals(
|
|
113
|
-
nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel
|
|
114
|
-
) {
|
|
98
|
+
function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {
|
|
115
99
|
var visuals = zrUtil.extend({}, designatedVisual);
|
|
100
|
+
var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;
|
|
116
101
|
|
|
117
102
|
zrUtil.each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {
|
|
118
103
|
// Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
val == null && (val = seriesItemStyleModel.get(visualName));
|
|
123
|
-
|
|
104
|
+
designatedVisualItemStyle[visualName] = designatedVisual[visualName];
|
|
105
|
+
var val = nodeItemStyleModel.get(visualName);
|
|
106
|
+
designatedVisualItemStyle[visualName] = null;
|
|
124
107
|
val != null && (visuals[visualName] = val);
|
|
125
108
|
});
|
|
126
109
|
|