tvcharts 0.9.19 → 0.9.20
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.
|
@@ -72,6 +72,7 @@ var CandlePlotView = /** @class */function (_super) {
|
|
|
72
72
|
var group = this.group;
|
|
73
73
|
group.removeAll();
|
|
74
74
|
var emphasisState = seriesModel.get('emphasis').emphasisState;
|
|
75
|
+
var info = seriesModel.get('info');
|
|
75
76
|
var groupId = seriesModel.get('groupId');
|
|
76
77
|
// const emphasisStyle = emphasis.itemStyle || {};
|
|
77
78
|
var isSimpleBox = data.getLayout('isSimpleBox');
|
|
@@ -91,6 +92,7 @@ var CandlePlotView = /** @class */function (_super) {
|
|
|
91
92
|
}
|
|
92
93
|
});
|
|
93
94
|
el.states.emphasis = emphasisState;
|
|
95
|
+
el.info = info;
|
|
94
96
|
group.add(el);
|
|
95
97
|
});
|
|
96
98
|
zrUtil.each(bodyPointsByColor, function (points, key) {
|
|
@@ -114,6 +116,7 @@ var CandlePlotView = /** @class */function (_super) {
|
|
|
114
116
|
});
|
|
115
117
|
group.add(el);
|
|
116
118
|
el.states.emphasis = emphasisState;
|
|
119
|
+
el.info = info;
|
|
117
120
|
});
|
|
118
121
|
// const coordSys = seriesModel.coordinateSystem;
|
|
119
122
|
var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;
|
|
@@ -225,20 +225,28 @@ function calculateCandleWidth(seriesModel, data) {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
function optimalCandlestickWidth(barSpacing, pixelRatio) {
|
|
228
|
-
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
// coeff should be 1 on small barspacing and go to 0.8 while groing bar spacing
|
|
235
|
-
var barSpacingReducingCoeff = 0.2;
|
|
236
|
-
var coeff = 1 - barSpacingReducingCoeff * Math.atan(Math.max(barSpacingSpecialCaseTo, barSpacing) - barSpacingSpecialCaseTo) / (Math.PI * 0.5);
|
|
237
|
-
var res = Math.floor(barSpacing * coeff * pixelRatio);
|
|
238
|
-
var scaledBarSpacing = Math.floor(barSpacing * pixelRatio);
|
|
239
|
-
var optimal = Math.min(res, scaledBarSpacing) - 2;
|
|
240
|
-
return Math.max(Math.floor(pixelRatio), optimal);
|
|
228
|
+
if (barSpacing >= 2.5 && barSpacing <= 4) return Math.floor(3 * pixelRatio) - 1;
|
|
229
|
+
var n = 1 - .2 * Math.atan(Math.max(4, barSpacing) - 4) / (.5 * Math.PI),
|
|
230
|
+
i = Math.floor(barSpacing * n * pixelRatio),
|
|
231
|
+
s = Math.floor(barSpacing * pixelRatio),
|
|
232
|
+
r = Math.min(i, s - 1);
|
|
233
|
+
return Math.max(Math.floor(pixelRatio), r);
|
|
241
234
|
}
|
|
235
|
+
// function optimalCandlestickWidth(barSpacing: number, pixelRatio: number): number {
|
|
236
|
+
// const barSpacingSpecialCaseFrom = 2.5;
|
|
237
|
+
// const barSpacingSpecialCaseTo = 4;
|
|
238
|
+
// const barSpacingSpecialCaseCoeff = 3;
|
|
239
|
+
// if (barSpacing >= barSpacingSpecialCaseFrom && barSpacing <= barSpacingSpecialCaseTo) {
|
|
240
|
+
// return Math.floor(barSpacingSpecialCaseCoeff * pixelRatio) - 1;
|
|
241
|
+
// }
|
|
242
|
+
// // coeff should be 1 on small barspacing and go to 0.8 while groing bar spacing
|
|
243
|
+
// const barSpacingReducingCoeff = 0.2;
|
|
244
|
+
// const coeff = 1 - barSpacingReducingCoeff * Math.atan(Math.max(barSpacingSpecialCaseTo, barSpacing) - barSpacingSpecialCaseTo) / (Math.PI * 0.5);
|
|
245
|
+
// const res = Math.floor(barSpacing * coeff * pixelRatio);
|
|
246
|
+
// const scaledBarSpacing = Math.floor(barSpacing * pixelRatio);
|
|
247
|
+
// const optimal = Math.min(res, scaledBarSpacing) - 2;
|
|
248
|
+
// return Math.max(Math.floor(pixelRatio), optimal);
|
|
249
|
+
// }
|
|
242
250
|
export function getRenderIndexX(bandWidth, x) {
|
|
243
251
|
return subPixelOptimize(x - bandWidth / 2, 1, false);
|
|
244
252
|
}
|
|
@@ -619,6 +619,7 @@ var LineView = /** @class */function (_super) {
|
|
|
619
619
|
var blurScope = emphasisModel.get('blurScope');
|
|
620
620
|
var emphasisDisabled = emphasisModel.get('disabled');
|
|
621
621
|
var groupId = seriesModel.get('groupId');
|
|
622
|
+
var info = seriesModel.get('info');
|
|
622
623
|
polyline.useStyle(zrUtil.defaults(
|
|
623
624
|
// Use color in lineStyle first
|
|
624
625
|
lineStyleModel.getLineStyle(), {
|
|
@@ -628,6 +629,7 @@ var LineView = /** @class */function (_super) {
|
|
|
628
629
|
}));
|
|
629
630
|
if (groupId) {
|
|
630
631
|
polyline.states.emphasis = emphasisModel.get('emphasisState');
|
|
632
|
+
polyline.info = info;
|
|
631
633
|
} else {
|
|
632
634
|
setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');
|
|
633
635
|
if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {
|
package/package.json
CHANGED
package/types/dist/echarts.d.ts
CHANGED
|
@@ -7893,6 +7893,7 @@ interface SeriesOption<StateOption = unknown, StatesMixin extends StatesMixinBas
|
|
|
7893
7893
|
isMain?: boolean;
|
|
7894
7894
|
histbase?: number;
|
|
7895
7895
|
isMobile?: boolean;
|
|
7896
|
+
info?: any;
|
|
7896
7897
|
}
|
|
7897
7898
|
interface SeriesOnCartesianOptionMixin {
|
|
7898
7899
|
xAxisIndex?: number;
|
package/types/dist/shared.d.ts
CHANGED
|
@@ -7894,6 +7894,7 @@ interface SeriesOption<StateOption = unknown, StatesMixin extends StatesMixinBas
|
|
|
7894
7894
|
isMain?: boolean;
|
|
7895
7895
|
histbase?: number;
|
|
7896
7896
|
isMobile?: boolean;
|
|
7897
|
+
info?: any;
|
|
7897
7898
|
}
|
|
7898
7899
|
interface SeriesOnCartesianOptionMixin {
|
|
7899
7900
|
xAxisIndex?: number;
|
|
@@ -1270,6 +1270,7 @@ export interface SeriesOption<StateOption = unknown, StatesMixin extends StatesM
|
|
|
1270
1270
|
isMain?: boolean;
|
|
1271
1271
|
histbase?: number;
|
|
1272
1272
|
isMobile?: boolean;
|
|
1273
|
+
info?: any;
|
|
1273
1274
|
}
|
|
1274
1275
|
export interface SeriesOnCartesianOptionMixin {
|
|
1275
1276
|
xAxisIndex?: number;
|