tvcharts 0.9.11 → 0.9.12

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.
@@ -228,7 +228,7 @@ function optimalCandlestickWidth(barSpacing, pixelRatio) {
228
228
  var barSpacingSpecialCaseTo = 4;
229
229
  var barSpacingSpecialCaseCoeff = 3;
230
230
  if (barSpacing >= barSpacingSpecialCaseFrom && barSpacing <= barSpacingSpecialCaseTo) {
231
- return Math.floor(barSpacingSpecialCaseCoeff * pixelRatio) - 2;
231
+ return Math.floor(barSpacingSpecialCaseCoeff * pixelRatio) - 1;
232
232
  }
233
233
  // coeff should be 1 on small barspacing and go to 0.8 while groing bar spacing
234
234
  var barSpacingReducingCoeff = 0.2;
@@ -46,6 +46,9 @@ 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
48
  var r = 15;
49
+ var optimizeX = function (x, lineWidth) {
50
+ return lineWidth % 2 === 0 ? x : Math.floor(x) + 0.5;
51
+ };
49
52
  var EventsView = /** @class */function (_super) {
50
53
  __extends(EventsView, _super);
51
54
  function EventsView() {
@@ -59,7 +62,7 @@ var EventsView = /** @class */function (_super) {
59
62
  }
60
63
  EventsView.prototype.init = function (ecModel, api) {
61
64
  this._api = api;
62
- // api.getZr().on('mousemove', this._mouseMove, this);
65
+ // api.getZr().on('mousemove', this._eventClick, this);
63
66
  };
64
67
 
65
68
  EventsView.prototype.render = function (eventsModel, ecModel, api) {
@@ -118,6 +121,7 @@ var EventsView = /** @class */function (_super) {
118
121
  var id = time + "_" + item.id;
119
122
  var isSelected = selectedEventViewId === id;
120
123
  var renderZ = isSelected ? z + 1 : z;
124
+ var imgGroup = new graphic.Group();
121
125
  var img = new graphic.Image({
122
126
  style: {
123
127
  image: item.url,
@@ -139,7 +143,7 @@ var EventsView = /** @class */function (_super) {
139
143
  }
140
144
  });
141
145
  img.setClipPath(clipPath);
142
- group.add(img);
146
+ imgGroup.add(img);
143
147
  var rect = new graphic.Rect({
144
148
  shape: {
145
149
  x: x + 5 - borderWidth / 2,
@@ -150,7 +154,8 @@ var EventsView = /** @class */function (_super) {
150
154
  },
151
155
  style: {
152
156
  stroke: "#ED544F",
153
- fill: "none"
157
+ fill: "none",
158
+ lineWidth: borderWidth
154
159
  },
155
160
  z2: z2,
156
161
  z: renderZ
@@ -162,7 +167,7 @@ var EventsView = /** @class */function (_super) {
162
167
  this.hoverEventId = '';
163
168
  }
164
169
  }
165
- group.add(rect);
170
+ imgGroup.add(rect);
166
171
  if (i !== list.length - 1) {
167
172
  y = y - 24;
168
173
  }
@@ -195,21 +200,23 @@ var EventsView = /** @class */function (_super) {
195
200
  }
196
201
  });
197
202
  };
198
- img.onmouseout = mouseout;
199
- img.onmousemove = mouseMove;
200
- img.onmouseover = mouseover;
201
- img.onclick = click;
202
- rect.onmouseout = mouseout;
203
- rect.onmousemove = mouseMove;
204
- rect.onmouseover = mouseover;
205
- rect.onclick = click;
203
+ imgGroup.onmouseout = mouseout;
204
+ imgGroup.onmousemove = mouseMove;
205
+ imgGroup.onmouseover = mouseover;
206
+ imgGroup.onclick = click;
207
+ group.add(imgGroup);
208
+ // rect.onmouseout = mouseout;
209
+ // rect.onmousemove = mouseMove;
210
+ // rect.onmouseover = mouseover;
211
+ // rect.onclick = click;
206
212
  }, this_1);
207
213
  if (lineVisible && list.length) {
214
+ var linex = optimizeX(x + 15, lineStyle.width);
208
215
  var line = new graphic.Line({
209
216
  shape: {
210
- x1: x + 15,
217
+ x1: linex,
211
218
  y1: 0,
212
- x2: x + 15,
219
+ x2: linex,
213
220
  y2: y
214
221
  },
215
222
  silent: true,
@@ -230,6 +237,8 @@ var EventsView = /** @class */function (_super) {
230
237
  if (state_1 === "break") break;
231
238
  }
232
239
  };
240
+ // _eventClick(e: any){
241
+ // }
233
242
  EventsView.prototype._mouseMove = function (e) {
234
243
  this._lastPoint = {
235
244
  x: e.offsetX,
@@ -242,7 +251,9 @@ var EventsView = /** @class */function (_super) {
242
251
  x: 0,
243
252
  y: 0
244
253
  };
254
+ // this._api && this._api.getZr()?.off('mousemove', this._eventClick);
245
255
  };
256
+
246
257
  EventsView.type = "events";
247
258
  return EventsView;
248
259
  }(ComponentView);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tvcharts",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "main": "dist/echarts.js",
5
5
  "module": "index.js",
6
6
  "jsdelivr": "dist/echarts.min.js",