tvcharts 0.6.49 → 0.6.51

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
@@ -24508,6 +24508,67 @@ var ECharts = class extends Eventful_default {
24508
24508
  doDispatchAction.call(this, payload, true);
24509
24509
  }
24510
24510
  }
24511
+ scrollByDistance(distance2, animationDuration) {
24512
+ const xAxisModal = this._model.getComponent("xAxis", 0);
24513
+ const scale4 = xAxisModal.axis.scale;
24514
+ const duration = isNumber(animationDuration) && animationDuration > 0 ? animationDuration : 0;
24515
+ const startLastBarRightSideDiffBarCount = scale4.lastBarRightSideDiffBarCount;
24516
+ if (duration > 0) {
24517
+ const startTime = new Date().getTime();
24518
+ const animation = () => {
24519
+ const progress = (new Date().getTime() - startTime) / duration;
24520
+ const finished = progress >= 1;
24521
+ const dis = finished ? distance2 : distance2 * progress;
24522
+ const distanceBarCount = dis / scale4.barSpace;
24523
+ const payload = {
24524
+ type: "dataZoom",
24525
+ barSpace: scale4.barSpace,
24526
+ lastBarRightSideDiffBarCount: startLastBarRightSideDiffBarCount - distanceBarCount
24527
+ };
24528
+ doDispatchAction.call(this, payload, true);
24529
+ if (!finished) {
24530
+ window.requestAnimationFrame(animation);
24531
+ }
24532
+ };
24533
+ animation();
24534
+ } else {
24535
+ const distanceBarCount = distance2 / scale4.barSpace;
24536
+ const payload = {
24537
+ type: "dataZoom",
24538
+ barSpace: scale4.barSpace,
24539
+ lastBarRightSideDiffBarCount: startLastBarRightSideDiffBarCount - distanceBarCount
24540
+ };
24541
+ doDispatchAction.call(this, payload, true);
24542
+ }
24543
+ }
24544
+ scrollToDataIndex(dataIndex, animationDuration) {
24545
+ if (this._disposed) {
24546
+ disposedWarning(this.id);
24547
+ return;
24548
+ }
24549
+ const xAxisModal = this._model.getComponent("xAxis", 0);
24550
+ const scale4 = xAxisModal.axis.scale;
24551
+ const extend2 = scale4.getExtent();
24552
+ const centerOffset = (extend2[1] - extend2[0]) / 2;
24553
+ const ordinalMeta = scale4.getOrdinalMeta();
24554
+ const size = ordinalMeta.getCategoriesSize();
24555
+ const distance2 = (scale4.lastBarRightSideDiffBarCount + (size - centerOffset - 1 - dataIndex)) * scale4.barSpace;
24556
+ this.scrollByDistance(distance2, animationDuration);
24557
+ console.log("%c [ xAxisModal ]-1751", "font-size:13px; background:pink; color:#bf2c9f;", xAxisModal);
24558
+ }
24559
+ scrollToTimestamp(timestamp, animationDuration) {
24560
+ if (this._disposed) {
24561
+ disposedWarning(this.id);
24562
+ return;
24563
+ }
24564
+ const xAxisModal = this._model.getComponent("xAxis", 0);
24565
+ const scale4 = xAxisModal.axis.scale;
24566
+ const ordinalMeta = scale4.getOrdinalMeta();
24567
+ const dataIndex = ordinalMeta.getOrdinal(timestamp);
24568
+ if (isNumber(dataIndex)) {
24569
+ this.scrollToDataIndex(dataIndex, animationDuration);
24570
+ }
24571
+ }
24511
24572
  };
24512
24573
  PENDING_UPDATE, IN_MAIN_PROCESS_KEY, CONNECT_STATUS_KEY, STATUS_NEEDS_UPDATE_KEY;
24513
24574
  ECharts.internalField = function() {
@@ -27418,6 +27479,9 @@ var OrdinalMeta = class {
27418
27479
  getLastCategories() {
27419
27480
  return this.categories[this.categories.length - 1];
27420
27481
  }
27482
+ getCategoriesSize() {
27483
+ return this.categories.length;
27484
+ }
27421
27485
  parseAndCollect(category) {
27422
27486
  let index;
27423
27487
  const needCollect = this._needCollect;
@@ -68888,18 +68952,24 @@ var TableView2 = class extends Component_default2 {
68888
68952
  tableGroup.add(rectEl);
68889
68953
  }
68890
68954
  if (frame_color && frame_width) {
68891
- const frameEl = new Rect_default({
68955
+ const x2 = -frame_width / 2;
68956
+ const y2 = -frame_width / 2;
68957
+ const frameEl = new Polyline_default({
68892
68958
  shape: {
68893
- x: -frame_width,
68894
- y: -frame_width,
68895
- width: width + frame_width * 2,
68896
- height: height + frame_width * 2
68959
+ points: [
68960
+ [x2, y2],
68961
+ [x2 + width + frame_width / 2, y2],
68962
+ [x2 + width + frame_width / 2, y2 + height + frame_width / 2],
68963
+ [x2, y2 + height + frame_width / 2],
68964
+ [x2, y2]
68965
+ ]
68897
68966
  },
68898
68967
  style: {
68899
- fill: frame_color
68968
+ stroke: frame_color,
68969
+ lineWidth: frame_width
68900
68970
  },
68901
68971
  z,
68902
- z2: 1
68972
+ z2: 15
68903
68973
  });
68904
68974
  tableGroup.add(frameEl);
68905
68975
  }