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
|
@@ -42,6 +42,14 @@ var _cursorHelper = require("../../component/helper/cursorHelper");
|
|
|
42
42
|
|
|
43
43
|
var onIrrelevantElement = _cursorHelper.onIrrelevantElement;
|
|
44
44
|
|
|
45
|
+
var _config = require("../../config");
|
|
46
|
+
|
|
47
|
+
var __DEV__ = _config.__DEV__;
|
|
48
|
+
|
|
49
|
+
var _number = require("../../util/number");
|
|
50
|
+
|
|
51
|
+
var parsePercent = _number.parsePercent;
|
|
52
|
+
|
|
45
53
|
/*
|
|
46
54
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
47
55
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -60,6 +68,55 @@ var onIrrelevantElement = _cursorHelper.onIrrelevantElement;
|
|
|
60
68
|
* specific language governing permissions and limitations
|
|
61
69
|
* under the License.
|
|
62
70
|
*/
|
|
71
|
+
var TreeShape = graphic.extendShape({
|
|
72
|
+
shape: {
|
|
73
|
+
parentPoint: [],
|
|
74
|
+
childPoints: [],
|
|
75
|
+
orient: '',
|
|
76
|
+
forkPosition: ''
|
|
77
|
+
},
|
|
78
|
+
style: {
|
|
79
|
+
stroke: '#000',
|
|
80
|
+
fill: null
|
|
81
|
+
},
|
|
82
|
+
buildPath: function (ctx, shape) {
|
|
83
|
+
var childPoints = shape.childPoints;
|
|
84
|
+
var childLen = childPoints.length;
|
|
85
|
+
var parentPoint = shape.parentPoint;
|
|
86
|
+
var firstChildPos = childPoints[0];
|
|
87
|
+
var lastChildPos = childPoints[childLen - 1];
|
|
88
|
+
|
|
89
|
+
if (childLen === 1) {
|
|
90
|
+
ctx.moveTo(parentPoint[0], parentPoint[1]);
|
|
91
|
+
ctx.lineTo(firstChildPos[0], firstChildPos[1]);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var orient = shape.orient;
|
|
96
|
+
var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1;
|
|
97
|
+
var otherDim = 1 - forkDim;
|
|
98
|
+
var forkPosition = parsePercent(shape.forkPosition, 1);
|
|
99
|
+
var tmpPoint = [];
|
|
100
|
+
tmpPoint[forkDim] = parentPoint[forkDim];
|
|
101
|
+
tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;
|
|
102
|
+
ctx.moveTo(parentPoint[0], parentPoint[1]);
|
|
103
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
104
|
+
ctx.moveTo(firstChildPos[0], firstChildPos[1]);
|
|
105
|
+
tmpPoint[forkDim] = firstChildPos[forkDim];
|
|
106
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
107
|
+
tmpPoint[forkDim] = lastChildPos[forkDim];
|
|
108
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
109
|
+
ctx.lineTo(lastChildPos[0], lastChildPos[1]);
|
|
110
|
+
|
|
111
|
+
for (var i = 1; i < childLen - 1; i++) {
|
|
112
|
+
var point = childPoints[i];
|
|
113
|
+
ctx.moveTo(point[0], point[1]);
|
|
114
|
+
tmpPoint[forkDim] = point[forkDim];
|
|
115
|
+
ctx.lineTo(tmpPoint[0], tmpPoint[1]);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
63
120
|
var _default = echarts.extendChartView({
|
|
64
121
|
type: 'tree',
|
|
65
122
|
|
|
@@ -112,6 +169,8 @@ var _default = echarts.extendChartView({
|
|
|
112
169
|
var seriesScope = {
|
|
113
170
|
expandAndCollapse: seriesModel.get('expandAndCollapse'),
|
|
114
171
|
layout: layout,
|
|
172
|
+
edgeShape: seriesModel.get('edgeShape'),
|
|
173
|
+
edgeForkPosition: seriesModel.get('edgeForkPosition'),
|
|
115
174
|
orient: seriesModel.getOrient(),
|
|
116
175
|
curvature: seriesModel.get('lineStyle.curveness'),
|
|
117
176
|
symbolRotate: seriesModel.get('symbolRotate'),
|
|
@@ -387,27 +446,72 @@ function updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
|
|
|
387
446
|
});
|
|
388
447
|
}
|
|
389
448
|
|
|
390
|
-
|
|
391
|
-
|
|
449
|
+
drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group, seriesScope);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group, seriesScope) {
|
|
453
|
+
var edgeShape = seriesScope.edgeShape;
|
|
454
|
+
var edge = symbolEl.__edge;
|
|
455
|
+
|
|
456
|
+
if (edgeShape === 'curve') {
|
|
457
|
+
if (node.parentNode && node.parentNode !== virtualRoot) {
|
|
458
|
+
if (!edge) {
|
|
459
|
+
edge = symbolEl.__edge = new graphic.BezierCurve({
|
|
460
|
+
shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout),
|
|
461
|
+
style: zrUtil.defaults({
|
|
462
|
+
opacity: 0,
|
|
463
|
+
strokeNoScale: true
|
|
464
|
+
}, seriesScope.lineStyle)
|
|
465
|
+
});
|
|
466
|
+
}
|
|
392
467
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout),
|
|
468
|
+
graphic.updateProps(edge, {
|
|
469
|
+
shape: getEdgeShape(seriesScope, sourceLayout, targetLayout),
|
|
396
470
|
style: zrUtil.defaults({
|
|
397
|
-
opacity:
|
|
398
|
-
strokeNoScale: true
|
|
471
|
+
opacity: 1
|
|
399
472
|
}, seriesScope.lineStyle)
|
|
400
|
-
});
|
|
473
|
+
}, seriesModel);
|
|
401
474
|
}
|
|
475
|
+
} else if (edgeShape === 'polyline') {
|
|
476
|
+
if (seriesScope.layout === 'orthogonal') {
|
|
477
|
+
if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {
|
|
478
|
+
var children = node.children;
|
|
479
|
+
var childPoints = [];
|
|
480
|
+
|
|
481
|
+
for (var i = 0; i < children.length; i++) {
|
|
482
|
+
var childLayout = children[i].getLayout();
|
|
483
|
+
childPoints.push([childLayout.x, childLayout.y]);
|
|
484
|
+
}
|
|
402
485
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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({
|
|
495
|
+
opacity: 0,
|
|
496
|
+
strokeNoScale: true
|
|
497
|
+
}, seriesScope.lineStyle)
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
graphic.updateProps(edge, {
|
|
502
|
+
shape: {
|
|
503
|
+
parentPoint: [targetLayout.x, targetLayout.y],
|
|
504
|
+
childPoints: childPoints
|
|
505
|
+
},
|
|
506
|
+
style: zrUtil.defaults({
|
|
507
|
+
opacity: 1
|
|
508
|
+
}, seriesScope.lineStyle)
|
|
509
|
+
}, seriesModel);
|
|
407
510
|
}
|
|
408
|
-
}
|
|
409
|
-
group.add(edge);
|
|
511
|
+
} else {}
|
|
410
512
|
}
|
|
513
|
+
|
|
514
|
+
group.add(edge);
|
|
411
515
|
}
|
|
412
516
|
|
|
413
517
|
function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) {
|
|
@@ -416,6 +520,7 @@ function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
|
|
|
416
520
|
var itemModel = node.getModel();
|
|
417
521
|
var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope);
|
|
418
522
|
var source = node.parentNode === virtualRoot ? node : node.parentNode || node;
|
|
523
|
+
var edgeShape = seriesScope.edgeShape;
|
|
419
524
|
var sourceLayout;
|
|
420
525
|
|
|
421
526
|
while (sourceLayout = source.getLayout(), sourceLayout == null) {
|
|
@@ -431,17 +536,38 @@ function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope)
|
|
|
431
536
|
symbolEl.fadeOut(null, {
|
|
432
537
|
keepLabel: true
|
|
433
538
|
});
|
|
434
|
-
var
|
|
539
|
+
var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);
|
|
540
|
+
var sourceEdge = sourceSymbolEl.__edge; // 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
|
+
|
|
545
|
+
var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined);
|
|
546
|
+
var edgeShape = seriesScope.edgeShape;
|
|
435
547
|
|
|
436
548
|
if (edge) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
549
|
+
if (edgeShape === 'curve') {
|
|
550
|
+
graphic.updateProps(edge, {
|
|
551
|
+
shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout),
|
|
552
|
+
style: {
|
|
553
|
+
opacity: 0
|
|
554
|
+
}
|
|
555
|
+
}, seriesModel, function () {
|
|
556
|
+
group.remove(edge);
|
|
557
|
+
});
|
|
558
|
+
} else if (edgeShape === 'polyline' && seriesScope.layout === 'orthogonal') {
|
|
559
|
+
graphic.updateProps(edge, {
|
|
560
|
+
shape: {
|
|
561
|
+
parentPoint: [sourceLayout.x, sourceLayout.y],
|
|
562
|
+
childPoints: [[sourceLayout.x, sourceLayout.y]]
|
|
563
|
+
},
|
|
564
|
+
style: {
|
|
565
|
+
opacity: 0
|
|
566
|
+
}
|
|
567
|
+
}, seriesModel, function () {
|
|
568
|
+
group.remove(edge);
|
|
569
|
+
});
|
|
570
|
+
}
|
|
445
571
|
}
|
|
446
572
|
}
|
|
447
573
|
|
|
@@ -226,14 +226,35 @@ var _default = SeriesModel.extend({
|
|
|
226
226
|
children: option.data
|
|
227
227
|
};
|
|
228
228
|
completeTreeValue(root);
|
|
229
|
-
var levels = option.levels || [];
|
|
229
|
+
var levels = option.levels || []; // Used in "visual priority" in `treemapVisual.js`.
|
|
230
|
+
// This way is a little tricky, must satisfy the precondition:
|
|
231
|
+
// 1. There is no `treeNode.getModel('itemStyle.xxx')` used.
|
|
232
|
+
// 2. The `Model.prototype.getModel()` will not use any clone-like way.
|
|
233
|
+
|
|
234
|
+
var designatedVisualItemStyle = this.designatedVisualItemStyle = {};
|
|
235
|
+
var designatedVisualModel = new Model({
|
|
236
|
+
itemStyle: designatedVisualItemStyle
|
|
237
|
+
}, this, ecModel);
|
|
230
238
|
levels = option.levels = setDefault(levels, ecModel);
|
|
231
|
-
var
|
|
232
|
-
|
|
239
|
+
var levelModels = zrUtil.map(levels || [], function (levelDefine) {
|
|
240
|
+
return new Model(levelDefine, designatedVisualModel, ecModel);
|
|
241
|
+
}, this); // Make sure always a new tree is created when setOption,
|
|
233
242
|
// in TreemapView, we check whether oldTree === newTree
|
|
234
243
|
// to choose mappings approach among old shapes and new shapes.
|
|
235
244
|
|
|
236
|
-
|
|
245
|
+
var tree = Tree.createTree(root, this, beforeLink);
|
|
246
|
+
|
|
247
|
+
function beforeLink(nodeData) {
|
|
248
|
+
nodeData.wrapMethod('getItemModel', function (model, idx) {
|
|
249
|
+
var node = tree.getNodeByDataIndex(idx);
|
|
250
|
+
var levelModel = levelModels[node.depth]; // If no levelModel, we also need `designatedVisualModel`.
|
|
251
|
+
|
|
252
|
+
model.parentModel = levelModel || designatedVisualModel;
|
|
253
|
+
return model;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return tree.data;
|
|
237
258
|
},
|
|
238
259
|
optionUpdated: function () {
|
|
239
260
|
this.resetViewRoot();
|
|
@@ -40,6 +40,10 @@ var animationUtil = require("../../util/animation");
|
|
|
40
40
|
|
|
41
41
|
var makeStyleMapper = require("../../model/mixin/makeStyleMapper");
|
|
42
42
|
|
|
43
|
+
var _format = require("../../util/format");
|
|
44
|
+
|
|
45
|
+
var windowOpen = _format.windowOpen;
|
|
46
|
+
|
|
43
47
|
/*
|
|
44
48
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
45
49
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -529,7 +533,7 @@ var _default = echarts.extendChartView({
|
|
|
529
533
|
var itemModel = node.hostTree.data.getItemModel(node.dataIndex);
|
|
530
534
|
var link = itemModel.get('link', true);
|
|
531
535
|
var linkTarget = itemModel.get('target', true) || 'blank';
|
|
532
|
-
link &&
|
|
536
|
+
link && windowOpen(link, linkTarget);
|
|
533
537
|
}
|
|
534
538
|
}
|
|
535
539
|
}, this);
|
|
@@ -673,6 +677,10 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimat
|
|
|
673
677
|
|
|
674
678
|
|
|
675
679
|
var thisLayout = thisNode.getLayout();
|
|
680
|
+
var data = seriesModel.getData(); // Only for enabling highlight/downplay. Clear firstly.
|
|
681
|
+
// Because some node will not be rendered.
|
|
682
|
+
|
|
683
|
+
data.setItemGraphicEl(thisNode.dataIndex, null);
|
|
676
684
|
|
|
677
685
|
if (!thisLayout || !thisLayout.isInView) {
|
|
678
686
|
return;
|
|
@@ -706,15 +714,37 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimat
|
|
|
706
714
|
|
|
707
715
|
if (thisLayout.isAboveViewRoot) {
|
|
708
716
|
return group;
|
|
709
|
-
}
|
|
717
|
+
}
|
|
710
718
|
|
|
719
|
+
var nodeModel = thisNode.getModel(); // Background
|
|
711
720
|
|
|
712
721
|
var bg = giveGraphic('background', Rect, depth, Z_BG);
|
|
713
|
-
bg && renderBackground(group, bg, isParent && thisLayout.
|
|
722
|
+
bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight); // No children, render content.
|
|
723
|
+
|
|
724
|
+
if (isParent) {
|
|
725
|
+
// Because of the implementation about "traverse" in graphic hover style, we
|
|
726
|
+
// can not set hover listener on the "group" of non-leaf node. Otherwise the
|
|
727
|
+
// hover event from the descendents will be listenered.
|
|
728
|
+
if (graphic.isHighDownDispatcher(group)) {
|
|
729
|
+
graphic.setAsHighDownDispatcher(group, false);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (bg) {
|
|
733
|
+
graphic.setAsHighDownDispatcher(bg, true); // Only for enabling highlight/downplay.
|
|
714
734
|
|
|
715
|
-
|
|
735
|
+
data.setItemGraphicEl(thisNode.dataIndex, bg);
|
|
736
|
+
}
|
|
737
|
+
} else {
|
|
716
738
|
var content = giveGraphic('content', Rect, depth, Z_CONTENT);
|
|
717
739
|
content && renderContent(group, content);
|
|
740
|
+
|
|
741
|
+
if (bg && graphic.isHighDownDispatcher(bg)) {
|
|
742
|
+
graphic.setAsHighDownDispatcher(bg, false);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
graphic.setAsHighDownDispatcher(group, true); // Only for enabling highlight/downplay.
|
|
746
|
+
|
|
747
|
+
data.setItemGraphicEl(thisNode.dataIndex, group);
|
|
718
748
|
}
|
|
719
749
|
|
|
720
750
|
return group; // ----------------------------
|
|
@@ -731,9 +761,16 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimat
|
|
|
731
761
|
width: thisWidth,
|
|
732
762
|
height: thisHeight
|
|
733
763
|
});
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
764
|
+
|
|
765
|
+
if (thisInvisible) {
|
|
766
|
+
// If invisible, do not set visual, otherwise the element will
|
|
767
|
+
// change immediately before animation. We think it is OK to
|
|
768
|
+
// remain its origin color when moving out of the view window.
|
|
769
|
+
processInvisible(bg);
|
|
770
|
+
} else {
|
|
771
|
+
bg.invisible = false;
|
|
772
|
+
var visualBorderColor = thisNode.getVisual('borderColor', true);
|
|
773
|
+
var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');
|
|
737
774
|
var normalStyle = getItemStyleNormal(itemStyleNormalModel);
|
|
738
775
|
normalStyle.fill = visualBorderColor;
|
|
739
776
|
var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);
|
|
@@ -753,8 +790,9 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimat
|
|
|
753
790
|
}
|
|
754
791
|
|
|
755
792
|
bg.setStyle(normalStyle);
|
|
756
|
-
graphic.
|
|
757
|
-
}
|
|
793
|
+
graphic.setElementHoverStyle(bg, emphasisStyle);
|
|
794
|
+
}
|
|
795
|
+
|
|
758
796
|
group.add(bg);
|
|
759
797
|
}
|
|
760
798
|
|
|
@@ -771,52 +809,47 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimat
|
|
|
771
809
|
width: contentWidth,
|
|
772
810
|
height: contentHeight
|
|
773
811
|
});
|
|
774
|
-
|
|
775
|
-
|
|
812
|
+
|
|
813
|
+
if (thisInvisible) {
|
|
814
|
+
// If invisible, do not set visual, otherwise the element will
|
|
815
|
+
// change immediately before animation. We think it is OK to
|
|
816
|
+
// remain its origin color when moving out of the view window.
|
|
817
|
+
processInvisible(content);
|
|
818
|
+
} else {
|
|
819
|
+
content.invisible = false;
|
|
820
|
+
var visualColor = thisNode.getVisual('color', true);
|
|
776
821
|
var normalStyle = getItemStyleNormal(itemStyleNormalModel);
|
|
777
822
|
normalStyle.fill = visualColor;
|
|
778
823
|
var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel);
|
|
779
824
|
prepareText(normalStyle, emphasisStyle, visualColor, contentWidth, contentHeight);
|
|
780
825
|
content.setStyle(normalStyle);
|
|
781
|
-
graphic.
|
|
782
|
-
}
|
|
826
|
+
graphic.setElementHoverStyle(content, emphasisStyle);
|
|
827
|
+
}
|
|
828
|
+
|
|
783
829
|
group.add(content);
|
|
784
830
|
}
|
|
785
831
|
|
|
786
|
-
function
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
// remain its origin color when moving out of the view window.
|
|
791
|
-
cb();
|
|
792
|
-
|
|
793
|
-
if (!element.__tmWillVisible) {
|
|
794
|
-
element.invisible = false;
|
|
795
|
-
}
|
|
796
|
-
} else {
|
|
797
|
-
// Delay invisible setting utill animation finished,
|
|
798
|
-
// avoid element vanish suddenly before animation.
|
|
799
|
-
!element.invisible && willInvisibleEls.push(element);
|
|
800
|
-
}
|
|
832
|
+
function processInvisible(element) {
|
|
833
|
+
// Delay invisible setting utill animation finished,
|
|
834
|
+
// avoid element vanish suddenly before animation.
|
|
835
|
+
!element.invisible && willInvisibleEls.push(element);
|
|
801
836
|
}
|
|
802
837
|
|
|
803
838
|
function prepareText(normalStyle, emphasisStyle, visualColor, width, height, upperLabelRect) {
|
|
804
|
-
var
|
|
805
|
-
var text = zrUtil.retrieve(seriesModel.getFormattedLabel(thisNode.dataIndex, 'normal', null, null, upperLabelRect ? 'upperLabel' : 'label'), nodeModel.get('name'));
|
|
806
|
-
|
|
807
|
-
if (!upperLabelRect && thisLayout.isLeafRoot) {
|
|
808
|
-
var iconChar = seriesModel.get('drillDownIcon', true);
|
|
809
|
-
text = iconChar ? iconChar + ' ' + text : text;
|
|
810
|
-
}
|
|
811
|
-
|
|
839
|
+
var defaultText = nodeModel.get('name');
|
|
812
840
|
var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);
|
|
813
841
|
var emphasisLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_EMPHASIS : PATH_LABEL_EMPHASIS);
|
|
814
842
|
var isShow = normalLabelModel.getShallow('show');
|
|
815
843
|
graphic.setLabelStyle(normalStyle, emphasisStyle, normalLabelModel, emphasisLabelModel, {
|
|
816
|
-
defaultText: isShow ?
|
|
844
|
+
defaultText: isShow ? defaultText : null,
|
|
817
845
|
autoColor: visualColor,
|
|
818
|
-
isRectText: true
|
|
846
|
+
isRectText: true,
|
|
847
|
+
labelFetcher: seriesModel,
|
|
848
|
+
labelDataIndex: thisNode.dataIndex,
|
|
849
|
+
labelProp: upperLabelRect ? 'upperLabel' : 'label'
|
|
819
850
|
});
|
|
851
|
+
addDrillDownIcon(normalStyle, upperLabelRect, thisLayout);
|
|
852
|
+
addDrillDownIcon(emphasisStyle, upperLabelRect, thisLayout);
|
|
820
853
|
upperLabelRect && (normalStyle.textRect = zrUtil.clone(upperLabelRect));
|
|
821
854
|
normalStyle.truncate = isShow && normalLabelModel.get('ellipsis') ? {
|
|
822
855
|
outerWidth: width,
|
|
@@ -825,6 +858,15 @@ function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimat
|
|
|
825
858
|
} : null;
|
|
826
859
|
}
|
|
827
860
|
|
|
861
|
+
function addDrillDownIcon(style, upperLabelRect, thisLayout) {
|
|
862
|
+
var text = style.text;
|
|
863
|
+
|
|
864
|
+
if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {
|
|
865
|
+
var iconChar = seriesModel.get('drillDownIcon', true);
|
|
866
|
+
style.text = iconChar ? iconChar + ' ' + text : text;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
828
870
|
function giveGraphic(storageName, Ctor, depth, z) {
|
|
829
871
|
var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];
|
|
830
872
|
var lasts = lastsForAnimation[storageName];
|
|
@@ -445,7 +445,7 @@ function position(row, rowFixedLength, rect, halfGapWidth, flush) {
|
|
|
445
445
|
|
|
446
446
|
rect[xy[idx1WhenH]] += rowOtherLength;
|
|
447
447
|
rect[wh[idx1WhenH]] -= rowOtherLength;
|
|
448
|
-
} // Return [containerWidth, containerHeight] as
|
|
448
|
+
} // Return [containerWidth, containerHeight] as default.
|
|
449
449
|
|
|
450
450
|
|
|
451
451
|
function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
|
|
@@ -49,21 +49,17 @@ var _default = {
|
|
|
49
49
|
reset: function (seriesModel, ecModel, api, payload) {
|
|
50
50
|
var tree = seriesModel.getData().tree;
|
|
51
51
|
var root = tree.root;
|
|
52
|
-
var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL);
|
|
53
52
|
|
|
54
53
|
if (root.isRemoved()) {
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
var levelItemStyles = zrUtil.map(tree.levelModels, function (levelModel) {
|
|
59
|
-
return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null;
|
|
60
|
-
});
|
|
61
57
|
travelTree(root, // Visual should calculate from tree root but not view root.
|
|
62
|
-
{},
|
|
58
|
+
{}, seriesModel.getViewRoot().getAncestors(), seriesModel);
|
|
63
59
|
}
|
|
64
60
|
};
|
|
65
61
|
|
|
66
|
-
function travelTree(node, designatedVisual,
|
|
62
|
+
function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {
|
|
67
63
|
var nodeModel = node.getModel();
|
|
68
64
|
var nodeLayout = node.getLayout(); // Optimize
|
|
69
65
|
|
|
@@ -72,8 +68,7 @@ function travelTree(node, designatedVisual, levelItemStyles, seriesItemStyleMode
|
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
var nodeItemStyleModel = node.getModel(ITEM_STYLE_NORMAL);
|
|
75
|
-
var
|
|
76
|
-
var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel); // calculate border color
|
|
71
|
+
var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel); // calculate border color
|
|
77
72
|
|
|
78
73
|
var borderColor = nodeItemStyleModel.get('borderColor');
|
|
79
74
|
var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');
|
|
@@ -99,21 +94,20 @@ function travelTree(node, designatedVisual, levelItemStyles, seriesItemStyleMode
|
|
|
99
94
|
// If higher than viewRoot, only ancestors of viewRoot is needed to visit.
|
|
100
95
|
if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {
|
|
101
96
|
var childVisual = mapVisual(nodeModel, visuals, child, index, mapping, seriesModel);
|
|
102
|
-
travelTree(child, childVisual,
|
|
97
|
+
travelTree(child, childVisual, viewRootAncestors, seriesModel);
|
|
103
98
|
}
|
|
104
99
|
});
|
|
105
100
|
}
|
|
106
101
|
}
|
|
107
102
|
|
|
108
|
-
function buildVisuals(nodeItemStyleModel, designatedVisual,
|
|
103
|
+
function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {
|
|
109
104
|
var visuals = zrUtil.extend({}, designatedVisual);
|
|
105
|
+
var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;
|
|
110
106
|
zrUtil.each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {
|
|
111
107
|
// Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
val == null && (val = designatedVisual[visualName]);
|
|
116
|
-
val == null && (val = seriesItemStyleModel.get(visualName));
|
|
108
|
+
designatedVisualItemStyle[visualName] = designatedVisual[visualName];
|
|
109
|
+
var val = nodeItemStyleModel.get(visualName);
|
|
110
|
+
designatedVisualItemStyle[visualName] = null;
|
|
117
111
|
val != null && (visuals[visualName] = val);
|
|
118
112
|
});
|
|
119
113
|
return visuals;
|
|
@@ -46,7 +46,7 @@ var AxisBuilder = require("./AxisBuilder");
|
|
|
46
46
|
* specific language governing permissions and limitations
|
|
47
47
|
* under the License.
|
|
48
48
|
*/
|
|
49
|
-
var elementList = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea'];
|
|
49
|
+
var elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];
|
|
50
50
|
|
|
51
51
|
function getAxisLineShape(polar, rExtent, angle) {
|
|
52
52
|
rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());
|
|
@@ -89,6 +89,7 @@ var _default = AxisView.extend({
|
|
|
89
89
|
var polar = angleAxis.polar;
|
|
90
90
|
var radiusExtent = polar.getRadiusAxis().getExtent();
|
|
91
91
|
var ticksAngles = angleAxis.getTicksCoords();
|
|
92
|
+
var minorTickAngles = angleAxis.getMinorTicksCoords();
|
|
92
93
|
var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {
|
|
93
94
|
var labelItem = zrUtil.clone(labelItem);
|
|
94
95
|
labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue);
|
|
@@ -98,7 +99,7 @@ var _default = AxisView.extend({
|
|
|
98
99
|
fixAngleOverlap(ticksAngles);
|
|
99
100
|
zrUtil.each(elementList, function (name) {
|
|
100
101
|
if (angleAxisModel.get(name + '.show') && (!angleAxis.scale.isBlank() || name === 'axisLine')) {
|
|
101
|
-
this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels);
|
|
102
|
+
this['_' + name](angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);
|
|
102
103
|
}
|
|
103
104
|
}, this);
|
|
104
105
|
},
|
|
@@ -106,7 +107,7 @@ var _default = AxisView.extend({
|
|
|
106
107
|
/**
|
|
107
108
|
* @private
|
|
108
109
|
*/
|
|
109
|
-
_axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
|
|
110
|
+
_axisLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
110
111
|
var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle'); // extent id of the axis radius (r0 and r)
|
|
111
112
|
|
|
112
113
|
var rId = getRadiusIdx(polar);
|
|
@@ -145,7 +146,7 @@ var _default = AxisView.extend({
|
|
|
145
146
|
/**
|
|
146
147
|
* @private
|
|
147
148
|
*/
|
|
148
|
-
_axisTick: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
|
|
149
|
+
_axisTick: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
149
150
|
var tickModel = angleAxisModel.getModel('axisTick');
|
|
150
151
|
var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');
|
|
151
152
|
var radius = radiusExtent[getRadiusIdx(polar)];
|
|
@@ -164,7 +165,36 @@ var _default = AxisView.extend({
|
|
|
164
165
|
/**
|
|
165
166
|
* @private
|
|
166
167
|
*/
|
|
167
|
-
|
|
168
|
+
_minorTick: function (angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {
|
|
169
|
+
if (!minorTickAngles.length) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
var tickModel = angleAxisModel.getModel('axisTick');
|
|
174
|
+
var minorTickModel = angleAxisModel.getModel('minorTick');
|
|
175
|
+
var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');
|
|
176
|
+
var radius = radiusExtent[getRadiusIdx(polar)];
|
|
177
|
+
var lines = [];
|
|
178
|
+
|
|
179
|
+
for (var i = 0; i < minorTickAngles.length; i++) {
|
|
180
|
+
for (var k = 0; k < minorTickAngles[i].length; k++) {
|
|
181
|
+
lines.push(new graphic.Line({
|
|
182
|
+
shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
this.group.add(graphic.mergePath(lines, {
|
|
188
|
+
style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {
|
|
189
|
+
stroke: angleAxisModel.get('axisLine.lineStyle.color')
|
|
190
|
+
}))
|
|
191
|
+
}));
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @private
|
|
196
|
+
*/
|
|
197
|
+
_axisLabel: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {
|
|
168
198
|
var rawCategoryData = angleAxisModel.getCategories(true);
|
|
169
199
|
var commonLabelModel = angleAxisModel.getModel('axisLabel');
|
|
170
200
|
var labelMargin = commonLabelModel.get('margin');
|
|
@@ -208,7 +238,7 @@ var _default = AxisView.extend({
|
|
|
208
238
|
/**
|
|
209
239
|
* @private
|
|
210
240
|
*/
|
|
211
|
-
_splitLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
|
|
241
|
+
_splitLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
212
242
|
var splitLineModel = angleAxisModel.getModel('splitLine');
|
|
213
243
|
var lineStyleModel = splitLineModel.getModel('lineStyle');
|
|
214
244
|
var lineColors = lineStyleModel.get('color');
|
|
@@ -240,7 +270,34 @@ var _default = AxisView.extend({
|
|
|
240
270
|
/**
|
|
241
271
|
* @private
|
|
242
272
|
*/
|
|
243
|
-
|
|
273
|
+
_minorSplitLine: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
274
|
+
if (!minorTickAngles.length) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');
|
|
279
|
+
var lineStyleModel = minorSplitLineModel.getModel('lineStyle');
|
|
280
|
+
var lines = [];
|
|
281
|
+
|
|
282
|
+
for (var i = 0; i < minorTickAngles.length; i++) {
|
|
283
|
+
for (var k = 0; k < minorTickAngles[i].length; k++) {
|
|
284
|
+
lines.push(new graphic.Line({
|
|
285
|
+
shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
this.group.add(graphic.mergePath(lines, {
|
|
291
|
+
style: lineStyleModel.getLineStyle(),
|
|
292
|
+
silent: true,
|
|
293
|
+
z: angleAxisModel.get('z')
|
|
294
|
+
}));
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @private
|
|
299
|
+
*/
|
|
300
|
+
_splitArea: function (angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
|
|
244
301
|
if (!ticksAngles.length) {
|
|
245
302
|
return;
|
|
246
303
|
}
|