tvcharts 0.6.75 → 0.6.76

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
@@ -16255,6 +16255,7 @@ var BUITIN_COMPONENTS_MAP = {
16255
16255
  brush: "BrushComponent",
16256
16256
  title: "TitleComponent",
16257
16257
  table: "TableComponent",
16258
+ bgRect: "BgRectComponent",
16258
16259
  timeline: "TimelineComponent",
16259
16260
  markPoint: "MarkPointComponent",
16260
16261
  markLine: "MarkLineComponent",
@@ -17962,9 +17963,10 @@ DefaultDataProvider.internalField = function() {
17962
17963
  const lastIndex = data.length - 1;
17963
17964
  data[lastIndex] = newData;
17964
17965
  }
17965
- function updateDataSimply(newData) {
17966
+ function updateDataSimply(newData, isMustAppend) {
17966
17967
  const data = this._data;
17967
- const lastIndex = data.length - 1;
17968
+ const extraIndex = isMustAppend && newData.length === 1 ? 1 : 0;
17969
+ const lastIndex = data.length - 1 + extraIndex;
17968
17970
  let update = 0;
17969
17971
  for (let i = 0; i < newData.length; i++) {
17970
17972
  const ele = newData[i];
@@ -18927,13 +18929,13 @@ var DataStore2 = class {
18927
18929
  this._initDataFromProvider(0, end2);
18928
18930
  return [0, end2];
18929
18931
  }
18930
- updateData(data) {
18932
+ updateData(data, isMustAppend = false) {
18931
18933
  if (true) {
18932
18934
  assert(!this._indices, "appendData can only be called on raw data.");
18933
18935
  }
18934
18936
  const provider = this._provider;
18935
18937
  let start2 = this.count();
18936
- const {update} = provider.updateData(data);
18938
+ const {update} = provider.updateData(data, isMustAppend);
18937
18939
  let end2 = provider.count();
18938
18940
  start2 = start2 - update;
18939
18941
  if (!provider.persistent) {
@@ -20184,9 +20186,10 @@ var SeriesModel2 = class extends Component_default {
20184
20186
  return;
20185
20187
  }
20186
20188
  const isCandletick = isCandle(this.subType);
20189
+ const extraIndex = params.isMustAppend && params.data.length === 1 ? 1 : 0;
20187
20190
  const lastIndex = data.count(true) - 1;
20188
20191
  const list = map(params.data, (item, index) => {
20189
- const idx = lastIndex + index;
20192
+ const idx = lastIndex + index + extraIndex;
20190
20193
  if (isCandletick) {
20191
20194
  const value = item.value.slice();
20192
20195
  this.option.data[idx] = value;
@@ -20196,7 +20199,7 @@ var SeriesModel2 = class extends Component_default {
20196
20199
  }
20197
20200
  return item;
20198
20201
  });
20199
- data.updateData(list);
20202
+ data.updateData(list, params.isMustAppend);
20200
20203
  }
20201
20204
  getData(dataType) {
20202
20205
  const task = getCurrentTask(this);
@@ -24310,6 +24313,83 @@ var ECharts = class extends Eventful_default {
24310
24313
  return this.getDataURL(opts);
24311
24314
  }
24312
24315
  }
24316
+ getWindowConnectedDataURL(opts) {
24317
+ if (this._disposed) {
24318
+ disposedWarning(this.id);
24319
+ return;
24320
+ }
24321
+ const isSvg = opts.type === "svg";
24322
+ const mathMin12 = Math.min;
24323
+ const mathMax12 = Math.max;
24324
+ const MAX_NUMBER = Infinity;
24325
+ let left = MAX_NUMBER;
24326
+ let top = MAX_NUMBER;
24327
+ let right = -MAX_NUMBER;
24328
+ let bottom = -MAX_NUMBER;
24329
+ const canvasList = [];
24330
+ const dpr2 = opts && opts.pixelRatio || this.getDevicePixelRatio();
24331
+ const layoutId = this.layout;
24332
+ const groupIds = [];
24333
+ each(instances2, function(chart, id) {
24334
+ if (chart.layout === layoutId && !groupIds.includes(chart.group)) {
24335
+ groupIds.push(chart.group);
24336
+ }
24337
+ });
24338
+ each(instances2, function(chart, id) {
24339
+ if (groupIds.includes(chart.group)) {
24340
+ const canvas2 = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts));
24341
+ const boundingRect = chart.getDom().getBoundingClientRect();
24342
+ left = mathMin12(boundingRect.left, left);
24343
+ top = mathMin12(boundingRect.top, top);
24344
+ right = mathMax12(boundingRect.right, right);
24345
+ bottom = mathMax12(boundingRect.bottom, bottom);
24346
+ canvasList.push({
24347
+ dom: canvas2,
24348
+ left: boundingRect.left,
24349
+ top: boundingRect.top
24350
+ });
24351
+ }
24352
+ });
24353
+ left *= dpr2;
24354
+ top *= dpr2;
24355
+ right *= dpr2;
24356
+ bottom *= dpr2;
24357
+ const width = right - left;
24358
+ const height = bottom - top;
24359
+ const targetCanvas = platformApi.createCanvas();
24360
+ const zr = init(targetCanvas, {
24361
+ renderer: isSvg ? "svg" : "canvas"
24362
+ });
24363
+ zr.resize({
24364
+ width,
24365
+ height
24366
+ });
24367
+ if (opts.connectedBackgroundColor) {
24368
+ zr.add(new Rect_default({
24369
+ shape: {
24370
+ x: 0,
24371
+ y: 0,
24372
+ width,
24373
+ height
24374
+ },
24375
+ style: {
24376
+ fill: opts.connectedBackgroundColor
24377
+ }
24378
+ }));
24379
+ }
24380
+ each(canvasList, function(item) {
24381
+ const img = new Image_default({
24382
+ style: {
24383
+ x: item.left * dpr2 - left,
24384
+ y: item.top * dpr2 - top,
24385
+ image: item.dom
24386
+ }
24387
+ });
24388
+ zr.add(img);
24389
+ });
24390
+ zr.refreshImmediately();
24391
+ return targetCanvas.toDataURL("image/" + (opts && opts.type || "png"));
24392
+ }
24313
24393
  convertToPixel(finder, value) {
24314
24394
  return doConvertPixel(this, "convertToPixel", finder, value);
24315
24395
  }
@@ -24579,7 +24659,6 @@ var ECharts = class extends Eventful_default {
24579
24659
  }
24580
24660
  makeLayoutActionFromEvent(eventObj, type) {
24581
24661
  let payload = eventObj;
24582
- console.log("%c [ eventObj ]-1513", "font-size:13px; background:pink; color:#bf2c9f;", eventObj);
24583
24662
  switch (type) {
24584
24663
  case "visiblechanged":
24585
24664
  const {fromTime, toTime, offsetRightDistance, offsetLeftDistance} = eventObj;
@@ -24714,7 +24793,7 @@ var ECharts = class extends Eventful_default {
24714
24793
  return item;
24715
24794
  })});
24716
24795
  } else if (params.operation === "script") {
24717
- seriesModel.updateData({data: params.data});
24796
+ seriesModel.updateData({data: params.data, isMustAppend: params.isMustAppend});
24718
24797
  } else {
24719
24798
  const isCandletick = isCandle(seriesModel.subType);
24720
24799
  const formatData = map(params.data, (item) => {
@@ -26594,12 +26673,13 @@ var SeriesData2 = class {
26594
26673
  const range = this._store.appendData(data);
26595
26674
  this._doInit(range[0], range[1]);
26596
26675
  }
26597
- updateData(data) {
26598
- const range = this._store.updateData(data);
26676
+ updateData(data, isMustAppend) {
26677
+ const range = this._store.updateData(data, isMustAppend);
26599
26678
  this._doInit(range[0], range[1]);
26600
26679
  }
26601
26680
  resetUpdateData(data) {
26602
26681
  const range = this._store.resetUpdateData(data);
26682
+ this._resetOrdinalMeta();
26603
26683
  this._doInit(range[0], range[1]);
26604
26684
  }
26605
26685
  updateValue(value) {
@@ -66646,6 +66726,9 @@ var GraphicComponentView2 = class extends Component_default2 {
66646
66726
  const isInit = !elExisting;
66647
66727
  let el2 = elExisting;
66648
66728
  if (isInit) {
66729
+ if (!elOption.type) {
66730
+ return;
66731
+ }
66649
66732
  el2 = createEl2(id, targetElParent, elOption.type, elMap);
66650
66733
  } else {
66651
66734
  el2 && (inner15(el2).isNew = false);
@@ -67263,10 +67346,10 @@ var DataZoomModel2 = class extends Component_default {
67263
67346
  thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];
67264
67347
  }
67265
67348
  }, this);
67266
- if (opt.barSpace) {
67349
+ if (typeof opt.barSpace === "number") {
67267
67350
  thisOption.barSpace = opt.barSpace;
67268
67351
  }
67269
- if (opt.lastBarRightSideDiffBarCount) {
67352
+ if (typeof opt.lastBarRightSideDiffBarCount === "number") {
67270
67353
  thisOption.lastBarRightSideDiffBarCount = opt.lastBarRightSideDiffBarCount;
67271
67354
  }
67272
67355
  if (!isLocal && (typeof opt.barSpace === "number" || typeof opt.lastBarRightSideDiffBarCount === "number")) {
@@ -67553,7 +67636,9 @@ var AxisProxy = class {
67553
67636
  fromTime: +categories[visibleFrom],
67554
67637
  toTime: +categories[visibleTo],
67555
67638
  offsetRightDistance: lastBarRightSideDiffBarCount > 0 ? lastBarRightSideDiffBarCount * barSpace : 0,
67556
- offsetLeftDistance: from < 0 ? -from * barSpace : 0
67639
+ offsetLeftDistance: from < 0 ? -from * barSpace : 0,
67640
+ lastBarRightSideDiffBarCount,
67641
+ barSpace
67557
67642
  });
67558
67643
  } else {
67559
67644
  if (dataZoomModel.get("useValueRange") && (dataZoomModel.settledOption.startValue || dataZoomModel.settledOption.endValue)) {
@@ -71540,6 +71625,79 @@ function install53(registers) {
71540
71625
  registers.registerComponentView(TableView_default);
71541
71626
  }
71542
71627
 
71628
+ // src/component/bgRect/install.ts
71629
+ var BgRectModel2 = class extends Component_default {
71630
+ constructor() {
71631
+ super(...arguments);
71632
+ this.type = BgRectModel2.type;
71633
+ this.layoutMode = {type: "box", ignoreSize: true};
71634
+ }
71635
+ };
71636
+ var BgRectModel = BgRectModel2;
71637
+ BgRectModel.type = "bgRect";
71638
+ BgRectModel.defaultOption = {
71639
+ z: 2,
71640
+ show: true,
71641
+ color: "rgb(149, 100, 29)",
71642
+ bgColor: "rgba(149, 100, 29, 0.5)",
71643
+ startIndex: 10
71644
+ };
71645
+ var BgRectView2 = class extends Component_default2 {
71646
+ constructor() {
71647
+ super(...arguments);
71648
+ this.type = BgRectView2.type;
71649
+ }
71650
+ render(bgRectModel, ecModel, api2) {
71651
+ this.group.removeAll();
71652
+ if (!bgRectModel.get("show")) {
71653
+ return;
71654
+ }
71655
+ const group = this.group;
71656
+ const grid = ecModel.getComponent("grid", 0);
71657
+ const z = bgRectModel.get("z");
71658
+ const rect = grid.coordinateSystem.getRect();
71659
+ const startIndex = bgRectModel.get("startIndex");
71660
+ const bgColor = bgRectModel.get("bgColor");
71661
+ const color2 = bgRectModel.get("color");
71662
+ const xAxis = ecModel.getComponent("xAxis", 0);
71663
+ const xAxis2D = xAxis.axis;
71664
+ const x = xAxis2D.toGlobalCoord(xAxis2D.dataToCoord(startIndex));
71665
+ const lineEl = new Line_default({
71666
+ shape: {
71667
+ x1: x,
71668
+ y1: rect.y,
71669
+ x2: x,
71670
+ y2: rect.height
71671
+ },
71672
+ style: {
71673
+ lineWidth: 2,
71674
+ stroke: color2
71675
+ },
71676
+ z
71677
+ });
71678
+ const rectEl = new Rect_default({
71679
+ shape: {
71680
+ x: Math.max(rect.x, x),
71681
+ y: rect.y,
71682
+ height: rect.height,
71683
+ width: rect.width + rect.x - x
71684
+ },
71685
+ style: {
71686
+ fill: bgColor
71687
+ },
71688
+ z
71689
+ });
71690
+ group.add(lineEl);
71691
+ group.add(rectEl);
71692
+ }
71693
+ };
71694
+ var BgRectView = BgRectView2;
71695
+ BgRectView.type = "bgRect";
71696
+ function install54(registers) {
71697
+ registers.registerComponentModel(BgRectModel);
71698
+ registers.registerComponentView(BgRectView);
71699
+ }
71700
+
71543
71701
  // src/component/timeline/TimelineModel.ts
71544
71702
  var TimelineModel2 = class extends Component_default {
71545
71703
  constructor() {
@@ -72389,7 +72547,7 @@ function has(obj, attr) {
72389
72547
  }
72390
72548
 
72391
72549
  // src/component/timeline/install.ts
72392
- function install54(registers) {
72550
+ function install55(registers) {
72393
72551
  registers.registerComponentModel(SliderTimelineModel_default);
72394
72552
  registers.registerComponentView(SliderTimelineView_default);
72395
72553
  registers.registerSubTypeDefaulter("timeline", function() {
@@ -72830,7 +72988,7 @@ function createData(coordSys, seriesModel, mpModel) {
72830
72988
  var MarkPointView_default = MarkPointView;
72831
72989
 
72832
72990
  // src/component/marker/installMarkPoint.ts
72833
- function install55(registers) {
72991
+ function install56(registers) {
72834
72992
  registers.registerComponentModel(MarkPointModel_default);
72835
72993
  registers.registerComponentView(MarkPointView_default);
72836
72994
  registers.registerPreprocessor(function(opt) {
@@ -73148,7 +73306,7 @@ function createList2(coordSys, seriesModel, mlModel) {
73148
73306
  var MarkLineView_default = MarkLineView;
73149
73307
 
73150
73308
  // src/component/marker/installMarkLine.ts
73151
- function install56(registers) {
73309
+ function install57(registers) {
73152
73310
  registers.registerComponentModel(MarkLineModel_default);
73153
73311
  registers.registerComponentView(MarkLineView_default);
73154
73312
  registers.registerPreprocessor(function(opt) {
@@ -73462,7 +73620,7 @@ function createList3(coordSys, seriesModel, maModel) {
73462
73620
  var MarkAreaView_default = MarkAreaView;
73463
73621
 
73464
73622
  // src/component/marker/installMarkArea.ts
73465
- function install57(registers) {
73623
+ function install58(registers) {
73466
73624
  registers.registerComponentModel(MarkAreaModel_default);
73467
73625
  registers.registerComponentView(MarkAreaView_default);
73468
73626
  registers.registerPreprocessor(function(opt) {
@@ -74105,7 +74263,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
74105
74263
  var MarkLabelView_default = MarkLabelView;
74106
74264
 
74107
74265
  // src/component/marker/installMarkLabel.ts
74108
- function install58(registers) {
74266
+ function install59(registers) {
74109
74267
  registers.registerComponentModel(MarkLabelModal_default);
74110
74268
  registers.registerComponentView(MarkLabelView_default);
74111
74269
  registers.registerPreprocessor(function(opt) {
@@ -74787,7 +74945,7 @@ function installLegendAction(registers) {
74787
74945
  }
74788
74946
 
74789
74947
  // src/component/legend/installLegendPlain.ts
74790
- function install59(registers) {
74948
+ function install60(registers) {
74791
74949
  registers.registerComponentModel(LegendModel_default);
74792
74950
  registers.registerComponentView(LegendView_default);
74793
74951
  registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);
@@ -75117,17 +75275,17 @@ function installScrollableLegendAction(registers) {
75117
75275
  }
75118
75276
 
75119
75277
  // src/component/legend/installLegendScroll.ts
75120
- function install60(registers) {
75121
- use(install59);
75278
+ function install61(registers) {
75279
+ use(install60);
75122
75280
  registers.registerComponentModel(ScrollableLegendModel_default);
75123
75281
  registers.registerComponentView(ScrollableLegendView_default);
75124
75282
  installScrollableLegendAction(registers);
75125
75283
  }
75126
75284
 
75127
75285
  // src/component/legend/install.ts
75128
- function install61(registers) {
75129
- use(install59);
75286
+ function install62(registers) {
75130
75287
  use(install60);
75288
+ use(install61);
75131
75289
  }
75132
75290
 
75133
75291
  // src/component/dataZoom/InsideZoomModel.ts
@@ -75554,7 +75712,7 @@ var getDirectionInfo = {
75554
75712
  var InsideZoomView_default = InsideZoomView;
75555
75713
 
75556
75714
  // src/component/dataZoom/installDataZoomInside.ts
75557
- function install62(registers) {
75715
+ function install63(registers) {
75558
75716
  installCommon(registers);
75559
75717
  registers.registerComponentModel(InsideZoomModel_default);
75560
75718
  registers.registerComponentView(InsideZoomView_default);
@@ -76310,16 +76468,16 @@ function getCursor(orient) {
76310
76468
  var SliderZoomView_default = SliderZoomView;
76311
76469
 
76312
76470
  // src/component/dataZoom/installDataZoomSlider.ts
76313
- function install63(registers) {
76471
+ function install64(registers) {
76314
76472
  registers.registerComponentModel(SliderZoomModel_default);
76315
76473
  registers.registerComponentView(SliderZoomView_default);
76316
76474
  installCommon(registers);
76317
76475
  }
76318
76476
 
76319
76477
  // src/component/dataZoom/install.ts
76320
- function install64(registers) {
76321
- use(install62);
76478
+ function install65(registers) {
76322
76479
  use(install63);
76480
+ use(install64);
76323
76481
  }
76324
76482
 
76325
76483
  // src/visual/visualDefault.ts
@@ -77584,7 +77742,7 @@ function installCommon2(registers) {
77584
77742
  }
77585
77743
 
77586
77744
  // src/component/visualMap/installVisualMapContinuous.ts
77587
- function install65(registers) {
77745
+ function install66(registers) {
77588
77746
  registers.registerComponentModel(ContinuousModel_default);
77589
77747
  registers.registerComponentView(ContinuousView_default);
77590
77748
  installCommon2(registers);
@@ -78024,16 +78182,16 @@ PiecewiseVisualMapView.type = "visualMap.piecewise";
78024
78182
  var PiecewiseView_default = PiecewiseVisualMapView;
78025
78183
 
78026
78184
  // src/component/visualMap/installVisualMapPiecewise.ts
78027
- function install66(registers) {
78185
+ function install67(registers) {
78028
78186
  registers.registerComponentModel(PiecewiseModel_default);
78029
78187
  registers.registerComponentView(PiecewiseView_default);
78030
78188
  installCommon2(registers);
78031
78189
  }
78032
78190
 
78033
78191
  // src/component/visualMap/install.ts
78034
- function install67(registers) {
78035
- use(install65);
78192
+ function install68(registers) {
78036
78193
  use(install66);
78194
+ use(install67);
78037
78195
  }
78038
78196
 
78039
78197
  // src/visual/aria.ts
@@ -78229,7 +78387,7 @@ function ariaPreprocessor(option) {
78229
78387
  }
78230
78388
 
78231
78389
  // src/component/aria/install.ts
78232
- function install68(registers) {
78390
+ function install69(registers) {
78233
78391
  registers.registerPreprocessor(ariaPreprocessor);
78234
78392
  registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);
78235
78393
  }
@@ -78567,7 +78725,7 @@ var sortTransform = {
78567
78725
  };
78568
78726
 
78569
78727
  // src/component/transform/install.ts
78570
- function install69(registers) {
78728
+ function install70(registers) {
78571
78729
  registers.registerTransform(filterTransform);
78572
78730
  registers.registerTransform(sortTransform);
78573
78731
  }
@@ -78605,7 +78763,7 @@ var DatasetView = class extends Component_default2 {
78605
78763
  }
78606
78764
  };
78607
78765
  DatasetView.type = "dataset";
78608
- function install70(registers) {
78766
+ function install71(registers) {
78609
78767
  registers.registerComponentModel(DatasetModel);
78610
78768
  registers.registerComponentView(DatasetView);
78611
78769
  }
@@ -80363,16 +80521,17 @@ use(install55);
80363
80521
  use(install56);
80364
80522
  use(install57);
80365
80523
  use(install58);
80366
- use(install61);
80367
- use(install64);
80524
+ use(install59);
80368
80525
  use(install62);
80369
- use(install63);
80370
- use(install67);
80371
80526
  use(install65);
80372
- use(install66);
80527
+ use(install63);
80528
+ use(install64);
80373
80529
  use(install68);
80530
+ use(install66);
80531
+ use(install67);
80374
80532
  use(install69);
80375
80533
  use(install70);
80534
+ use(install71);
80376
80535
  use(installUniversalTransition);
80377
80536
  use(installLabelLayout);
80378
80537