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
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* under the License.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
var _config = require("../../config");
|
|
22
|
+
|
|
23
|
+
var __DEV__ = _config.__DEV__;
|
|
24
|
+
|
|
21
25
|
var layout = require("../../util/layout");
|
|
22
26
|
|
|
23
27
|
var _number = require("../../util/number");
|
|
@@ -79,6 +83,7 @@ function labelLayout(data) {
|
|
|
79
83
|
var itemModel = data.getItemModel(idx);
|
|
80
84
|
var labelModel = itemModel.getModel('label');
|
|
81
85
|
var labelPosition = labelModel.get('position');
|
|
86
|
+
var orient = itemModel.get('orient');
|
|
82
87
|
var labelLineModel = itemModel.getModel('labelLine');
|
|
83
88
|
var layout = data.getItemLayout(idx);
|
|
84
89
|
var points = layout.points;
|
|
@@ -108,6 +113,7 @@ function labelLayout(data) {
|
|
|
108
113
|
var x1;
|
|
109
114
|
var y1;
|
|
110
115
|
var x2;
|
|
116
|
+
var y2;
|
|
111
117
|
var labelLineLen = labelLineModel.get('length');
|
|
112
118
|
|
|
113
119
|
if (labelPosition === 'left') {
|
|
@@ -124,46 +130,101 @@ function labelLayout(data) {
|
|
|
124
130
|
x2 = x1 + labelLineLen;
|
|
125
131
|
textX = x2 + 5;
|
|
126
132
|
textAlign = 'left';
|
|
133
|
+
} else if (labelPosition === 'top') {
|
|
134
|
+
// Top side
|
|
135
|
+
x1 = (points[3][0] + points[0][0]) / 2;
|
|
136
|
+
y1 = (points[3][1] + points[0][1]) / 2;
|
|
137
|
+
y2 = y1 - labelLineLen;
|
|
138
|
+
textY = y2 - 5;
|
|
139
|
+
textAlign = 'center';
|
|
140
|
+
} else if (labelPosition === 'bottom') {
|
|
141
|
+
// Bottom side
|
|
142
|
+
x1 = (points[1][0] + points[2][0]) / 2;
|
|
143
|
+
y1 = (points[1][1] + points[2][1]) / 2;
|
|
144
|
+
y2 = y1 + labelLineLen;
|
|
145
|
+
textY = y2 + 5;
|
|
146
|
+
textAlign = 'center';
|
|
127
147
|
} else if (labelPosition === 'rightTop') {
|
|
128
148
|
// RightTop side
|
|
129
|
-
x1 = points[1][0];
|
|
130
|
-
y1 = points[1][1];
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
149
|
+
x1 = orient === 'horizontal' ? points[3][0] : points[1][0];
|
|
150
|
+
y1 = orient === 'horizontal' ? points[3][1] : points[1][1];
|
|
151
|
+
|
|
152
|
+
if (orient === 'horizontal') {
|
|
153
|
+
y2 = y1 - labelLineLen;
|
|
154
|
+
textY = y2 - 5;
|
|
155
|
+
textAlign = 'center';
|
|
156
|
+
} else {
|
|
157
|
+
x2 = x1 + labelLineLen;
|
|
158
|
+
textX = x2 + 5;
|
|
159
|
+
textAlign = 'top';
|
|
160
|
+
}
|
|
134
161
|
} else if (labelPosition === 'rightBottom') {
|
|
135
162
|
// RightBottom side
|
|
136
163
|
x1 = points[2][0];
|
|
137
164
|
y1 = points[2][1];
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
165
|
+
|
|
166
|
+
if (orient === 'horizontal') {
|
|
167
|
+
y2 = y1 + labelLineLen;
|
|
168
|
+
textY = y2 + 5;
|
|
169
|
+
textAlign = 'center';
|
|
170
|
+
} else {
|
|
171
|
+
x2 = x1 + labelLineLen;
|
|
172
|
+
textX = x2 + 5;
|
|
173
|
+
textAlign = 'bottom';
|
|
174
|
+
}
|
|
141
175
|
} else if (labelPosition === 'leftTop') {
|
|
142
176
|
// LeftTop side
|
|
143
177
|
x1 = points[0][0];
|
|
144
|
-
y1 = points[1][1];
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
178
|
+
y1 = orient === 'horizontal' ? points[0][1] : points[1][1];
|
|
179
|
+
|
|
180
|
+
if (orient === 'horizontal') {
|
|
181
|
+
y2 = y1 - labelLineLen;
|
|
182
|
+
textY = y2 - 5;
|
|
183
|
+
textAlign = 'center';
|
|
184
|
+
} else {
|
|
185
|
+
x2 = x1 - labelLineLen;
|
|
186
|
+
textX = x2 - 5;
|
|
187
|
+
textAlign = 'right';
|
|
188
|
+
}
|
|
148
189
|
} else if (labelPosition === 'leftBottom') {
|
|
149
190
|
// LeftBottom side
|
|
150
|
-
x1 = points[3][0];
|
|
151
|
-
y1 = points[2][1];
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
191
|
+
x1 = orient === 'horizontal' ? points[1][0] : points[3][0];
|
|
192
|
+
y1 = orient === 'horizontal' ? points[1][1] : points[2][1];
|
|
193
|
+
|
|
194
|
+
if (orient === 'horizontal') {
|
|
195
|
+
y2 = y1 + labelLineLen;
|
|
196
|
+
textY = y2 + 5;
|
|
197
|
+
textAlign = 'center';
|
|
198
|
+
} else {
|
|
199
|
+
x2 = x1 - labelLineLen;
|
|
200
|
+
textX = x2 - 5;
|
|
201
|
+
textAlign = 'right';
|
|
202
|
+
}
|
|
155
203
|
} else {
|
|
156
|
-
// Right side
|
|
204
|
+
// Right side or Bottom side
|
|
157
205
|
x1 = (points[1][0] + points[2][0]) / 2;
|
|
158
206
|
y1 = (points[1][1] + points[2][1]) / 2;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
207
|
+
|
|
208
|
+
if (orient === 'horizontal') {
|
|
209
|
+
y2 = y1 + labelLineLen;
|
|
210
|
+
textY = y2 + 5;
|
|
211
|
+
textAlign = 'center';
|
|
212
|
+
} else {
|
|
213
|
+
x2 = x1 + labelLineLen;
|
|
214
|
+
textX = x2 + 5;
|
|
215
|
+
textAlign = 'left';
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (orient === 'horizontal') {
|
|
220
|
+
x2 = x1;
|
|
221
|
+
textX = x2;
|
|
222
|
+
} else {
|
|
223
|
+
y2 = y1;
|
|
224
|
+
textY = y2;
|
|
162
225
|
}
|
|
163
226
|
|
|
164
|
-
var y2 = y1;
|
|
165
227
|
linePoints = [[x1, y1], [x2, y2]];
|
|
166
|
-
textY = y2;
|
|
167
228
|
}
|
|
168
229
|
|
|
169
230
|
layout.label = {
|
|
@@ -184,7 +245,12 @@ function _default(ecModel, api, payload) {
|
|
|
184
245
|
var sort = seriesModel.get('sort');
|
|
185
246
|
var viewRect = getViewRect(seriesModel, api);
|
|
186
247
|
var indices = getSortedIndices(data, sort);
|
|
187
|
-
var
|
|
248
|
+
var orient = seriesModel.get('orient');
|
|
249
|
+
var viewWidth = viewRect.width;
|
|
250
|
+
var viewHeight = viewRect.height;
|
|
251
|
+
var x = viewRect.x;
|
|
252
|
+
var y = viewRect.y;
|
|
253
|
+
var sizeExtent = orient === 'horizontal' ? [parsePercent(seriesModel.get('minSize'), viewHeight), parsePercent(seriesModel.get('maxSize'), viewHeight)] : [parsePercent(seriesModel.get('minSize'), viewWidth), parsePercent(seriesModel.get('maxSize'), viewWidth)];
|
|
188
254
|
var dataExtent = data.getDataExtent(valueDim);
|
|
189
255
|
var min = seriesModel.get('min');
|
|
190
256
|
var max = seriesModel.get('max');
|
|
@@ -199,37 +265,65 @@ function _default(ecModel, api, payload) {
|
|
|
199
265
|
|
|
200
266
|
var funnelAlign = seriesModel.get('funnelAlign');
|
|
201
267
|
var gap = seriesModel.get('gap');
|
|
202
|
-
var
|
|
203
|
-
var
|
|
268
|
+
var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;
|
|
269
|
+
var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();
|
|
204
270
|
|
|
205
|
-
var getLinePoints = function (idx,
|
|
271
|
+
var getLinePoints = function (idx, offset) {
|
|
206
272
|
// End point index is data.count() and we assign it 0
|
|
273
|
+
if (orient === 'horizontal') {
|
|
274
|
+
var val = data.get(valueDim, idx) || 0;
|
|
275
|
+
var itemHeight = linearMap(val, [min, max], sizeExtent, true);
|
|
276
|
+
var y0;
|
|
277
|
+
|
|
278
|
+
switch (funnelAlign) {
|
|
279
|
+
case 'top':
|
|
280
|
+
y0 = y;
|
|
281
|
+
break;
|
|
282
|
+
|
|
283
|
+
case 'center':
|
|
284
|
+
y0 = y + (viewHeight - itemHeight) / 2;
|
|
285
|
+
break;
|
|
286
|
+
|
|
287
|
+
case 'bottom':
|
|
288
|
+
y0 = y + (viewHeight - itemHeight);
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return [[offset, y0], [offset, y0 + itemHeight]];
|
|
293
|
+
}
|
|
294
|
+
|
|
207
295
|
var val = data.get(valueDim, idx) || 0;
|
|
208
296
|
var itemWidth = linearMap(val, [min, max], sizeExtent, true);
|
|
209
297
|
var x0;
|
|
210
298
|
|
|
211
299
|
switch (funnelAlign) {
|
|
212
300
|
case 'left':
|
|
213
|
-
x0 =
|
|
301
|
+
x0 = x;
|
|
214
302
|
break;
|
|
215
303
|
|
|
216
304
|
case 'center':
|
|
217
|
-
x0 =
|
|
305
|
+
x0 = x + (viewWidth - itemWidth) / 2;
|
|
218
306
|
break;
|
|
219
307
|
|
|
220
308
|
case 'right':
|
|
221
|
-
x0 =
|
|
309
|
+
x0 = x + viewWidth - itemWidth;
|
|
222
310
|
break;
|
|
223
311
|
}
|
|
224
312
|
|
|
225
|
-
return [[x0,
|
|
313
|
+
return [[x0, offset], [x0 + itemWidth, offset]];
|
|
226
314
|
};
|
|
227
315
|
|
|
228
316
|
if (sort === 'ascending') {
|
|
229
317
|
// From bottom to top
|
|
230
|
-
|
|
318
|
+
itemSize = -itemSize;
|
|
231
319
|
gap = -gap;
|
|
232
|
-
|
|
320
|
+
|
|
321
|
+
if (orient === 'horizontal') {
|
|
322
|
+
x += viewWidth;
|
|
323
|
+
} else {
|
|
324
|
+
y += viewHeight;
|
|
325
|
+
}
|
|
326
|
+
|
|
233
327
|
indices = indices.reverse();
|
|
234
328
|
}
|
|
235
329
|
|
|
@@ -237,24 +331,46 @@ function _default(ecModel, api, payload) {
|
|
|
237
331
|
var idx = indices[i];
|
|
238
332
|
var nextIdx = indices[i + 1];
|
|
239
333
|
var itemModel = data.getItemModel(idx);
|
|
240
|
-
var height = itemModel.get('itemStyle.height');
|
|
241
334
|
|
|
242
|
-
if (
|
|
243
|
-
|
|
335
|
+
if (orient === 'horizontal') {
|
|
336
|
+
var width = itemModel.get('itemStyle.width');
|
|
337
|
+
|
|
338
|
+
if (width == null) {
|
|
339
|
+
width = itemSize;
|
|
340
|
+
} else {
|
|
341
|
+
width = parsePercent(width, viewWidth);
|
|
342
|
+
|
|
343
|
+
if (sort === 'ascending') {
|
|
344
|
+
width = -width;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
var start = getLinePoints(idx, x);
|
|
349
|
+
var end = getLinePoints(nextIdx, x + width);
|
|
350
|
+
x += width + gap;
|
|
351
|
+
data.setItemLayout(idx, {
|
|
352
|
+
points: start.concat(end.slice().reverse())
|
|
353
|
+
});
|
|
244
354
|
} else {
|
|
245
|
-
height =
|
|
355
|
+
var height = itemModel.get('itemStyle.height');
|
|
246
356
|
|
|
247
|
-
if (
|
|
248
|
-
height =
|
|
357
|
+
if (height == null) {
|
|
358
|
+
height = itemSize;
|
|
359
|
+
} else {
|
|
360
|
+
height = parsePercent(height, viewHeight);
|
|
361
|
+
|
|
362
|
+
if (sort === 'ascending') {
|
|
363
|
+
height = -height;
|
|
364
|
+
}
|
|
249
365
|
}
|
|
250
|
-
}
|
|
251
366
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
367
|
+
var start = orient === 'horizontal' ? getLinePoints(idx, x) : getLinePoints(idx, y);
|
|
368
|
+
var end = orient === 'horizontal' ? getLinePoints(nextIdx, x + width) : getLinePoints(nextIdx, y + height);
|
|
369
|
+
y += height + gap;
|
|
370
|
+
data.setItemLayout(idx, {
|
|
371
|
+
points: start.concat(end.slice().reverse())
|
|
372
|
+
});
|
|
373
|
+
}
|
|
258
374
|
}
|
|
259
375
|
|
|
260
376
|
labelLayout(data);
|
|
@@ -22,8 +22,6 @@ var createListSimply = require("../helper/createListSimply");
|
|
|
22
22
|
|
|
23
23
|
var SeriesModel = require("../../model/Series");
|
|
24
24
|
|
|
25
|
-
var zrUtil = require("zrender/lib/core/util");
|
|
26
|
-
|
|
27
25
|
/*
|
|
28
26
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
29
27
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -36,6 +36,13 @@ var encodeHTML = _format.encodeHTML;
|
|
|
36
36
|
|
|
37
37
|
var createGraphFromNodeEdge = require("../helper/createGraphFromNodeEdge");
|
|
38
38
|
|
|
39
|
+
var LegendVisualProvider = require("../../visual/LegendVisualProvider");
|
|
40
|
+
|
|
41
|
+
var _multipleGraphEdgeHelper = require("../helper/multipleGraphEdgeHelper");
|
|
42
|
+
|
|
43
|
+
var initCurvenessList = _multipleGraphEdgeHelper.initCurvenessList;
|
|
44
|
+
var createEdgeMapForCurveness = _multipleGraphEdgeHelper.createEdgeMapForCurveness;
|
|
45
|
+
|
|
39
46
|
/*
|
|
40
47
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
41
48
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -57,12 +64,15 @@ var createGraphFromNodeEdge = require("../helper/createGraphFromNodeEdge");
|
|
|
57
64
|
var GraphSeries = echarts.extendSeriesModel({
|
|
58
65
|
type: 'series.graph',
|
|
59
66
|
init: function (option) {
|
|
60
|
-
GraphSeries.superApply(this, 'init', arguments);
|
|
67
|
+
GraphSeries.superApply(this, 'init', arguments);
|
|
68
|
+
var self = this;
|
|
69
|
+
|
|
70
|
+
function getCategoriesData() {
|
|
71
|
+
return self._categoriesData;
|
|
72
|
+
} // Provide data for legend select
|
|
61
73
|
|
|
62
|
-
this.legendDataProvider = function () {
|
|
63
|
-
return this._categoriesData;
|
|
64
|
-
};
|
|
65
74
|
|
|
75
|
+
this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);
|
|
66
76
|
this.fillDataTextStyle(option.edges || option.links);
|
|
67
77
|
|
|
68
78
|
this._updateCategoriesData();
|
|
@@ -83,7 +93,13 @@ var GraphSeries = echarts.extendSeriesModel({
|
|
|
83
93
|
var self = this;
|
|
84
94
|
|
|
85
95
|
if (nodes && edges) {
|
|
86
|
-
|
|
96
|
+
// auto curveness
|
|
97
|
+
initCurvenessList(this);
|
|
98
|
+
var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);
|
|
99
|
+
zrUtil.each(graph.edges, function (edge) {
|
|
100
|
+
createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);
|
|
101
|
+
}, this);
|
|
102
|
+
return graph.data;
|
|
87
103
|
}
|
|
88
104
|
|
|
89
105
|
function beforeLink(nodeData, edgeData) {
|
|
@@ -233,7 +249,8 @@ var GraphSeries = echarts.extendSeriesModel({
|
|
|
233
249
|
edgeSymbol: ['none', 'none'],
|
|
234
250
|
edgeSymbolSize: 10,
|
|
235
251
|
edgeLabel: {
|
|
236
|
-
position: 'middle'
|
|
252
|
+
position: 'middle',
|
|
253
|
+
distance: 5
|
|
237
254
|
},
|
|
238
255
|
draggable: false,
|
|
239
256
|
roam: false,
|
|
@@ -259,7 +276,6 @@ var GraphSeries = echarts.extendSeriesModel({
|
|
|
259
276
|
lineStyle: {
|
|
260
277
|
color: '#aaa',
|
|
261
278
|
width: 1,
|
|
262
|
-
curveness: 0,
|
|
263
279
|
opacity: 0.5
|
|
264
280
|
},
|
|
265
281
|
emphasis: {
|
|
@@ -122,6 +122,7 @@ var _default = echarts.extendChartView({
|
|
|
122
122
|
this._firstRender = true;
|
|
123
123
|
},
|
|
124
124
|
render: function (seriesModel, ecModel, api) {
|
|
125
|
+
var graphView = this;
|
|
125
126
|
var coordSys = seriesModel.coordinateSystem;
|
|
126
127
|
this._model = seriesModel;
|
|
127
128
|
var symbolDraw = this._symbolDraw;
|
|
@@ -188,6 +189,8 @@ var _default = echarts.extendChartView({
|
|
|
188
189
|
|
|
189
190
|
if (itemModel.get('focusNodeAdjacency')) {
|
|
190
191
|
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
|
|
192
|
+
graphView._clearTimer();
|
|
193
|
+
|
|
191
194
|
api.dispatchAction({
|
|
192
195
|
type: 'focusNodeAdjacency',
|
|
193
196
|
seriesId: seriesModel.id,
|
|
@@ -195,10 +198,7 @@ var _default = echarts.extendChartView({
|
|
|
195
198
|
});
|
|
196
199
|
});
|
|
197
200
|
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
|
|
198
|
-
|
|
199
|
-
type: 'unfocusNodeAdjacency',
|
|
200
|
-
seriesId: seriesModel.id
|
|
201
|
-
});
|
|
201
|
+
graphView._dispatchUnfocus(api);
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
}, this);
|
|
@@ -209,6 +209,8 @@ var _default = echarts.extendChartView({
|
|
|
209
209
|
|
|
210
210
|
if (edge.getModel().get('focusNodeAdjacency')) {
|
|
211
211
|
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
|
|
212
|
+
graphView._clearTimer();
|
|
213
|
+
|
|
212
214
|
api.dispatchAction({
|
|
213
215
|
type: 'focusNodeAdjacency',
|
|
214
216
|
seriesId: seriesModel.id,
|
|
@@ -216,10 +218,7 @@ var _default = echarts.extendChartView({
|
|
|
216
218
|
});
|
|
217
219
|
});
|
|
218
220
|
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
|
|
219
|
-
|
|
220
|
-
type: 'unfocusNodeAdjacency',
|
|
221
|
-
seriesId: seriesModel.id
|
|
222
|
-
});
|
|
221
|
+
graphView._dispatchUnfocus(api);
|
|
223
222
|
});
|
|
224
223
|
}
|
|
225
224
|
});
|
|
@@ -264,10 +263,30 @@ var _default = echarts.extendChartView({
|
|
|
264
263
|
dispose: function () {
|
|
265
264
|
this._controller && this._controller.dispose();
|
|
266
265
|
this._controllerHost = {};
|
|
266
|
+
|
|
267
|
+
this._clearTimer();
|
|
267
268
|
},
|
|
268
|
-
|
|
269
|
-
var
|
|
269
|
+
_dispatchUnfocus: function (api, opt) {
|
|
270
|
+
var self = this;
|
|
270
271
|
|
|
272
|
+
this._clearTimer();
|
|
273
|
+
|
|
274
|
+
this._unfocusDelayTimer = setTimeout(function () {
|
|
275
|
+
self._unfocusDelayTimer = null;
|
|
276
|
+
api.dispatchAction({
|
|
277
|
+
type: 'unfocusNodeAdjacency',
|
|
278
|
+
seriesId: self._model.id
|
|
279
|
+
});
|
|
280
|
+
}, 500);
|
|
281
|
+
},
|
|
282
|
+
_clearTimer: function () {
|
|
283
|
+
if (this._unfocusDelayTimer) {
|
|
284
|
+
clearTimeout(this._unfocusDelayTimer);
|
|
285
|
+
this._unfocusDelayTimer = null;
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
focusNodeAdjacency: function (seriesModel, ecModel, api, payload) {
|
|
289
|
+
var data = seriesModel.getData();
|
|
271
290
|
var graph = data.graph;
|
|
272
291
|
var dataIndex = payload.dataIndex;
|
|
273
292
|
var edgeDataIndex = payload.edgeDataIndex;
|
|
@@ -305,8 +324,7 @@ var _default = echarts.extendChartView({
|
|
|
305
324
|
}
|
|
306
325
|
},
|
|
307
326
|
unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) {
|
|
308
|
-
var graph =
|
|
309
|
-
|
|
327
|
+
var graph = seriesModel.getData().graph;
|
|
310
328
|
graph.eachNode(function (node) {
|
|
311
329
|
fadeOutItem(node, nodeOpacityPath);
|
|
312
330
|
});
|
|
@@ -25,6 +25,12 @@ var _graphHelper = require("./graphHelper");
|
|
|
25
25
|
var getSymbolSize = _graphHelper.getSymbolSize;
|
|
26
26
|
var getNodeGlobalScale = _graphHelper.getNodeGlobalScale;
|
|
27
27
|
|
|
28
|
+
var zrUtil = require("zrender/lib/core/util");
|
|
29
|
+
|
|
30
|
+
var _multipleGraphEdgeHelper = require("../helper/multipleGraphEdgeHelper");
|
|
31
|
+
|
|
32
|
+
var getCurvenessForEdge = _multipleGraphEdgeHelper.getCurvenessForEdge;
|
|
33
|
+
|
|
28
34
|
/*
|
|
29
35
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
30
36
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -93,8 +99,8 @@ function circularLayout(seriesModel, basedOn) {
|
|
|
93
99
|
|
|
94
100
|
_layoutNodesBasedOn[basedOn](seriesModel, coordSys, graph, nodeData, r, cx, cy, count);
|
|
95
101
|
|
|
96
|
-
graph.eachEdge(function (edge) {
|
|
97
|
-
var curveness = edge.getModel().get('lineStyle.curveness')
|
|
102
|
+
graph.eachEdge(function (edge, index) {
|
|
103
|
+
var curveness = zrUtil.retrieve3(edge.getModel().get('lineStyle.curveness'), getCurvenessForEdge(edge, seriesModel, index), 0);
|
|
98
104
|
var p1 = vec2.clone(edge.node1.getLayout());
|
|
99
105
|
var p2 = vec2.clone(edge.node2.getLayout());
|
|
100
106
|
var cp1;
|
|
@@ -38,6 +38,10 @@ var vec2 = require("zrender/lib/core/vector");
|
|
|
38
38
|
|
|
39
39
|
var zrUtil = require("zrender/lib/core/util");
|
|
40
40
|
|
|
41
|
+
var _multipleGraphEdgeHelper = require("../helper/multipleGraphEdgeHelper");
|
|
42
|
+
|
|
43
|
+
var getCurvenessForEdge = _multipleGraphEdgeHelper.getCurvenessForEdge;
|
|
44
|
+
|
|
41
45
|
/*
|
|
42
46
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
43
47
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -123,11 +127,12 @@ function _default(ecModel) {
|
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
var edgeModel = edge.getModel();
|
|
130
|
+
var curveness = zrUtil.retrieve3(edgeModel.get('lineStyle.curveness'), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);
|
|
126
131
|
return {
|
|
127
132
|
n1: nodes[edge.node1.dataIndex],
|
|
128
133
|
n2: nodes[edge.node2.dataIndex],
|
|
129
134
|
d: d,
|
|
130
|
-
curveness:
|
|
135
|
+
curveness: curveness,
|
|
131
136
|
ignoreForceLayout: edgeModel.get('ignoreForceLayout')
|
|
132
137
|
};
|
|
133
138
|
});
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
var vec2 = require("zrender/lib/core/vector");
|
|
22
22
|
|
|
23
|
+
var zrUtil = require("zrender/lib/core/util");
|
|
24
|
+
|
|
25
|
+
var _multipleGraphEdgeHelper = require("../helper/multipleGraphEdgeHelper");
|
|
26
|
+
|
|
27
|
+
var getCurvenessForEdge = _multipleGraphEdgeHelper.getCurvenessForEdge;
|
|
28
|
+
|
|
23
29
|
/*
|
|
24
30
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
25
31
|
* or more contributor license agreements. See the NOTICE file
|
|
@@ -50,12 +56,12 @@ function simpleLayout(seriesModel) {
|
|
|
50
56
|
var model = node.getModel();
|
|
51
57
|
node.setLayout([+model.get('x'), +model.get('y')]);
|
|
52
58
|
});
|
|
53
|
-
simpleLayoutEdge(graph);
|
|
59
|
+
simpleLayoutEdge(graph, seriesModel);
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
function simpleLayoutEdge(graph) {
|
|
57
|
-
graph.eachEdge(function (edge) {
|
|
58
|
-
var curveness = edge.getModel().get('lineStyle.curveness')
|
|
62
|
+
function simpleLayoutEdge(graph, seriesModel) {
|
|
63
|
+
graph.eachEdge(function (edge, index) {
|
|
64
|
+
var curveness = zrUtil.retrieve3(edge.getModel().get('lineStyle.curveness'), -getCurvenessForEdge(edge, seriesModel, index, true), 0);
|
|
59
65
|
var p1 = vec2.clone(edge.node1.getLayout());
|
|
60
66
|
var p2 = vec2.clone(edge.node2.getLayout());
|
|
61
67
|
var points = [p1, p2];
|
|
@@ -166,10 +166,10 @@ var _default = echarts.extendChartView({
|
|
|
166
166
|
var point = coordSys.dataToPoint([data.get(dataDims[0], idx), data.get(dataDims[1], idx)]);
|
|
167
167
|
rect = new graphic.Rect({
|
|
168
168
|
shape: {
|
|
169
|
-
x: point[0] - width / 2,
|
|
170
|
-
y: point[1] - height / 2,
|
|
171
|
-
width: width,
|
|
172
|
-
height: height
|
|
169
|
+
x: Math.floor(Math.round(point[0]) - width / 2),
|
|
170
|
+
y: Math.floor(Math.round(point[1]) - height / 2),
|
|
171
|
+
width: Math.ceil(width),
|
|
172
|
+
height: Math.ceil(height)
|
|
173
173
|
},
|
|
174
174
|
style: {
|
|
175
175
|
fill: data.getItemVisual(idx, 'color'),
|
|
@@ -108,6 +108,7 @@ effectLineProto._updateEffectSymbol = function (lineData, idx) {
|
|
|
108
108
|
symbol.setColor(color);
|
|
109
109
|
symbol.attr('scale', size);
|
|
110
110
|
this._symbolType = symbolType;
|
|
111
|
+
this._symbolScale = size;
|
|
111
112
|
|
|
112
113
|
this._updateEffectAnimation(lineData, effectModel, idx);
|
|
113
114
|
};
|
|
@@ -191,6 +192,7 @@ effectLineProto.updateSymbolPosition = function (symbol) {
|
|
|
191
192
|
var cp1 = symbol.__cp1;
|
|
192
193
|
var t = symbol.__t;
|
|
193
194
|
var pos = symbol.position;
|
|
195
|
+
var lastPos = [pos[0], pos[1]];
|
|
194
196
|
var quadraticAt = curveUtil.quadraticAt;
|
|
195
197
|
var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;
|
|
196
198
|
pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);
|
|
@@ -198,7 +200,27 @@ effectLineProto.updateSymbolPosition = function (symbol) {
|
|
|
198
200
|
|
|
199
201
|
var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);
|
|
200
202
|
var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);
|
|
201
|
-
symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;
|
|
203
|
+
symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType
|
|
204
|
+
|
|
205
|
+
if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {
|
|
206
|
+
if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {
|
|
207
|
+
var scaleY = vec2.dist(lastPos, pos) * 1.05;
|
|
208
|
+
symbol.attr('scale', [symbol.scale[0], scaleY]); // make sure the last segment render within endPoint
|
|
209
|
+
|
|
210
|
+
if (t === 1) {
|
|
211
|
+
pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;
|
|
212
|
+
pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;
|
|
213
|
+
}
|
|
214
|
+
} else if (symbol.__lastT === 1) {
|
|
215
|
+
// After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.
|
|
216
|
+
var scaleY = 2 * vec2.dist(p1, pos);
|
|
217
|
+
symbol.attr('scale', [symbol.scale[0], scaleY]);
|
|
218
|
+
} else {
|
|
219
|
+
symbol.attr('scale', this._symbolScale);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
symbol.__lastT = symbol.__t;
|
|
202
224
|
symbol.ignore = false;
|
|
203
225
|
};
|
|
204
226
|
|
|
@@ -207,7 +207,8 @@ effectSymbolProto.updateData = function (data, idx) {
|
|
|
207
207
|
pos[1] = parsePercent(symbolOffset[1], symbolSize[1]);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
var symbolRotate = data.getItemVisual(idx, 'symbolRotate');
|
|
211
|
+
rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
|
|
211
212
|
var effectCfg = {};
|
|
212
213
|
effectCfg.showEffectOn = seriesModel.get('showEffectOn');
|
|
213
214
|
effectCfg.rippleScale = itemModel.get('rippleEffect.scale');
|