tvcharts 0.8.99 → 0.9.10

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/dist/echarts.js CHANGED
@@ -42307,9 +42307,15 @@ function getStore(zr) {
42307
42307
  registerAction({type: "takeGlobalCursor", event: "globalCursorTaken", update: "update"}, noop);
42308
42308
 
42309
42309
  // src/component/helper/RoamController.ts
42310
+ function getDistance(p1, p2) {
42311
+ const xDiff = p1.clientX - p2.clientX;
42312
+ const yDiff = p1.clientY - p2.clientY;
42313
+ return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
42314
+ }
42310
42315
  var RoamController = class extends Eventful_default {
42311
42316
  constructor(zr) {
42312
42317
  super();
42318
+ this._prevPinchScale = 1;
42313
42319
  this._zr = zr;
42314
42320
  const mousedownHandler = bind(this._mousedownHandler, this);
42315
42321
  const mousemoveHandler = bind(this._mousemoveHandler, this);
@@ -42469,10 +42475,20 @@ var RoamController = class extends Eventful_default {
42469
42475
  if (isTaken(this._zr, "globalPan")) {
42470
42476
  return;
42471
42477
  }
42472
- const scale4 = e2.pinchScale;
42478
+ const touches = e2.event.touches;
42479
+ if (e2.pinchScale === 1) {
42480
+ this._prevPinchScale = 1;
42481
+ this._startPinchDistance = getDistance(touches[0], touches[1]);
42482
+ this._originX = Math.floor(e2.pinchX);
42483
+ return;
42484
+ }
42485
+ const currentDistance = getDistance(touches[0], touches[1]);
42486
+ const scale4 = currentDistance / this._startPinchDistance;
42487
+ const zoomScale = (scale4 - this._prevPinchScale) * 5;
42488
+ this._prevPinchScale = scale4;
42473
42489
  checkPointerAndTrigger(this, "zoom", "zoomOnMouseWheel", e2, {
42474
- scale: scale4,
42475
- originX: e2.pinchX,
42490
+ scale: zoomScale,
42491
+ originX: this._originX || e2.pinchX,
42476
42492
  originY: e2.pinchY,
42477
42493
  isAvailableBehavior: null,
42478
42494
  inSitu: true,
@@ -56688,6 +56704,11 @@ var SymbolPath_default = SymbolPath;
56688
56704
 
56689
56705
  // src/chart/linesPlot/LinesPlotView.ts
56690
56706
  var LastZ2 = -1;
56707
+ var lineStyleMap = {
56708
+ style_dotted: [2, 2],
56709
+ style_solid: "solid",
56710
+ style_dashed: [5, 5]
56711
+ };
56691
56712
  function clipColorStops2(colorStops, maxSize) {
56692
56713
  const newColorStops = [];
56693
56714
  const len2 = colorStops.length;
@@ -56887,7 +56908,7 @@ var LinesPlotView2 = class extends Chart_default {
56887
56908
  isWebviewRender: isMobile
56888
56909
  },
56889
56910
  style: {
56890
- lineDash,
56911
+ lineDash: lineStyleMap[lineDash],
56891
56912
  stroke: visualColor || color2,
56892
56913
  lineWidth: +lineWidth,
56893
56914
  lineCap: "round",
@@ -57308,7 +57329,7 @@ var linesPlotLayout = {
57308
57329
  const itemModal = lineData.getRawDataItem(i);
57309
57330
  const {
57310
57331
  color: color2,
57311
- type = "solid",
57332
+ type = "style_solid",
57312
57333
  width = "1",
57313
57334
  rgbas
57314
57335
  } = itemModal.lineStyle || {};
@@ -57375,7 +57396,7 @@ var linesPlotLayout = {
57375
57396
  const itemModel = lineData.getItemModel(params.end);
57376
57397
  const {
57377
57398
  color: color3,
57378
- type: type2 = "solid",
57399
+ type: type2 = "style_solid",
57379
57400
  width: width2 = "1"
57380
57401
  } = itemModel.get("lineStyle");
57381
57402
  stylePointInfo = {
@@ -59805,7 +59826,7 @@ function getFontSizeByBarWidth(barWidth) {
59805
59826
  function getFontSize2(size, barWidth) {
59806
59827
  return charFontSizeMapping[size] || getFontSizeByBarWidth(barWidth);
59807
59828
  }
59808
- function getDistance(location, fontSize) {
59829
+ function getDistance2(location, fontSize) {
59809
59830
  if (location === "absolute") {
59810
59831
  return 0;
59811
59832
  }
@@ -59841,7 +59862,7 @@ var CharPlotLayout = {
59841
59862
  const location = seriesModel.get("location");
59842
59863
  const size = seriesModel.get("size");
59843
59864
  const fontSize = getFontSize2(size, bandWidth);
59844
- const distance2 = getDistance(location, fontSize);
59865
+ const distance2 = getDistance2(location, fontSize);
59845
59866
  const dims = map(coordSys.dimensions, function(dim) {
59846
59867
  return data.mapDimension(dim);
59847
59868
  }).slice(0, 2);
@@ -59994,38 +60015,38 @@ var CandlePlotView2 = class extends Chart_default {
59994
60015
  const bodyPointsByColor = data.getLayout("bodyPointsByColor");
59995
60016
  const wickPointsByColor = data.getLayout("wickPointsByColor");
59996
60017
  const isMobile = seriesModel.get("isMobile");
59997
- each(bodyPointsByColor, function(points4, key) {
59998
- const [fill, stroke] = key.split(":");
59999
- const el = new NormalBoxPath_default({
60018
+ each(wickPointsByColor, function(points4, key) {
60019
+ const [stroke] = key.split(":");
60020
+ const el = new WickPath_default({
60000
60021
  shape: {
60001
60022
  points: points4,
60002
- isSimpleBox,
60003
- fill: fill !== "none" ? fill : "",
60004
60023
  isMobile,
60005
60024
  stroke: stroke !== "none" ? stroke : ""
60006
60025
  },
60007
60026
  style: {
60008
- fill,
60009
60027
  stroke
60010
60028
  }
60011
60029
  });
60012
- group.add(el);
60013
60030
  el.states.emphasis = emphasisState;
60031
+ group.add(el);
60014
60032
  });
60015
- each(wickPointsByColor, function(points4, key) {
60016
- const [stroke] = key.split(":");
60017
- const el = new WickPath_default({
60033
+ each(bodyPointsByColor, function(points4, key) {
60034
+ const [fill, stroke] = key.split(":");
60035
+ const el = new NormalBoxPath_default({
60018
60036
  shape: {
60019
60037
  points: points4,
60038
+ isSimpleBox,
60039
+ fill: !isSimpleBox || fill !== "none" ? fill : "",
60020
60040
  isMobile,
60021
- stroke: stroke !== "none" ? stroke : ""
60041
+ stroke: stroke === "none" ? "" : stroke
60022
60042
  },
60023
60043
  style: {
60044
+ fill: isSimpleBox ? "none" : fill,
60024
60045
  stroke
60025
60046
  }
60026
60047
  });
60027
- el.states.emphasis = emphasisState;
60028
60048
  group.add(el);
60049
+ el.states.emphasis = emphasisState;
60029
60050
  });
60030
60051
  const clipPath = seriesModel.get("clip", true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;
60031
60052
  if (clipPath) {
@@ -60201,10 +60222,10 @@ var candlePlotLayout = {
60201
60222
  function addBodyEnd(ends, point, start2) {
60202
60223
  const point1 = point.slice();
60203
60224
  const point2 = point.slice();
60204
- point1[cDimIdx] = subPixelOptimize2(point1[cDimIdx] + candleWidth / 2, 1, false);
60205
- point2[cDimIdx] = subPixelOptimize2(point2[cDimIdx] - candleWidth / 2, 1, true);
60206
- point1[1] += 0.5;
60207
- point2[1] += 0.5;
60225
+ point1[0] = point1[0] - Math.floor(candleWidth * 0.5);
60226
+ point2[0] = point1[0] + candleWidth;
60227
+ point1[1] -= 0.5;
60228
+ point2[1] -= 0.5;
60208
60229
  start2 ? ends.push(point1, point2) : ends.push(point2, point1);
60209
60230
  }
60210
60231
  function subPixelOptimizePoint(point) {
@@ -60247,9 +60268,6 @@ function calculateCandleWidth2(seriesModel, data) {
60247
60268
  const bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : (extent3 = baseAxis.getExtent(), Math.abs(extent3[1] - extent3[0]) / data.count());
60248
60269
  return optimalCandlestickWidth(bandWidth, 1);
60249
60270
  }
60250
- function getRenderIndexX(bandWidth, x) {
60251
- return subPixelOptimize2(x - bandWidth / 2, 1, false);
60252
- }
60253
60271
  var candlePlotLayout_default = candlePlotLayout;
60254
60272
 
60255
60273
  // src/chart/candlePlot/install.ts
@@ -74305,6 +74323,7 @@ var EventsView2 = class extends Component_default2 {
74305
74323
  const selectedEventViewId = eventsModel.get("selectedEventViewId");
74306
74324
  const hoverEventId = this.hoverEventId;
74307
74325
  const lastPoint = this._lastPoint;
74326
+ const mouseMove = this._mouseMove.bind(this);
74308
74327
  const borderWidth = 2;
74309
74328
  for (let index = 0; index < data.length; index++) {
74310
74329
  const {time, list} = data[index];
@@ -74398,11 +74417,11 @@ var EventsView2 = class extends Component_default2 {
74398
74417
  });
74399
74418
  };
74400
74419
  img.onmouseout = mouseout;
74401
- img.onmousemove = this._mouseMove;
74420
+ img.onmousemove = mouseMove;
74402
74421
  img.onmouseover = mouseover;
74403
74422
  img.onclick = click;
74404
74423
  rect2.onmouseout = mouseout;
74405
- rect2.onmousemove = this._mouseMove;
74424
+ rect2.onmousemove = mouseMove;
74406
74425
  rect2.onmouseover = mouseover;
74407
74426
  rect2.onclick = click;
74408
74427
  }, this);
@@ -81200,11 +81219,9 @@ var getRangeHandlers = {
81200
81219
  distanceRange[0] = barSpaceLimit(distanceRange[0] * e2.scale, maxWidth);
81201
81220
  if (e2.inSitu) {
81202
81221
  const extent3 = axisModel.axis.getExtent()[1];
81203
- let x = axisModel.axis.toLocalCoord(e2.originX);
81222
+ const x = axisModel.axis.toLocalCoord(e2.originX);
81204
81223
  if (e2.isPinch) {
81205
- const [startIndex, endIndex] = axisModel.axis.scale.getExtent();
81206
- const basex = axisModel.axis.toLocalCoord(axisModel.axis.dataToCoord(Math.floor((endIndex + startIndex) / 2)));
81207
- x = getRenderIndexX(axisModel.axis.getBandWidth(), basex);
81224
+ distanceRange[0] = barSpaceLimit(lastDistanceRange[0] + lastDistanceRange[0] / 10 * e2.scale, maxWidth);
81208
81225
  }
81209
81226
  const dataCount = axisModel.axis.scale.getAxisDataLen();
81210
81227
  const deltaFromRight = (extent3 - x) / lastDistanceRange[0];