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