tvcharts 0.9.43 → 0.9.45
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/lib/chart/line/LineView.js +17 -9
- package/lib/chart/symbolLine/SymbolLineLayout.js +92 -0
- package/lib/chart/symbolLine/SymbolLineSeries.js +115 -0
- package/lib/chart/symbolLine/SymbolLineView.js +167 -0
- package/lib/chart/symbolLine/SymbolPath.js +88 -0
- package/lib/chart/symbolLine/install.js +51 -0
- package/lib/export/charts.js +1 -0
- package/lib/model/Global.js +1 -0
- package/lib/util/seriesType.js +6 -2
- package/lib/util/states.js +2 -2
- package/package.json +1 -1
- package/types/dist/charts.d.ts +1 -1
- package/types/dist/components.d.ts +1 -1
- package/types/dist/renderers.d.ts +1 -1
- package/types/dist/shared.d.ts +6 -4
- package/types/src/chart/line/LineView.d.ts +1 -0
- package/types/src/chart/symbolLine/SymbolLineLayout.d.ts +3 -0
- package/types/src/chart/symbolLine/SymbolLineSeries.d.ts +62 -0
- package/types/src/chart/symbolLine/SymbolLineView.d.ts +16 -0
- package/types/src/chart/symbolLine/SymbolPath.d.ts +23 -0
- package/types/src/chart/symbolLine/install.d.ts +2 -0
- package/types/src/export/charts.d.ts +1 -0
- package/types/src/util/seriesType.d.ts +2 -1
|
@@ -117,7 +117,7 @@ function getStackedOnPoints(coordSys, data, dataCoordInfo) {
|
|
|
117
117
|
}
|
|
118
118
|
return points;
|
|
119
119
|
}
|
|
120
|
-
function turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) {
|
|
120
|
+
export function turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls, lineWidth) {
|
|
121
121
|
var baseAxis = coordSys.getBaseAxis();
|
|
122
122
|
var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;
|
|
123
123
|
var stepPoints = [];
|
|
@@ -164,6 +164,11 @@ function turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) {
|
|
|
164
164
|
}
|
|
165
165
|
// Last points
|
|
166
166
|
stepPoints.push(points[i++], points[i++]);
|
|
167
|
+
if (lineWidth != null && lineWidth % 2 === 1) {
|
|
168
|
+
for (var i_1 = 0; i_1 < stepPoints.length; i_1++) {
|
|
169
|
+
stepPoints[i_1] = Math.floor(stepPoints[i_1]) + 0.5;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
167
172
|
return stepPoints;
|
|
168
173
|
}
|
|
169
174
|
/**
|
|
@@ -539,9 +544,10 @@ var LineView = /** @class */function (_super) {
|
|
|
539
544
|
hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);
|
|
540
545
|
if (step) {
|
|
541
546
|
// TODO If stacked series is not step
|
|
542
|
-
|
|
547
|
+
var lineWidth = lineStyleModel.get('width');
|
|
548
|
+
points = turnPointsIntoStep(points, coordSys, step, connectNulls, lineWidth);
|
|
543
549
|
if (stackedOnPoints) {
|
|
544
|
-
stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);
|
|
550
|
+
stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls, lineWidth);
|
|
545
551
|
}
|
|
546
552
|
}
|
|
547
553
|
polyline = this._newPolyline(points);
|
|
@@ -599,9 +605,10 @@ var LineView = /** @class */function (_super) {
|
|
|
599
605
|
// Not do it in update with animation
|
|
600
606
|
if (step) {
|
|
601
607
|
// TODO If stacked series is not step
|
|
602
|
-
|
|
608
|
+
var lineWidth = lineStyleModel.get('width');
|
|
609
|
+
points = turnPointsIntoStep(points, coordSys, step, connectNulls, lineWidth);
|
|
603
610
|
if (stackedOnPoints) {
|
|
604
|
-
stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);
|
|
611
|
+
stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls, lineWidth);
|
|
605
612
|
}
|
|
606
613
|
}
|
|
607
614
|
polyline.setShape({
|
|
@@ -1020,10 +1027,11 @@ var LineView = /** @class */function (_super) {
|
|
|
1020
1027
|
var stackedOnNext = diff.stackedOnNext;
|
|
1021
1028
|
if (step) {
|
|
1022
1029
|
// TODO If stacked series is not step
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1030
|
+
var lineWidth = seriesModel.get(['lineStyle', 'width']);
|
|
1031
|
+
current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls, lineWidth);
|
|
1032
|
+
stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls, lineWidth);
|
|
1033
|
+
next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls, lineWidth);
|
|
1034
|
+
stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls, lineWidth);
|
|
1027
1035
|
}
|
|
1028
1036
|
// Don't apply animation if diff is large.
|
|
1029
1037
|
// For better result and avoid memory explosion problems like
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
28
|
+
* or more contributor license agreements. See the NOTICE file
|
|
29
|
+
* distributed with this work for additional information
|
|
30
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
31
|
+
* to you under the Apache License, Version 2.0 (the
|
|
32
|
+
* "License"); you may not use this file except in compliance
|
|
33
|
+
* with the License. You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing,
|
|
38
|
+
* software distributed under the License is distributed on an
|
|
39
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
40
|
+
* KIND, either express or implied. See the License for the
|
|
41
|
+
* specific language governing permissions and limitations
|
|
42
|
+
* under the License.
|
|
43
|
+
*/
|
|
44
|
+
/* global Float32Array */
|
|
45
|
+
import createRenderPlanner from '../helper/createRenderPlanner.js';
|
|
46
|
+
import { createFloat32Array } from '../../util/vendor.js';
|
|
47
|
+
import { map } from 'tvrender/lib/core/util.js';
|
|
48
|
+
var symbolLineLayout = {
|
|
49
|
+
seriesType: 'symbolLine',
|
|
50
|
+
plan: createRenderPlanner(),
|
|
51
|
+
reset: function (seriesModel) {
|
|
52
|
+
var data = seriesModel.getData();
|
|
53
|
+
var coordSys = seriesModel.coordinateSystem;
|
|
54
|
+
if (!coordSys) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
var candleWidth = calculateWidth(seriesModel, data);
|
|
58
|
+
var isSimple = candleWidth < 9;
|
|
59
|
+
var dims = map(coordSys.dimensions, function (dim) {
|
|
60
|
+
return data.mapDimension(dim);
|
|
61
|
+
}).slice(0, 2);
|
|
62
|
+
var dimLen = dims.length;
|
|
63
|
+
var store = data.getStore();
|
|
64
|
+
var dimIdx0 = data.getDimensionIndex(dims[0]);
|
|
65
|
+
var dimIdx1 = data.getDimensionIndex(dims[1]);
|
|
66
|
+
return dimLen && {
|
|
67
|
+
progress: function (params, data) {
|
|
68
|
+
var segCount = params.end - params.start;
|
|
69
|
+
var points = createFloat32Array(segCount * dimLen);
|
|
70
|
+
var tmpIn = [];
|
|
71
|
+
var tmpOut = [];
|
|
72
|
+
for (var i = params.start, offset = 0; i < params.end; i++) {
|
|
73
|
+
tmpIn[0] = store.get(dimIdx0, i);
|
|
74
|
+
tmpIn[1] = store.get(dimIdx1, i);
|
|
75
|
+
// Let coordinate system to handle the NaN data.
|
|
76
|
+
var point = coordSys.dataToPoint(tmpIn, null, tmpOut);
|
|
77
|
+
points[offset++] = point[0];
|
|
78
|
+
points[offset++] = point[1];
|
|
79
|
+
}
|
|
80
|
+
data.setLayout('points', points);
|
|
81
|
+
data.setLayout('isSimple', isSimple);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
function calculateWidth(seriesModel, data) {
|
|
87
|
+
var baseAxis = seriesModel.getBaseAxis();
|
|
88
|
+
var extent;
|
|
89
|
+
var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());
|
|
90
|
+
return bandWidth;
|
|
91
|
+
}
|
|
92
|
+
export default symbolLineLayout;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
28
|
+
* or more contributor license agreements. See the NOTICE file
|
|
29
|
+
* distributed with this work for additional information
|
|
30
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
31
|
+
* to you under the Apache License, Version 2.0 (the
|
|
32
|
+
* "License"); you may not use this file except in compliance
|
|
33
|
+
* with the License. You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing,
|
|
38
|
+
* software distributed under the License is distributed on an
|
|
39
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
40
|
+
* KIND, either express or implied. See the License for the
|
|
41
|
+
* specific language governing permissions and limitations
|
|
42
|
+
* under the License.
|
|
43
|
+
*/
|
|
44
|
+
import { __extends } from "tslib";
|
|
45
|
+
import createSeriesData from '../helper/createSeriesData.js';
|
|
46
|
+
import SeriesModel from '../../model/Series.js';
|
|
47
|
+
var SymbolLineSeriesModel = /** @class */function (_super) {
|
|
48
|
+
__extends(SymbolLineSeriesModel, _super);
|
|
49
|
+
function SymbolLineSeriesModel() {
|
|
50
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
51
|
+
_this.type = SymbolLineSeriesModel.type;
|
|
52
|
+
_this.ignoreStyleOnData = true;
|
|
53
|
+
return _this;
|
|
54
|
+
}
|
|
55
|
+
SymbolLineSeriesModel.prototype.getInitialData = function (option) {
|
|
56
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
57
|
+
var coordSys = option.coordinateSystem;
|
|
58
|
+
if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {
|
|
59
|
+
throw new Error('SymbolLine not support coordinateSystem besides cartesian and polar');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return createSeriesData(null, this, {
|
|
63
|
+
useEncodeDefaulter: true
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
SymbolLineSeriesModel.type = 'series.symbolLine';
|
|
67
|
+
SymbolLineSeriesModel.dependencies = ['grid', 'polar'];
|
|
68
|
+
SymbolLineSeriesModel.defaultOption = {
|
|
69
|
+
// zlevel: 0,
|
|
70
|
+
z: 3,
|
|
71
|
+
coordinateSystem: 'cartesian2d',
|
|
72
|
+
legendHoverLink: true,
|
|
73
|
+
clip: true,
|
|
74
|
+
lineStyle: {
|
|
75
|
+
width: 2,
|
|
76
|
+
type: 'solid'
|
|
77
|
+
},
|
|
78
|
+
emphasis: {
|
|
79
|
+
scale: true,
|
|
80
|
+
emphasisState: {
|
|
81
|
+
zlevel: 1
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
// areaStyle: {
|
|
85
|
+
// origin of areaStyle. Valid values:
|
|
86
|
+
// `'auto'/null/undefined`: from axisSymbolLine to data
|
|
87
|
+
// `'start'`: from min to data
|
|
88
|
+
// `'end'`: from data to max
|
|
89
|
+
// origin: 'auto'
|
|
90
|
+
// },
|
|
91
|
+
// false, 'start', 'end', 'middle'
|
|
92
|
+
step: false,
|
|
93
|
+
// Disabled if step is true
|
|
94
|
+
smooth: false,
|
|
95
|
+
smoothMonotone: null,
|
|
96
|
+
symbol: 'circle',
|
|
97
|
+
symbolSize: 4,
|
|
98
|
+
symbolRotate: null,
|
|
99
|
+
showSymbol: true,
|
|
100
|
+
// `false`: follow the label interval strategy.
|
|
101
|
+
// `true`: show all symbols.
|
|
102
|
+
// `'auto'`: If possible, show all symbols, otherwise
|
|
103
|
+
// follow the label interval strategy.
|
|
104
|
+
showAllSymbol: 'auto',
|
|
105
|
+
// Whether to connect break point.
|
|
106
|
+
connectNulls: false,
|
|
107
|
+
// Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.
|
|
108
|
+
sampling: 'none',
|
|
109
|
+
// Disable progressive
|
|
110
|
+
progressive: 0,
|
|
111
|
+
hoverLayerThreshold: Infinity
|
|
112
|
+
};
|
|
113
|
+
return SymbolLineSeriesModel;
|
|
114
|
+
}(SeriesModel);
|
|
115
|
+
export default SymbolLineSeriesModel;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
28
|
+
* or more contributor license agreements. See the NOTICE file
|
|
29
|
+
* distributed with this work for additional information
|
|
30
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
31
|
+
* to you under the Apache License, Version 2.0 (the
|
|
32
|
+
* "License"); you may not use this file except in compliance
|
|
33
|
+
* with the License. You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing,
|
|
38
|
+
* software distributed under the License is distributed on an
|
|
39
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
40
|
+
* KIND, either express or implied. See the License for the
|
|
41
|
+
* specific language governing permissions and limitations
|
|
42
|
+
* under the License.
|
|
43
|
+
*/
|
|
44
|
+
import { __extends } from "tslib";
|
|
45
|
+
import * as zrUtil from 'tvrender/lib/core/util.js';
|
|
46
|
+
import ChartView from '../../view/Chart.js';
|
|
47
|
+
import { createClipPath } from '../helper/createClipPathFromCoordSys.js';
|
|
48
|
+
import SymbolPath from './SymbolPath.js';
|
|
49
|
+
import { createSymbol } from '../../util/symbol.js';
|
|
50
|
+
import { ECPolyline } from '../line/poly.js';
|
|
51
|
+
import { getECData } from '../../util/innerStore.js';
|
|
52
|
+
import { turnPointsIntoStep } from '../line/LineView.js';
|
|
53
|
+
import { toggleHoverEmphasis } from '../../util/states.js';
|
|
54
|
+
// const SKIP_PROPS = ['color', 'borderColor'] as const;
|
|
55
|
+
function getSmooth(smooth) {
|
|
56
|
+
return zrUtil.isNumber(smooth) ? smooth : smooth ? 0.5 : 0;
|
|
57
|
+
}
|
|
58
|
+
var SymbolLineView = /** @class */function (_super) {
|
|
59
|
+
__extends(SymbolLineView, _super);
|
|
60
|
+
function SymbolLineView() {
|
|
61
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
62
|
+
_this.type = SymbolLineView.type;
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
// init() {
|
|
66
|
+
// }
|
|
67
|
+
SymbolLineView.prototype.render = function (seriesModel, ecModel, api) {
|
|
68
|
+
// If there is clipPath created in large mode. Remove it.
|
|
69
|
+
// this.group.removeClipPath();
|
|
70
|
+
// Clear previously rendered progressive elements.
|
|
71
|
+
// this._updateDrawMode(seriesModel);
|
|
72
|
+
this._renderNormal(seriesModel);
|
|
73
|
+
};
|
|
74
|
+
SymbolLineView.prototype._renderNormal = function (seriesModel) {
|
|
75
|
+
var data = seriesModel.getData();
|
|
76
|
+
// const oldData = this._data;
|
|
77
|
+
var group = this.group;
|
|
78
|
+
group.removeAll();
|
|
79
|
+
// const info = seriesModel.get('info');
|
|
80
|
+
var emphasisState = seriesModel.get('emphasis').emphasisState;
|
|
81
|
+
var groupId = seriesModel.get('groupId');
|
|
82
|
+
var symbol = seriesModel.get('symbol');
|
|
83
|
+
var connectNulls = seriesModel.get('connectNulls');
|
|
84
|
+
var smooth = getSmooth(seriesModel.get('smooth'));
|
|
85
|
+
var symbolSize = seriesModel.get('symbolSize') || 4;
|
|
86
|
+
var isSimple = data.getLayout('isSimple');
|
|
87
|
+
var step = seriesModel.get('step');
|
|
88
|
+
var coordSys = seriesModel.coordinateSystem;
|
|
89
|
+
var _a = symbolSize instanceof Array ? symbolSize : [symbolSize, symbolSize],
|
|
90
|
+
width = _a[0],
|
|
91
|
+
height = _a[1];
|
|
92
|
+
var smoothMonotone = seriesModel.get('smoothMonotone');
|
|
93
|
+
var ignoreBothEndsSymbol = seriesModel.get('ignoreBothEndsSymbol');
|
|
94
|
+
var lineStyleModel = seriesModel.getModel('lineStyle');
|
|
95
|
+
var points = data.getLayout('points') || [];
|
|
96
|
+
if (step) {
|
|
97
|
+
points = turnPointsIntoStep(points, coordSys, step, connectNulls, lineStyleModel.get('width'));
|
|
98
|
+
}
|
|
99
|
+
var polyline = this._newPolyline(points);
|
|
100
|
+
var color = lineStyleModel.get('color');
|
|
101
|
+
polyline.useStyle(zrUtil.defaults(
|
|
102
|
+
// Use color in lineStyle first
|
|
103
|
+
lineStyleModel.getLineStyle(), {
|
|
104
|
+
fill: 'none',
|
|
105
|
+
stroke: color,
|
|
106
|
+
lineJoin: 'bevel'
|
|
107
|
+
}));
|
|
108
|
+
polyline.setShape({
|
|
109
|
+
smooth: smooth,
|
|
110
|
+
smoothMonotone: smoothMonotone,
|
|
111
|
+
connectNulls: connectNulls,
|
|
112
|
+
points: points
|
|
113
|
+
});
|
|
114
|
+
polyline.states.emphasis = emphasisState;
|
|
115
|
+
group.add(polyline);
|
|
116
|
+
if (symbol && symbol !== 'none' && !isSimple) {
|
|
117
|
+
var el = new SymbolPath({
|
|
118
|
+
shape: {
|
|
119
|
+
points: points,
|
|
120
|
+
width: width,
|
|
121
|
+
height: height,
|
|
122
|
+
ignoreBothEndsSymbol: ignoreBothEndsSymbol
|
|
123
|
+
},
|
|
124
|
+
style: {
|
|
125
|
+
fill: color,
|
|
126
|
+
stroke: 'none'
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
el.symbolProxy = createSymbol(symbol, 0, 0, 0, 0);
|
|
130
|
+
el.states.emphasis = emphasisState;
|
|
131
|
+
group.add(el);
|
|
132
|
+
}
|
|
133
|
+
var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;
|
|
134
|
+
if (clipPath) {
|
|
135
|
+
this.group.setClipPath(clipPath);
|
|
136
|
+
} else {
|
|
137
|
+
this.group.removeClipPath();
|
|
138
|
+
}
|
|
139
|
+
toggleHoverEmphasis(this.group, null, null, false);
|
|
140
|
+
getECData(this.group).groupId = groupId;
|
|
141
|
+
};
|
|
142
|
+
SymbolLineView.prototype._newPolyline = function (points) {
|
|
143
|
+
var polyline = this._polyline;
|
|
144
|
+
if (polyline) {
|
|
145
|
+
return polyline;
|
|
146
|
+
}
|
|
147
|
+
polyline = new ECPolyline({
|
|
148
|
+
shape: {
|
|
149
|
+
points: points
|
|
150
|
+
},
|
|
151
|
+
segmentIgnoreThreshold: 2
|
|
152
|
+
});
|
|
153
|
+
this._polyline = polyline;
|
|
154
|
+
return polyline;
|
|
155
|
+
};
|
|
156
|
+
SymbolLineView.prototype.remove = function (ecModel) {
|
|
157
|
+
this._clear();
|
|
158
|
+
};
|
|
159
|
+
SymbolLineView.prototype._clear = function () {
|
|
160
|
+
this.group.removeAll();
|
|
161
|
+
// this._data = null;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
SymbolLineView.type = 'symbolLine';
|
|
165
|
+
return SymbolLineView;
|
|
166
|
+
}(ChartView);
|
|
167
|
+
export default SymbolLineView;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
28
|
+
* or more contributor license agreements. See the NOTICE file
|
|
29
|
+
* distributed with this work for additional information
|
|
30
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
31
|
+
* to you under the Apache License, Version 2.0 (the
|
|
32
|
+
* "License"); you may not use this file except in compliance
|
|
33
|
+
* with the License. You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing,
|
|
38
|
+
* software distributed under the License is distributed on an
|
|
39
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
40
|
+
* KIND, either express or implied. See the License for the
|
|
41
|
+
* specific language governing permissions and limitations
|
|
42
|
+
* under the License.
|
|
43
|
+
*/
|
|
44
|
+
import { __extends } from "tslib";
|
|
45
|
+
/* global Float32Array */
|
|
46
|
+
// TODO Batch by color
|
|
47
|
+
import * as graphic from '../../util/graphic.js';
|
|
48
|
+
var LargeSymbolPathShape = /** @class */function () {
|
|
49
|
+
function LargeSymbolPathShape() {}
|
|
50
|
+
return LargeSymbolPathShape;
|
|
51
|
+
}();
|
|
52
|
+
var SymbolPath = /** @class */function (_super) {
|
|
53
|
+
__extends(SymbolPath, _super);
|
|
54
|
+
// private _ctx: CanvasRenderingContext2D;
|
|
55
|
+
function SymbolPath(opts) {
|
|
56
|
+
return _super.call(this, opts) || this;
|
|
57
|
+
}
|
|
58
|
+
SymbolPath.prototype.getDefaultShape = function () {
|
|
59
|
+
return new LargeSymbolPathShape();
|
|
60
|
+
};
|
|
61
|
+
SymbolPath.prototype.buildPath = function (path, shape) {
|
|
62
|
+
var _a;
|
|
63
|
+
var points = shape.points;
|
|
64
|
+
var symbolProxy = this.symbolProxy;
|
|
65
|
+
var symbolProxyShape = symbolProxy.shape;
|
|
66
|
+
var needCenter = (_a = shape.needCenter) !== null && _a !== void 0 ? _a : true;
|
|
67
|
+
var width = shape.width,
|
|
68
|
+
height = shape.height,
|
|
69
|
+
ignoreBothEndsSymbol = shape.ignoreBothEndsSymbol;
|
|
70
|
+
var lastIndex = points.length / 2 - 1;
|
|
71
|
+
var index = 0;
|
|
72
|
+
for (var i = 0; i < points.length; index++) {
|
|
73
|
+
var x = points[i++];
|
|
74
|
+
var y = points[i++];
|
|
75
|
+
if (isNaN(x) || isNaN(y) || ignoreBothEndsSymbol && (index == 0 || lastIndex === index)) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
symbolProxyShape.x = x - (needCenter ? width / 2 : 0);
|
|
79
|
+
symbolProxyShape.y = y - (needCenter ? height / 2 : 0);
|
|
80
|
+
// symbolProxyShape.y = y + yOffset;
|
|
81
|
+
symbolProxyShape.width = width;
|
|
82
|
+
symbolProxyShape.height = height;
|
|
83
|
+
symbolProxy.buildPath(path, symbolProxyShape, true);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
return SymbolPath;
|
|
87
|
+
}(graphic.Path);
|
|
88
|
+
export default SymbolPath;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
* or more contributor license agreements. See the NOTICE file
|
|
5
|
+
* distributed with this work for additional information
|
|
6
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
* to you under the Apache License, Version 2.0 (the
|
|
8
|
+
* "License"); you may not use this file except in compliance
|
|
9
|
+
* with the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
28
|
+
* or more contributor license agreements. See the NOTICE file
|
|
29
|
+
* distributed with this work for additional information
|
|
30
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
31
|
+
* to you under the Apache License, Version 2.0 (the
|
|
32
|
+
* "License"); you may not use this file except in compliance
|
|
33
|
+
* with the License. You may obtain a copy of the License at
|
|
34
|
+
*
|
|
35
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
36
|
+
*
|
|
37
|
+
* Unless required by applicable law or agreed to in writing,
|
|
38
|
+
* software distributed under the License is distributed on an
|
|
39
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
40
|
+
* KIND, either express or implied. See the License for the
|
|
41
|
+
* specific language governing permissions and limitations
|
|
42
|
+
* under the License.
|
|
43
|
+
*/
|
|
44
|
+
import SymbolLineSeries from './SymbolLineSeries.js';
|
|
45
|
+
import SymbolLineView from './SymbolLineView.js';
|
|
46
|
+
import SymbolLineLayout from './SymbolLineLayout.js';
|
|
47
|
+
export function install(registers) {
|
|
48
|
+
registers.registerChartView(SymbolLineView);
|
|
49
|
+
registers.registerSeriesModel(SymbolLineSeries);
|
|
50
|
+
registers.registerLayout(SymbolLineLayout);
|
|
51
|
+
}
|
package/lib/export/charts.js
CHANGED
|
@@ -73,6 +73,7 @@ export { install as BoxesChart } from '../chart/boxes/install.js';
|
|
|
73
73
|
export { install as CharPlotChart } from '../chart/charPlot/install.js';
|
|
74
74
|
export { install as CandlePlotChart } from '../chart/candlePlot/install.js';
|
|
75
75
|
export { install as CandleVolumeChart } from '../chart/candleVolume/install.js';
|
|
76
|
+
export { install as SymbolLineChart } from '../chart/symbolLine/install.js';
|
|
76
77
|
export { install as HeikinAshiChart } from '../chart/heikinAshi/install.js';
|
|
77
78
|
export { install as VolPathChart } from '../chart/volPath/install.js';
|
|
78
79
|
export { install as VolPathRectChart } from '../chart/volPathRect/install.js';
|
package/lib/model/Global.js
CHANGED
|
@@ -144,6 +144,7 @@ var BUILTIN_CHARTS_MAP = {
|
|
|
144
144
|
arrowsPlot: 'ArrowsPlotChart',
|
|
145
145
|
candlePlot: 'CandlePlotChart',
|
|
146
146
|
candleVolume: 'CandleVolumeChart',
|
|
147
|
+
symbolLine: 'SymbolLineChart',
|
|
147
148
|
heikinAshi: 'HeikinAshiChart',
|
|
148
149
|
volPath: 'VolPathChart',
|
|
149
150
|
volPathRect: "VolPathRectChart",
|
package/lib/util/seriesType.js
CHANGED
|
@@ -27,10 +27,14 @@ var candleArr = ['candlestick', 'candlePlot', 'barPlot', 'heikinAshi', 'volPath'
|
|
|
27
27
|
function isCandle(type) {
|
|
28
28
|
return candleArr.includes(type);
|
|
29
29
|
}
|
|
30
|
-
var plotsArr = ['labels', 'linesPlot', 'charPlot', 'arrowsPlot', 'line'];
|
|
30
|
+
var plotsArr = ['labels', 'linesPlot', 'charPlot', 'arrowsPlot', 'line', 'symbolLine'];
|
|
31
|
+
var showValuePlotsArr = ['labels', 'linesPlot', 'charPlot', 'arrowsPlot'];
|
|
31
32
|
function isPlot(type) {
|
|
32
33
|
return plotsArr.includes(type);
|
|
33
34
|
}
|
|
35
|
+
function isShowValuePlot(type) {
|
|
36
|
+
return showValuePlotsArr.includes(type);
|
|
37
|
+
}
|
|
34
38
|
function formatUpdateData(seriesModel, item, index) {
|
|
35
39
|
if (seriesModel.subType === 'heikinAshi') {
|
|
36
40
|
var lastData = seriesModel.option.data[index - 1];
|
|
@@ -59,4 +63,4 @@ function formatUpdateData(seriesModel, item, index) {
|
|
|
59
63
|
}
|
|
60
64
|
return item;
|
|
61
65
|
}
|
|
62
|
-
export { isCandle, isPlot, formatUpdateData };
|
|
66
|
+
export { isCandle, isPlot, formatUpdateData, isShowValuePlot };
|
package/lib/util/states.js
CHANGED
|
@@ -47,7 +47,7 @@ import { liftColor } from 'tvrender/lib/tool/color.js';
|
|
|
47
47
|
import { queryDataIndex, makeInner } from './model.js';
|
|
48
48
|
import Path from 'tvrender/lib/graphic/Path.js';
|
|
49
49
|
import { error } from './log.js';
|
|
50
|
-
import { isCandle,
|
|
50
|
+
import { isCandle, isShowValuePlot } from '../util/seriesType.js';
|
|
51
51
|
import { positiveDataColorQuery, negativeDataColorQuery } from '../chart/candlestick/candlestickVisual.js';
|
|
52
52
|
// Reserve 0 as default.
|
|
53
53
|
var _highlightNextDigit = 1;
|
|
@@ -674,7 +674,7 @@ export function getSeriesPointData(ecModel, payload) {
|
|
|
674
674
|
if (fill) {
|
|
675
675
|
color = fill;
|
|
676
676
|
}
|
|
677
|
-
} else if (
|
|
677
|
+
} else if (isShowValuePlot(seriesModel.subType)) {
|
|
678
678
|
var isLinesPlot = seriesModel.subType === 'linesPlot';
|
|
679
679
|
var dataItem = data.getItemModel(index, isRaw);
|
|
680
680
|
var fill = dataItem.get([isLinesPlot ? 'lineStyle' : 'itemStyle', 'color']);
|
package/package.json
CHANGED
package/types/dist/charts.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { install$
|
|
1
|
+
export { install$33 as ArrowsPlotChart, install$1 as BarChart, install$32 as BarPlotChart, BarSeriesOption, install$37 as BgColorChart, install$23 as BoxesChart, install$13 as BoxplotChart, BoxplotSeriesOption, install$25 as CandlePlotChart, install$26 as CandleVolumeChart, install$14 as CandlestickChart, CandlestickSeriesOption, install$24 as CharPlotChart, install$42 as CustomChart, CustomSeriesOption, install$15 as EffectScatterChart, EffectScatterSeriesOption, install$36 as FillsChart, install$10 as FunnelChart, FunnelSeriesOption, install$9 as GaugeChart, GaugeSeriesOption, install$8 as GraphChart, GraphSeriesOption, install$35 as HLinesChart, install$38 as HeatmapChart, HeatmapSeriesOption, install$28 as HeikinAshiChart, install$34 as LabelsChart, install as LineChart, install$22 as LineFillsChart, LineSeriesOption, install$16 as LinesChart, install$17 as LinesPlotChart, LinesPlotSeriesOption, LinesSeriesOption, install$5 as MapChart, MapSeriesOption, install$20 as MineLinesChart, install$21 as MinePolyLinesChart, install$11 as ParallelChart, ParallelSeriesOption, install$39 as PictorialBarChart, PictorialBarSeriesOption, install$2 as PieChart, PieSeriesOption, install$19 as PlaybackOrderChart, install$4 as RadarChart, RadarSeriesOption, install$12 as SankeyChart, SankeySeriesOption, install$3 as ScatterChart, ScatterSeriesOption, install$18 as StrategyChart, StrategySeriesOption, install$41 as SunburstChart, SunburstSeriesOption, install$27 as SymbolLineChart, install$40 as ThemeRiverChart, ThemeRiverSeriesOption, install$6 as TreeChart, TreeSeriesOption, install$7 as TreemapChart, TreemapSeriesOption, install$29 as VolPathChart, install$30 as VolPathRectChart, install$31 as VolPathTableChart } from './shared';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { install$
|
|
1
|
+
export { install$61 as AlarmComponent, install$80 as AriaComponent, AriaOption as AriaComponentOption, install$54 as AxisPointerComponent, AxisPointerOption as AxisPointerComponentOption, install$62 as BgRectComponent, install$55 as BrushComponent, BrushOption as BrushComponentOption, install$50 as CalendarComponent, CalendarOption as CalendarComponentOption, install$59 as CursorPointerComponent, install$74 as DataZoomComponent, DataZoomComponentOption, install$75 as DataZoomInsideComponent, install$76 as DataZoomSliderComponent, install$82 as DatasetComponent, DatasetOption as DatasetComponentOption, install$57 as EventsComponent, install$47 as GeoComponent, GeoOption as GeoComponentOption, install$51 as GraphicComponent, GraphicComponentLooseOption as GraphicComponentOption, install$44 as GridComponent, GridOption as GridComponentOption, install$43 as GridSimpleComponent, install$71 as LegendComponent, LegendComponentOption, install$73 as LegendPlainComponent, install$72 as LegendScrollComponent, install$70 as LimitTipComponent, install$64 as LogoComponent, install$68 as MarkAreaComponent, MarkAreaOption as MarkAreaComponentOption, install$69 as MarkLabelComponent, MarkLabelOption as MarkLabelComponentOption, install$67 as MarkLineComponent, MarkLineOption as MarkLineComponentOption, install$66 as MarkPointComponent, MarkPointOption as MarkPointComponentOption, install$49 as ParallelComponent, ParallelCoordinateSystemOption as ParallelComponentOption, install$63 as PlaybackComponent, install$45 as PolarComponent, PolarOption as PolarComponentOption, install$46 as RadarComponent, RadarOption as RadarComponentOption, install$48 as SingleAxisComponent, SingleAxisOption as SingleAxisComponentOption, install$60 as TableComponent, install$65 as TimelineComponent, TimelineOption as TimelineComponentOption, install$56 as TitleComponent, TitleOption as TitleComponentOption, install$52 as ToolboxComponent, ToolboxComponentOption, install$53 as TooltipComponent, TooltipOption as TooltipComponentOption, install$58 as TradeDayComponent, install$81 as TransformComponent, install$77 as VisualMapComponent, VisualMapComponentOption, install$78 as VisualMapContinuousComponent, install$79 as VisualMapPiecewiseComponent } from './shared';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { install$
|
|
1
|
+
export { install$84 as CanvasRenderer, install$83 as SVGRenderer } from './shared';
|
package/types/dist/shared.d.ts
CHANGED
|
@@ -9331,6 +9331,8 @@ declare function install$F(registers: EChartsExtensionInstallRegisters): void;
|
|
|
9331
9331
|
|
|
9332
9332
|
declare function install$G(registers: EChartsExtensionInstallRegisters): void;
|
|
9333
9333
|
|
|
9334
|
+
declare function install$H(registers: EChartsExtensionInstallRegisters): void;
|
|
9335
|
+
|
|
9334
9336
|
interface RadarIndicatorOption {
|
|
9335
9337
|
name?: string;
|
|
9336
9338
|
/**
|
|
@@ -9563,7 +9565,7 @@ interface TitleOption extends ComponentOption, BoxLayoutOptionMixin, BorderOptio
|
|
|
9563
9565
|
*/
|
|
9564
9566
|
borderRadius?: number | number[];
|
|
9565
9567
|
}
|
|
9566
|
-
declare function install$
|
|
9568
|
+
declare function install$I(registers: EChartsExtensionInstallRegisters): void;
|
|
9567
9569
|
|
|
9568
9570
|
interface TimelineControlStyle extends ItemStyleOption {
|
|
9569
9571
|
show?: boolean;
|
|
@@ -11558,8 +11560,6 @@ interface EChartsOption extends ECBasicOption {
|
|
|
11558
11560
|
baseOption?: EChartsOption;
|
|
11559
11561
|
}
|
|
11560
11562
|
|
|
11561
|
-
declare function install$I(registers: EChartsExtensionInstallRegisters): void;
|
|
11562
|
-
|
|
11563
11563
|
declare function install$J(registers: EChartsExtensionInstallRegisters): void;
|
|
11564
11564
|
|
|
11565
11565
|
declare function install$K(registers: EChartsExtensionInstallRegisters): void;
|
|
@@ -11638,8 +11638,10 @@ declare function install$1i(registers: EChartsExtensionInstallRegisters): void;
|
|
|
11638
11638
|
|
|
11639
11639
|
declare function install$1j(registers: EChartsExtensionInstallRegisters): void;
|
|
11640
11640
|
|
|
11641
|
+
declare function install$1k(registers: EChartsExtensionInstallRegisters): void;
|
|
11642
|
+
|
|
11641
11643
|
declare function installUniversalTransition(registers: EChartsExtensionInstallRegisters): void;
|
|
11642
11644
|
|
|
11643
11645
|
declare function installLabelLayout(registers: EChartsExtensionInstallRegisters): void;
|
|
11644
11646
|
|
|
11645
|
-
export { AngleAxisOption, AnimationDelayCallback, AnimationDelayCallbackParam, AnimationDurationCallback, AriaOption, Axis, AxisPointerOption, BarSeriesOption$1 as BarSeriesOption, BoxplotSeriesOption$1 as BoxplotSeriesOption, BrushOption, CalendarOption, CallbackDataParams, CandlestickSeriesOption$1 as CandlestickSeriesOption, ChartView, ComponentModel, ComponentView, ComposeOption, ContinousVisualMapOption, CustomSeriesOption$1 as CustomSeriesOption, CustomSeriesRenderItem, CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams, CustomSeriesRenderItemReturn, DataZoomComponentOption, DatasetOption, DownplayPayload, ECBasicOption, ECElementEvent, EChartsInitOpts, EChartsOption, EChartsType, EffectScatterSeriesOption$1 as EffectScatterSeriesOption, ElementEvent, FunnelSeriesOption$1 as FunnelSeriesOption, GaugeSeriesOption$1 as GaugeSeriesOption, GeoOption, GraphSeriesOption$1 as GraphSeriesOption, GraphicComponentLooseOption, GridOption, HeatmapSeriesOption$1 as HeatmapSeriesOption, HighlightPayload, ImagePatternObject, InsideDataZoomOption, LabelFormatterCallback, LabelLayoutOptionCallback, LabelLayoutOptionCallbackParams, LegendComponentOption, LegendOption, LineSeriesOption$1 as LineSeriesOption, LinearGradientObject, LinesPlotSeriesOption$1 as LinesPlotSeriesOption, LinesSeriesOption$1 as LinesSeriesOption, MapSeriesOption$1 as MapSeriesOption, MarkAreaOption, MarkLabelOption, MarkLineOption, MarkPointOption, MineLinesSeriesOption$1 as MineLinesSeriesOption, Model, PRIORITY, ParallelCoordinateSystemOption, ParallelSeriesOption$1 as ParallelSeriesOption, PatternObject, Payload, PictorialBarSeriesOption$1 as PictorialBarSeriesOption, PieSeriesOption$1 as PieSeriesOption, PiecewiseVisualMapOption, PolarOption, RadarOption, RadarSeriesOption$1 as RadarSeriesOption, RadialGradientObject, RadiusAxisOption, RegisteredSeriesOption, ResizeOpts, SVGPatternObject, SankeySeriesOption$1 as SankeySeriesOption, ScatterSeriesOption$1 as ScatterSeriesOption, ScrollableLegendOption, SelectChangedPayload, SeriesData, SeriesModel, SeriesOption$1 as SeriesOption, SetOptionOpts, SetOptionTransitionOpt, SetOptionTransitionOptItem, SingleAxisOption, SliderDataZoomOption, StrategySeriesOption$1 as StrategySeriesOption, SunburstSeriesOption$1 as SunburstSeriesOption, ThemeRiverSeriesOption$1 as ThemeRiverSeriesOption, TimelineOption, TitleOption, ToolboxComponentOption, TooltipFormatterCallback, TooltipOption, TooltipPositionCallback, TooltipPositionCallbackParams, TopLevelFormatterParams, TreeSeriesOption$1 as TreeSeriesOption, TreemapSeriesOption$1 as TreemapSeriesOption, VisualMapComponentOption, XAXisOption, YAXisOption, ZRColor, brushSingle, colorToRgba, color_d, connect, connectLayoutAction, connectLayouts, contrastColor, dataTool, dependencies, disConnect, disconnect, disconnectLayoutAction, disconnectLayouts, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_d, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_d, helper_d, init$1 as init, install$1 as install, install$2 as install$1, install$b as install$10, install$c as install$11, install$d as install$12, install$e as install$13, install$f as install$14, install$g as install$15, install$h as install$16, install$i as install$17, install$j as install$18, install$k as install$19, install$3 as install$2, install$l as install$20, install$m as install$21, install$n as install$22, install$o as install$23, install$p as install$24, install$q as install$25, install$r as install$26, install$s as install$27, install$t as install$28, install$u as install$29, install$4 as install$3, install$v as install$30, install$w as install$31, install$x as install$32, install$y as install$33, install$z as install$34, install$A as install$35, install$B as install$36, install$C as install$37, install$D as install$38, install$E as install$39, install$5 as install$4, install$F as install$40, install$G as install$41, install$
|
|
11647
|
+
export { AngleAxisOption, AnimationDelayCallback, AnimationDelayCallbackParam, AnimationDurationCallback, AriaOption, Axis, AxisPointerOption, BarSeriesOption$1 as BarSeriesOption, BoxplotSeriesOption$1 as BoxplotSeriesOption, BrushOption, CalendarOption, CallbackDataParams, CandlestickSeriesOption$1 as CandlestickSeriesOption, ChartView, ComponentModel, ComponentView, ComposeOption, ContinousVisualMapOption, CustomSeriesOption$1 as CustomSeriesOption, CustomSeriesRenderItem, CustomSeriesRenderItemAPI, CustomSeriesRenderItemParams, CustomSeriesRenderItemReturn, DataZoomComponentOption, DatasetOption, DownplayPayload, ECBasicOption, ECElementEvent, EChartsInitOpts, EChartsOption, EChartsType, EffectScatterSeriesOption$1 as EffectScatterSeriesOption, ElementEvent, FunnelSeriesOption$1 as FunnelSeriesOption, GaugeSeriesOption$1 as GaugeSeriesOption, GeoOption, GraphSeriesOption$1 as GraphSeriesOption, GraphicComponentLooseOption, GridOption, HeatmapSeriesOption$1 as HeatmapSeriesOption, HighlightPayload, ImagePatternObject, InsideDataZoomOption, LabelFormatterCallback, LabelLayoutOptionCallback, LabelLayoutOptionCallbackParams, LegendComponentOption, LegendOption, LineSeriesOption$1 as LineSeriesOption, LinearGradientObject, LinesPlotSeriesOption$1 as LinesPlotSeriesOption, LinesSeriesOption$1 as LinesSeriesOption, MapSeriesOption$1 as MapSeriesOption, MarkAreaOption, MarkLabelOption, MarkLineOption, MarkPointOption, MineLinesSeriesOption$1 as MineLinesSeriesOption, Model, PRIORITY, ParallelCoordinateSystemOption, ParallelSeriesOption$1 as ParallelSeriesOption, PatternObject, Payload, PictorialBarSeriesOption$1 as PictorialBarSeriesOption, PieSeriesOption$1 as PieSeriesOption, PiecewiseVisualMapOption, PolarOption, RadarOption, RadarSeriesOption$1 as RadarSeriesOption, RadialGradientObject, RadiusAxisOption, RegisteredSeriesOption, ResizeOpts, SVGPatternObject, SankeySeriesOption$1 as SankeySeriesOption, ScatterSeriesOption$1 as ScatterSeriesOption, ScrollableLegendOption, SelectChangedPayload, SeriesData, SeriesModel, SeriesOption$1 as SeriesOption, SetOptionOpts, SetOptionTransitionOpt, SetOptionTransitionOptItem, SingleAxisOption, SliderDataZoomOption, StrategySeriesOption$1 as StrategySeriesOption, SunburstSeriesOption$1 as SunburstSeriesOption, ThemeRiverSeriesOption$1 as ThemeRiverSeriesOption, TimelineOption, TitleOption, ToolboxComponentOption, TooltipFormatterCallback, TooltipOption, TooltipPositionCallback, TooltipPositionCallbackParams, TopLevelFormatterParams, TreeSeriesOption$1 as TreeSeriesOption, TreemapSeriesOption$1 as TreemapSeriesOption, VisualMapComponentOption, XAXisOption, YAXisOption, ZRColor, brushSingle, colorToRgba, color_d, connect, connectLayoutAction, connectLayouts, contrastColor, dataTool, dependencies, disConnect, disconnect, disconnectLayoutAction, disconnectLayouts, dispose$1 as dispose, env, extendChartView, extendComponentModel, extendComponentView, extendSeriesModel, format_d, getCoordinateSystemDimensions, getInstanceByDom, getInstanceById, getMap, graphic_d, helper_d, init$1 as init, install$1 as install, install$2 as install$1, install$b as install$10, install$c as install$11, install$d as install$12, install$e as install$13, install$f as install$14, install$g as install$15, install$h as install$16, install$i as install$17, install$j as install$18, install$k as install$19, install$3 as install$2, install$l as install$20, install$m as install$21, install$n as install$22, install$o as install$23, install$p as install$24, install$q as install$25, install$r as install$26, install$s as install$27, install$t as install$28, install$u as install$29, install$4 as install$3, install$v as install$30, install$w as install$31, install$x as install$32, install$y as install$33, install$z as install$34, install$A as install$35, install$B as install$36, install$C as install$37, install$D as install$38, install$E as install$39, install$5 as install$4, install$F as install$40, install$G as install$41, install$H as install$42, install$J as install$43, install$K as install$44, install$L as install$45, install$M as install$46, install$N as install$47, install$O as install$48, install$P as install$49, install$6 as install$5, install$Q as install$50, install$R as install$51, install$S as install$52, install$T as install$53, install$U as install$54, install$V as install$55, install$I as install$56, install$W as install$57, install$X as install$58, install$Y as install$59, install$7 as install$6, install$Z as install$60, install$_ as install$61, install$$ as install$62, install$10 as install$63, install$11 as install$64, install$12 as install$65, install$13 as install$66, install$14 as install$67, install$15 as install$68, install$16 as install$69, install$8 as install$7, install$17 as install$70, install$18 as install$71, install$19 as install$72, install$1a as install$73, install$1b as install$74, install$1c as install$75, install$1d as install$76, install$1e as install$77, install$1f as install$78, install$1g as install$79, install$9 as install$8, install$1h as install$80, install$1i as install$81, install as install$82, install$1j as install$83, install$1k as install$84, install$a as install$9, installLabelLayout, installUniversalTransition, matrix_d, number_d, parseGeoJSON, registerAction, registerCoordinateSystem, registerLayout, registerLoading, registerLocale, registerMap, registerPostInit, registerPostUpdate, registerPreprocessor, registerProcessor, registerTheme, registerTransform, registerUpdateLifecycle, registerVisual, setCanvasCreator, setPlatformAPI, throttle, time_d, use, util_d, util_d$1, vector_d, version$1 as version, zrender_d };
|
|
@@ -14,6 +14,7 @@ import { CoordinateSystemClipArea } from '../../coord/CoordinateSystem.js';
|
|
|
14
14
|
import Model from '../../model/Model.js';
|
|
15
15
|
declare type PolarArea = ReturnType<Polar['getArea']>;
|
|
16
16
|
declare type Cartesian2DArea = ReturnType<Cartesian2D['getArea']>;
|
|
17
|
+
export declare function turnPointsIntoStep(points: ArrayLike<number>, coordSys: Cartesian2D | Polar, stepTurnAt: 'start' | 'end' | 'middle', connectNulls: boolean, lineWidth?: number): number[];
|
|
17
18
|
export declare function canShowAllSymbolForCategory(categoryAxis: Axis2D, data: SeriesData): boolean;
|
|
18
19
|
interface EndLabelAnimationRecord {
|
|
19
20
|
lastFrameIndex: number;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import SeriesModel from '../../model/Series.js';
|
|
2
|
+
import { SeriesOnCartesianOptionMixin, SeriesOption, SeriesOnPolarOptionMixin, SeriesStackOptionMixin, SeriesLabelOption, LineStyleOption, ItemStyleOption, AreaStyleOption, OptionDataValue, SymbolOptionMixin, SeriesSamplingOptionMixin, StatesOptionMixin, SeriesEncodeOptionMixin, CallbackDataParams, DefaultEmphasisFocus } from '../../util/types.js';
|
|
3
|
+
import SeriesData from '../../data/SeriesData.js';
|
|
4
|
+
import type Cartesian2D from '../../coord/cartesian/Cartesian2D.js';
|
|
5
|
+
import type Polar from '../../coord/polar/Polar.js';
|
|
6
|
+
import { PathState } from 'tvrender/lib/graphic/Path.js';
|
|
7
|
+
declare type SymbolLineDataValue = OptionDataValue | OptionDataValue[];
|
|
8
|
+
interface SymbolLineStateOptionMixin {
|
|
9
|
+
emphasis?: {
|
|
10
|
+
focus?: DefaultEmphasisFocus;
|
|
11
|
+
scale?: boolean | number;
|
|
12
|
+
emphasisState?: PathState;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface SymbolLineStateOption<TCbParams = never> {
|
|
16
|
+
itemStyle?: ItemStyleOption<TCbParams>;
|
|
17
|
+
label?: SeriesLabelOption;
|
|
18
|
+
endLabel?: SymbolLineEndLabelOption;
|
|
19
|
+
}
|
|
20
|
+
export interface SymbolLineDataItemOption extends SymbolOptionMixin, SymbolLineStateOption, StatesOptionMixin<SymbolLineStateOption, SymbolLineStateOptionMixin> {
|
|
21
|
+
name?: string;
|
|
22
|
+
value?: SymbolLineDataValue;
|
|
23
|
+
}
|
|
24
|
+
export interface SymbolLineEndLabelOption extends SeriesLabelOption {
|
|
25
|
+
valueAnimation?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface SymbolLineSeriesOption extends SeriesOption<SymbolLineStateOption<CallbackDataParams>, SymbolLineStateOptionMixin & {
|
|
28
|
+
emphasis?: {
|
|
29
|
+
lineStyle?: Omit<LineStyleOption, 'width'> & {
|
|
30
|
+
width?: LineStyleOption['width'] | 'bolder';
|
|
31
|
+
};
|
|
32
|
+
areaStyle?: AreaStyleOption;
|
|
33
|
+
};
|
|
34
|
+
blur?: {
|
|
35
|
+
lineStyle?: LineStyleOption;
|
|
36
|
+
areaStyle?: AreaStyleOption;
|
|
37
|
+
};
|
|
38
|
+
}>, SymbolLineStateOption<CallbackDataParams>, SeriesOnCartesianOptionMixin, SeriesOnPolarOptionMixin, SeriesStackOptionMixin, SeriesSamplingOptionMixin, SymbolOptionMixin<CallbackDataParams>, SeriesEncodeOptionMixin {
|
|
39
|
+
type?: 'symbolLine';
|
|
40
|
+
coordinateSystem?: 'cartesian2d' | 'polar';
|
|
41
|
+
symbolSize?: number | number[];
|
|
42
|
+
clip?: boolean;
|
|
43
|
+
lineStyle?: LineStyleOption;
|
|
44
|
+
step?: false | 'start' | 'end' | 'middle';
|
|
45
|
+
smooth?: boolean | number;
|
|
46
|
+
smoothMonotone?: 'x' | 'y' | 'none';
|
|
47
|
+
connectNulls?: boolean;
|
|
48
|
+
ignoreBothEndsSymbol?: boolean;
|
|
49
|
+
showSymbol?: boolean;
|
|
50
|
+
showAllSymbol?: 'auto' | boolean;
|
|
51
|
+
data?: (SymbolLineDataValue | SymbolLineDataItemOption)[];
|
|
52
|
+
}
|
|
53
|
+
declare class SymbolLineSeriesModel extends SeriesModel<SymbolLineSeriesOption> {
|
|
54
|
+
static readonly type = "series.symbolLine";
|
|
55
|
+
type: string;
|
|
56
|
+
static readonly dependencies: string[];
|
|
57
|
+
coordinateSystem: Cartesian2D | Polar;
|
|
58
|
+
ignoreStyleOnData: boolean;
|
|
59
|
+
getInitialData(option: SymbolLineSeriesOption): SeriesData;
|
|
60
|
+
static defaultOption: SymbolLineSeriesOption;
|
|
61
|
+
}
|
|
62
|
+
export default SymbolLineSeriesModel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import ChartView from '../../view/Chart.js';
|
|
2
|
+
import GlobalModel from '../../model/Global.js';
|
|
3
|
+
import ExtensionAPI from '../../core/ExtensionAPI.js';
|
|
4
|
+
import SymbolLineSeriesModel from './SymbolLineSeries.js';
|
|
5
|
+
import { ECPolyline } from '../line/poly.js';
|
|
6
|
+
declare class SymbolLineView extends ChartView {
|
|
7
|
+
static readonly type = "symbolLine";
|
|
8
|
+
readonly type = "symbolLine";
|
|
9
|
+
_polyline: ECPolyline;
|
|
10
|
+
render(seriesModel: SymbolLineSeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void;
|
|
11
|
+
_renderNormal(seriesModel: SymbolLineSeriesModel): void;
|
|
12
|
+
_newPolyline(points: ArrayLike<number>): ECPolyline;
|
|
13
|
+
remove(ecModel: GlobalModel): void;
|
|
14
|
+
_clear(): void;
|
|
15
|
+
}
|
|
16
|
+
export default SymbolLineView;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as graphic from '../../util/graphic.js';
|
|
2
|
+
import { createSymbol } from '../../util/symbol.js';
|
|
3
|
+
import { PathProps } from 'tvrender/lib/graphic/Path.js';
|
|
4
|
+
import PathProxy from 'tvrender/lib/core/PathProxy.js';
|
|
5
|
+
declare class LargeSymbolPathShape {
|
|
6
|
+
points: number[];
|
|
7
|
+
needCenter?: boolean;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
ignoreBothEndsSymbol?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare type LargeSymbolPathProps = PathProps & {
|
|
13
|
+
shape?: Partial<LargeSymbolPathShape>;
|
|
14
|
+
};
|
|
15
|
+
declare type ECSymbol = ReturnType<typeof createSymbol>;
|
|
16
|
+
declare class SymbolPath extends graphic.Path<LargeSymbolPathProps> {
|
|
17
|
+
shape: LargeSymbolPathShape;
|
|
18
|
+
symbolProxy: ECSymbol;
|
|
19
|
+
constructor(opts?: LargeSymbolPathProps);
|
|
20
|
+
getDefaultShape(): LargeSymbolPathShape;
|
|
21
|
+
buildPath(path: PathProxy, shape: LargeSymbolPathShape): void;
|
|
22
|
+
}
|
|
23
|
+
export default SymbolPath;
|
|
@@ -25,6 +25,7 @@ export { install as BoxesChart } from '../chart/boxes/install.js';
|
|
|
25
25
|
export { install as CharPlotChart } from '../chart/charPlot/install.js';
|
|
26
26
|
export { install as CandlePlotChart } from '../chart/candlePlot/install.js';
|
|
27
27
|
export { install as CandleVolumeChart } from '../chart/candleVolume/install.js';
|
|
28
|
+
export { install as SymbolLineChart } from '../chart/symbolLine/install.js';
|
|
28
29
|
export { install as HeikinAshiChart } from '../chart/heikinAshi/install.js';
|
|
29
30
|
export { install as VolPathChart } from '../chart/volPath/install.js';
|
|
30
31
|
export { install as VolPathRectChart } from '../chart/volPathRect/install.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type SeriesModel from '../model/Series.js';
|
|
2
2
|
declare function isCandle(type: string): boolean;
|
|
3
3
|
declare function isPlot(type: string): boolean;
|
|
4
|
+
declare function isShowValuePlot(type: string): boolean;
|
|
4
5
|
declare function formatUpdateData(seriesModel: SeriesModel, item: (string | number)[], index: number): (string | number)[];
|
|
5
|
-
export { isCandle, isPlot, formatUpdateData };
|
|
6
|
+
export { isCandle, isPlot, formatUpdateData, isShowValuePlot };
|