tvcharts 0.9.15 → 0.9.17
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.
|
@@ -131,7 +131,8 @@ var BoxesLayout = {
|
|
|
131
131
|
return {
|
|
132
132
|
progress: function (params, boxesData) {
|
|
133
133
|
var store = boxesData.getStore();
|
|
134
|
-
|
|
134
|
+
// const linesPointById: Record<string, number[]> = {};
|
|
135
|
+
var linesPoints = [];
|
|
135
136
|
var textList = [];
|
|
136
137
|
for (var i = params.start; i < params.end; i++) {
|
|
137
138
|
var x1Val = store.get(x1DimI, i);
|
|
@@ -159,7 +160,7 @@ var BoxesLayout = {
|
|
|
159
160
|
continue;
|
|
160
161
|
}
|
|
161
162
|
var key = (border_color || 'none') + ":" + border_width + ":" + style + ":" + bgcolor;
|
|
162
|
-
|
|
163
|
+
// const points = [];
|
|
163
164
|
optimizePoint(startPoint, endPoint, border_width);
|
|
164
165
|
var _b = getHExtend(startPoint[0], endPoint[0], extend),
|
|
165
166
|
left = _b[0],
|
|
@@ -191,11 +192,16 @@ var BoxesLayout = {
|
|
|
191
192
|
fontWeight: fontWeight
|
|
192
193
|
});
|
|
193
194
|
}
|
|
194
|
-
points.push(left, right, startPoint[1], endPoint[1]);
|
|
195
|
-
|
|
195
|
+
// points.push(left, right, startPoint[1], endPoint[1]);
|
|
196
|
+
linesPoints.push({
|
|
197
|
+
points: [left, right, startPoint[1], endPoint[1]],
|
|
198
|
+
key: key
|
|
199
|
+
});
|
|
200
|
+
// linesPointById[key] = points;
|
|
196
201
|
}
|
|
202
|
+
|
|
197
203
|
data.setLayout({
|
|
198
|
-
|
|
204
|
+
linesPoints: linesPoints,
|
|
199
205
|
textList: textList
|
|
200
206
|
});
|
|
201
207
|
}
|
|
@@ -76,13 +76,14 @@ var BoxesPath = /** @class */function (_super) {
|
|
|
76
76
|
path.lineTo(right, bottom);
|
|
77
77
|
path.lineTo(left, bottom);
|
|
78
78
|
path.closePath();
|
|
79
|
-
if (i < points.length - 2) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
79
|
+
// if (i < points.length - 2) {
|
|
80
|
+
// hasFill && path.fillStyle(fill);
|
|
81
|
+
// hasStroke && path.strokeStyle(stroke);
|
|
82
|
+
// path.beginPathFill();
|
|
83
|
+
// }
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
+
|
|
86
87
|
return BoxesPath;
|
|
87
88
|
}(graphic.Path);
|
|
88
89
|
export default BoxesPath;
|
|
@@ -95,8 +95,10 @@ var BoxesView = /** @class */function (_super) {
|
|
|
95
95
|
var isMobile = seriesModel.get('isMobile');
|
|
96
96
|
var linesGroup = this._linesGroup;
|
|
97
97
|
var z2 = seriesModel.get('z2');
|
|
98
|
-
var linesPointById = data.getLayout('
|
|
99
|
-
each(linesPointById, function (item
|
|
98
|
+
var linesPointById = data.getLayout('linesPoints');
|
|
99
|
+
each(linesPointById, function (item) {
|
|
100
|
+
var key = item.key,
|
|
101
|
+
points = item.points;
|
|
100
102
|
var _a = key.split(':'),
|
|
101
103
|
color = _a[0],
|
|
102
104
|
width = _a[1],
|
|
@@ -104,7 +106,7 @@ var BoxesView = /** @class */function (_super) {
|
|
|
104
106
|
fill = _a[3];
|
|
105
107
|
var el = new BoxesPath({
|
|
106
108
|
shape: {
|
|
107
|
-
points:
|
|
109
|
+
points: points,
|
|
108
110
|
fill: fill || 'none',
|
|
109
111
|
stroke: color,
|
|
110
112
|
isWebviewRender: isMobile
|
|
@@ -45,6 +45,13 @@ import { __extends } from "tslib";
|
|
|
45
45
|
import ComponentView from "../../view/Component.js";
|
|
46
46
|
import { each } from "tvrender/lib/core/util.js";
|
|
47
47
|
import * as graphic from "../../util/graphic.js";
|
|
48
|
+
import { getIsLightColor } from '../../util/color.js';
|
|
49
|
+
var getRectFill = function (color) {
|
|
50
|
+
if (typeof color !== 'string') {
|
|
51
|
+
return '#000';
|
|
52
|
+
}
|
|
53
|
+
return getIsLightColor(color) ? '#fff' : '#000';
|
|
54
|
+
};
|
|
48
55
|
var r = 15;
|
|
49
56
|
var optimizeX = function (x, lineWidth) {
|
|
50
57
|
return lineWidth % 2 === 0 ? x : Math.floor(x) + 0.5;
|
|
@@ -96,6 +103,7 @@ var EventsView = /** @class */function (_super) {
|
|
|
96
103
|
var lineStyle = eventsModel.get('lineStyle');
|
|
97
104
|
var z = eventsModel.get('z');
|
|
98
105
|
var selectedEventViewId = eventsModel.get('selectedEventViewId');
|
|
106
|
+
var backgroundColor = ecModel.get('backgroundColor') || '#fff';
|
|
99
107
|
var hoverEventId = this.hoverEventId;
|
|
100
108
|
var lastPoint = this._lastPoint;
|
|
101
109
|
var mouseMove = this._mouseMove.bind(this);
|
|
@@ -143,7 +151,6 @@ var EventsView = /** @class */function (_super) {
|
|
|
143
151
|
}
|
|
144
152
|
});
|
|
145
153
|
img.setClipPath(clipPath);
|
|
146
|
-
imgGroup.add(img);
|
|
147
154
|
var rect = new graphic.Rect({
|
|
148
155
|
shape: {
|
|
149
156
|
x: x + 5 - borderWidth / 2,
|
|
@@ -154,7 +161,7 @@ var EventsView = /** @class */function (_super) {
|
|
|
154
161
|
},
|
|
155
162
|
style: {
|
|
156
163
|
stroke: "#ED544F",
|
|
157
|
-
fill:
|
|
164
|
+
fill: getRectFill(backgroundColor),
|
|
158
165
|
lineWidth: borderWidth
|
|
159
166
|
},
|
|
160
167
|
z2: z2,
|
|
@@ -168,6 +175,7 @@ var EventsView = /** @class */function (_super) {
|
|
|
168
175
|
}
|
|
169
176
|
}
|
|
170
177
|
imgGroup.add(rect);
|
|
178
|
+
imgGroup.add(img);
|
|
171
179
|
if (i !== list.length - 1) {
|
|
172
180
|
y = y - 24;
|
|
173
181
|
}
|