tvcharts 0.8.96 → 0.8.97

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
@@ -16432,6 +16432,7 @@ var BUITIN_COMPONENTS_MAP = {
16432
16432
  axisPointer: "AxisPointerComponent",
16433
16433
  brush: "BrushComponent",
16434
16434
  title: "TitleComponent",
16435
+ events: "EventsComponent",
16435
16436
  limitTip: "LimitTipComponent",
16436
16437
  cursorPointer: "CursorPointerComponent",
16437
16438
  table: "TableComponent",
@@ -25011,7 +25012,8 @@ var ECharts = class extends Eventful_default {
25011
25012
  "selectidchanged",
25012
25013
  "playbackselected",
25013
25014
  "snapshotzoom",
25014
- "playbackorder"
25015
+ "playbackorder",
25016
+ "events"
25015
25017
  ], (eventType) => {
25016
25018
  this._messageCenter.on(eventType, function(event) {
25017
25019
  this.trigger(eventType, event);
@@ -66622,7 +66624,7 @@ var AxisPointerView2 = class extends Component_default2 {
66622
66624
  this.xLock = false;
66623
66625
  }
66624
66626
  const updatePointDisable = globalTooltipModel && globalTooltipModel.option.updatePointDisable;
66625
- if (updatePointDisable || playbackSelectModel?.option.show || globalAxisPointerModel.option.updatePointDisable) {
66627
+ if (e2?.preventAxisPointer || updatePointDisable || playbackSelectModel?.option.show || globalAxisPointerModel.option.updatePointDisable) {
66626
66628
  return;
66627
66629
  }
66628
66630
  if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) {
@@ -69318,8 +69320,8 @@ var GraphicComponentView2 = class extends Component_default2 {
69318
69320
  if (elOption.style) {
69319
69321
  el.attr("style", elOption.style);
69320
69322
  }
69321
- if (elOption.x || elOption.y) {
69322
- el.attr({x: elOption.x, y: elOption.y});
69323
+ if (elOption.x || elOption.y || elOption.rotation) {
69324
+ el.attr({x: elOption.x, y: elOption.y, rotation: elOption.rotation});
69323
69325
  }
69324
69326
  if (elOption.shape) {
69325
69327
  el.attr("shape", elOption.shape);
@@ -74198,6 +74200,208 @@ function install54(registers) {
74198
74200
  registers.registerComponentView(TitleView);
74199
74201
  }
74200
74202
 
74203
+ // src/component/events/EventsModel.ts
74204
+ var EventsModel2 = class extends Component_default {
74205
+ constructor() {
74206
+ super(...arguments);
74207
+ this.type = EventsModel2.type;
74208
+ this.layoutMode = {type: "box", ignoreSize: true};
74209
+ }
74210
+ };
74211
+ var EventsModel = EventsModel2;
74212
+ EventsModel.type = "events";
74213
+ EventsModel.defaultOption = {
74214
+ z: 6,
74215
+ show: true,
74216
+ data: [],
74217
+ lineVisible: true,
74218
+ lineStyle: {
74219
+ color: "#82858f",
74220
+ width: 1,
74221
+ type: "solid"
74222
+ }
74223
+ };
74224
+
74225
+ // src/component/events/EventsView.ts
74226
+ var EventsView2 = class extends Component_default2 {
74227
+ constructor() {
74228
+ super(...arguments);
74229
+ this.type = EventsView2.type;
74230
+ this._lastPoint = {
74231
+ x: 0,
74232
+ y: 0
74233
+ };
74234
+ }
74235
+ init(ecModel, api2) {
74236
+ this._api = api2;
74237
+ }
74238
+ render(eventsModel, ecModel, api2) {
74239
+ this.group.removeAll();
74240
+ if (!eventsModel.get("show")) {
74241
+ return;
74242
+ }
74243
+ const group = this.group;
74244
+ const data = eventsModel.get("data");
74245
+ const xAxisModal = ecModel.getComponent("xAxis", 0);
74246
+ if (!xAxisModal) {
74247
+ return;
74248
+ }
74249
+ const scale4 = xAxisModal.axis.scale;
74250
+ const ordinalMeta = scale4.getOrdinalMeta();
74251
+ const [startIndex, endIndex] = scale4.getExtent();
74252
+ let rect;
74253
+ const gird = ecModel.getComponent("grid", 0);
74254
+ if (gird && gird.coordinateSystem) {
74255
+ rect = gird.coordinateSystem.getRect();
74256
+ }
74257
+ if (!rect) {
74258
+ return;
74259
+ }
74260
+ const lineVisible = eventsModel.get("lineVisible");
74261
+ const lineStyle = eventsModel.get("lineStyle");
74262
+ const hoverEventId = this.hoverEventId;
74263
+ const lastPoint = this._lastPoint;
74264
+ const borderWidth = 2;
74265
+ for (let index = 0; index < data.length; index++) {
74266
+ const {time, list} = data[index];
74267
+ const idx = ordinalMeta.parseAndCollect(time);
74268
+ if (idx < startIndex) {
74269
+ continue;
74270
+ }
74271
+ if (idx > endIndex) {
74272
+ break;
74273
+ }
74274
+ const x = xAxisModal.axis.dataToCoord(idx) + 5;
74275
+ let y = rect.height - rect.x;
74276
+ const z2 = data.length - index;
74277
+ each(list, function(item, i) {
74278
+ const yGap = 4 * (i + 1);
74279
+ const imgY = y - yGap;
74280
+ const id = `${time}_${item.id}`;
74281
+ const img = new Image_default({
74282
+ style: {
74283
+ image: item.url,
74284
+ x,
74285
+ y: imgY,
74286
+ width: 30,
74287
+ height: 20
74288
+ },
74289
+ z2
74290
+ });
74291
+ const clipPath = new Rect_default({
74292
+ shape: {
74293
+ x: x + 5,
74294
+ y: imgY,
74295
+ width: 20,
74296
+ height: 20,
74297
+ r: 10
74298
+ }
74299
+ });
74300
+ img.setClipPath(clipPath);
74301
+ group.add(img);
74302
+ const rect2 = new Rect_default({
74303
+ shape: {
74304
+ x: x + 5 - borderWidth / 2,
74305
+ y: imgY - borderWidth / 2,
74306
+ width: 20 + borderWidth,
74307
+ height: 20 + borderWidth,
74308
+ r: 10
74309
+ },
74310
+ style: {
74311
+ stroke: "#ED544F",
74312
+ fill: "none"
74313
+ },
74314
+ z2
74315
+ });
74316
+ if (hoverEventId === id) {
74317
+ if (rect2.contain(lastPoint.x, lastPoint.y)) {
74318
+ rect2.style.stroke = "#296bef";
74319
+ } else {
74320
+ this.hoverEventId = "";
74321
+ }
74322
+ }
74323
+ group.add(rect2);
74324
+ if (i !== list.length - 1) {
74325
+ y = y - 24;
74326
+ }
74327
+ const mouseout = () => {
74328
+ this.hoverEventId = "";
74329
+ rect2.attr("style", {stroke: "#ED544F"});
74330
+ };
74331
+ const mouseover = () => {
74332
+ this.hoverEventId = id;
74333
+ rect2.attr("style", {stroke: "#296bef"});
74334
+ api2.dispatchAction({
74335
+ type: "updateAxisPointer",
74336
+ currTrigger: "globalout"
74337
+ });
74338
+ };
74339
+ const click = (e2) => {
74340
+ e2.preventAxisPointer = true;
74341
+ api2.trigger("events", {
74342
+ time,
74343
+ id: item.id,
74344
+ position: {
74345
+ x: rect2.shape.x,
74346
+ y: rect2.shape.y,
74347
+ rect: api2.getDom().getBoundingClientRect()
74348
+ }
74349
+ });
74350
+ };
74351
+ img.onmouseout = mouseout;
74352
+ img.onmousemove = this._mouseMove;
74353
+ img.onmouseover = mouseover;
74354
+ img.onclick = click;
74355
+ rect2.onmouseout = mouseout;
74356
+ rect2.onmousemove = this._mouseMove;
74357
+ rect2.onmouseover = mouseover;
74358
+ rect2.onclick = click;
74359
+ }, this);
74360
+ if (lineVisible && list.length) {
74361
+ const line2 = new Line_default({
74362
+ shape: {
74363
+ x1: x + 15,
74364
+ y1: 0,
74365
+ x2: x + 15,
74366
+ y2: y
74367
+ },
74368
+ silent: true,
74369
+ style: {
74370
+ stroke: lineStyle.color,
74371
+ lineWidth: lineStyle.width,
74372
+ lineDash: lineStyle.type
74373
+ },
74374
+ z2: 0
74375
+ });
74376
+ group.add(line2);
74377
+ }
74378
+ }
74379
+ }
74380
+ _clickEvent(e2, id) {
74381
+ }
74382
+ _mouseMove(e2) {
74383
+ this._lastPoint = {
74384
+ x: e2.offsetX,
74385
+ y: e2.offsetY
74386
+ };
74387
+ e2.preventAxisPointer = true;
74388
+ }
74389
+ dispose() {
74390
+ this._lastPoint = {
74391
+ x: 0,
74392
+ y: 0
74393
+ };
74394
+ }
74395
+ };
74396
+ var EventsView = EventsView2;
74397
+ EventsView.type = "events";
74398
+
74399
+ // src/component/events/install.ts
74400
+ function install55(registers) {
74401
+ registers.registerComponentModel(EventsModel);
74402
+ registers.registerComponentView(EventsView);
74403
+ }
74404
+
74201
74405
  // src/component/cursorPointer/install.ts
74202
74406
  var CursorPointerModel2 = class extends Component_default {
74203
74407
  constructor() {
@@ -74269,7 +74473,7 @@ var CursorPointerView2 = class extends Component_default2 {
74269
74473
  };
74270
74474
  var CursorPointerView = CursorPointerView2;
74271
74475
  CursorPointerView.type = "cursorPointer";
74272
- function install55(registers) {
74476
+ function install56(registers) {
74273
74477
  registers.registerComponentModel(CursorPointerModel);
74274
74478
  registers.registerComponentView(CursorPointerView);
74275
74479
  }
@@ -74686,7 +74890,7 @@ TableView.type = "table";
74686
74890
  var TableView_default = TableView;
74687
74891
 
74688
74892
  // src/component/table/install.ts
74689
- function install56(registers) {
74893
+ function install57(registers) {
74690
74894
  registers.registerComponentModel(TableModel_default);
74691
74895
  registers.registerComponentView(TableView_default);
74692
74896
  }
@@ -75145,7 +75349,7 @@ AlarmModel.defaultOption = {
75145
75349
  var AlarmModel_default = AlarmModel;
75146
75350
 
75147
75351
  // src/component/alarm/install.ts
75148
- function install57(registers) {
75352
+ function install58(registers) {
75149
75353
  registers.registerComponentView(AlarmView_default);
75150
75354
  registers.registerComponentModel(AlarmModel_default);
75151
75355
  registers.registerAction({type: "alarm", event: "alarm", update: "updateVisual"}, function(payload, ecModel) {
@@ -75223,7 +75427,7 @@ var BgRectView2 = class extends Component_default2 {
75223
75427
  };
75224
75428
  var BgRectView = BgRectView2;
75225
75429
  BgRectView.type = "bgRect";
75226
- function install58(registers) {
75430
+ function install59(registers) {
75227
75431
  registers.registerComponentModel(BgRectModel);
75228
75432
  registers.registerComponentView(BgRectView);
75229
75433
  }
@@ -76699,7 +76903,7 @@ var PlaybackOrderView3 = PlaybackOrderView4;
76699
76903
  PlaybackOrderView3.type = "playbackOrder";
76700
76904
 
76701
76905
  // src/component/playback/install.ts
76702
- function install59(registers) {
76906
+ function install60(registers) {
76703
76907
  registers.registerComponentModel(PlaybackSelectModel);
76704
76908
  registers.registerComponentView(PlaybackSelectView);
76705
76909
  registers.registerComponentModel(PlaybackOrderModel);
@@ -76767,7 +76971,7 @@ var LogoView2 = class extends Component_default2 {
76767
76971
  };
76768
76972
  var LogoView = LogoView2;
76769
76973
  LogoView.type = "logo";
76770
- function install60(registers) {
76974
+ function install61(registers) {
76771
76975
  registers.registerComponentModel(LogoModel);
76772
76976
  registers.registerComponentView(LogoView);
76773
76977
  }
@@ -77621,7 +77825,7 @@ function has(obj, attr) {
77621
77825
  }
77622
77826
 
77623
77827
  // src/component/timeline/install.ts
77624
- function install61(registers) {
77828
+ function install62(registers) {
77625
77829
  registers.registerComponentModel(SliderTimelineModel_default);
77626
77830
  registers.registerComponentView(SliderTimelineView_default);
77627
77831
  registers.registerSubTypeDefaulter("timeline", function() {
@@ -78062,7 +78266,7 @@ function createData(coordSys, seriesModel, mpModel) {
78062
78266
  var MarkPointView_default = MarkPointView;
78063
78267
 
78064
78268
  // src/component/marker/installMarkPoint.ts
78065
- function install62(registers) {
78269
+ function install63(registers) {
78066
78270
  registers.registerComponentModel(MarkPointModel_default);
78067
78271
  registers.registerComponentView(MarkPointView_default);
78068
78272
  registers.registerPreprocessor(function(opt) {
@@ -78380,7 +78584,7 @@ function createList2(coordSys, seriesModel, mlModel) {
78380
78584
  var MarkLineView_default = MarkLineView;
78381
78585
 
78382
78586
  // src/component/marker/installMarkLine.ts
78383
- function install63(registers) {
78587
+ function install64(registers) {
78384
78588
  registers.registerComponentModel(MarkLineModel_default);
78385
78589
  registers.registerComponentView(MarkLineView_default);
78386
78590
  registers.registerPreprocessor(function(opt) {
@@ -78694,7 +78898,7 @@ function createList3(coordSys, seriesModel, maModel) {
78694
78898
  var MarkAreaView_default = MarkAreaView;
78695
78899
 
78696
78900
  // src/component/marker/installMarkArea.ts
78697
- function install64(registers) {
78901
+ function install65(registers) {
78698
78902
  registers.registerComponentModel(MarkAreaModel_default);
78699
78903
  registers.registerComponentView(MarkAreaView_default);
78700
78904
  registers.registerPreprocessor(function(opt) {
@@ -79446,7 +79650,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
79446
79650
  var MarkLabelView_default = MarkLabelView;
79447
79651
 
79448
79652
  // src/component/marker/installMarkLabel.ts
79449
- function install65(registers) {
79653
+ function install66(registers) {
79450
79654
  registers.registerComponentModel(MarkLabelModal_default);
79451
79655
  registers.registerComponentView(MarkLabelView_default);
79452
79656
  registers.registerPreprocessor(function(opt) {
@@ -79512,7 +79716,7 @@ var LimitTipView2 = class extends Component_default2 {
79512
79716
  };
79513
79717
  var LimitTipView = LimitTipView2;
79514
79718
  LimitTipView.type = "limitTip";
79515
- function install66(registers) {
79719
+ function install67(registers) {
79516
79720
  registers.registerComponentModel(LimitTipModel);
79517
79721
  registers.registerComponentView(LimitTipView);
79518
79722
  }
@@ -80189,7 +80393,7 @@ function installLegendAction(registers) {
80189
80393
  }
80190
80394
 
80191
80395
  // src/component/legend/installLegendPlain.ts
80192
- function install67(registers) {
80396
+ function install68(registers) {
80193
80397
  registers.registerComponentModel(LegendModel_default);
80194
80398
  registers.registerComponentView(LegendView_default);
80195
80399
  registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);
@@ -80519,17 +80723,17 @@ function installScrollableLegendAction(registers) {
80519
80723
  }
80520
80724
 
80521
80725
  // src/component/legend/installLegendScroll.ts
80522
- function install68(registers) {
80523
- use(install67);
80726
+ function install69(registers) {
80727
+ use(install68);
80524
80728
  registers.registerComponentModel(ScrollableLegendModel_default);
80525
80729
  registers.registerComponentView(ScrollableLegendView_default);
80526
80730
  installScrollableLegendAction(registers);
80527
80731
  }
80528
80732
 
80529
80733
  // src/component/legend/install.ts
80530
- function install69(registers) {
80531
- use(install67);
80734
+ function install70(registers) {
80532
80735
  use(install68);
80736
+ use(install69);
80533
80737
  }
80534
80738
 
80535
80739
  // src/component/dataZoom/InsideZoomModel.ts
@@ -81128,7 +81332,7 @@ var getDirectionInfo = {
81128
81332
  var InsideZoomView_default = InsideZoomView;
81129
81333
 
81130
81334
  // src/component/dataZoom/installDataZoomInside.ts
81131
- function install70(registers) {
81335
+ function install71(registers) {
81132
81336
  installCommon(registers);
81133
81337
  registers.registerComponentModel(InsideZoomModel_default);
81134
81338
  registers.registerComponentView(InsideZoomView_default);
@@ -81884,16 +82088,16 @@ function getCursor(orient) {
81884
82088
  var SliderZoomView_default = SliderZoomView;
81885
82089
 
81886
82090
  // src/component/dataZoom/installDataZoomSlider.ts
81887
- function install71(registers) {
82091
+ function install72(registers) {
81888
82092
  registers.registerComponentModel(SliderZoomModel_default);
81889
82093
  registers.registerComponentView(SliderZoomView_default);
81890
82094
  installCommon(registers);
81891
82095
  }
81892
82096
 
81893
82097
  // src/component/dataZoom/install.ts
81894
- function install72(registers) {
81895
- use(install70);
82098
+ function install73(registers) {
81896
82099
  use(install71);
82100
+ use(install72);
81897
82101
  }
81898
82102
 
81899
82103
  // src/visual/visualDefault.ts
@@ -83158,7 +83362,7 @@ function installCommon2(registers) {
83158
83362
  }
83159
83363
 
83160
83364
  // src/component/visualMap/installVisualMapContinuous.ts
83161
- function install73(registers) {
83365
+ function install74(registers) {
83162
83366
  registers.registerComponentModel(ContinuousModel_default);
83163
83367
  registers.registerComponentView(ContinuousView_default);
83164
83368
  installCommon2(registers);
@@ -83598,16 +83802,16 @@ PiecewiseVisualMapView.type = "visualMap.piecewise";
83598
83802
  var PiecewiseView_default = PiecewiseVisualMapView;
83599
83803
 
83600
83804
  // src/component/visualMap/installVisualMapPiecewise.ts
83601
- function install74(registers) {
83805
+ function install75(registers) {
83602
83806
  registers.registerComponentModel(PiecewiseModel_default);
83603
83807
  registers.registerComponentView(PiecewiseView_default);
83604
83808
  installCommon2(registers);
83605
83809
  }
83606
83810
 
83607
83811
  // src/component/visualMap/install.ts
83608
- function install75(registers) {
83609
- use(install73);
83812
+ function install76(registers) {
83610
83813
  use(install74);
83814
+ use(install75);
83611
83815
  }
83612
83816
 
83613
83817
  // src/visual/aria.ts
@@ -83803,7 +84007,7 @@ function ariaPreprocessor(option) {
83803
84007
  }
83804
84008
 
83805
84009
  // src/component/aria/install.ts
83806
- function install76(registers) {
84010
+ function install77(registers) {
83807
84011
  registers.registerPreprocessor(ariaPreprocessor);
83808
84012
  registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);
83809
84013
  }
@@ -84141,7 +84345,7 @@ var sortTransform = {
84141
84345
  };
84142
84346
 
84143
84347
  // src/component/transform/install.ts
84144
- function install77(registers) {
84348
+ function install78(registers) {
84145
84349
  registers.registerTransform(filterTransform);
84146
84350
  registers.registerTransform(sortTransform);
84147
84351
  }
@@ -84179,7 +84383,7 @@ var DatasetView = class extends Component_default2 {
84179
84383
  }
84180
84384
  };
84181
84385
  DatasetView.type = "dataset";
84182
- function install78(registers) {
84386
+ function install79(registers) {
84183
84387
  registers.registerComponentModel(DatasetModel);
84184
84388
  registers.registerComponentView(DatasetView);
84185
84389
  }
@@ -85933,8 +86137,8 @@ use(install52);
85933
86137
  use(install44);
85934
86138
  use(install53);
85935
86139
  use(install54);
85936
- use(install66);
85937
86140
  use(install55);
86141
+ use(install67);
85938
86142
  use(install56);
85939
86143
  use(install57);
85940
86144
  use(install58);
@@ -85945,16 +86149,17 @@ use(install62);
85945
86149
  use(install63);
85946
86150
  use(install64);
85947
86151
  use(install65);
85948
- use(install69);
85949
- use(install72);
86152
+ use(install66);
85950
86153
  use(install70);
85951
- use(install71);
85952
- use(install75);
85953
86154
  use(install73);
85954
- use(install74);
86155
+ use(install71);
86156
+ use(install72);
85955
86157
  use(install76);
86158
+ use(install74);
86159
+ use(install75);
85956
86160
  use(install77);
85957
86161
  use(install78);
86162
+ use(install79);
85958
86163
  use(installUniversalTransition);
85959
86164
  use(installLabelLayout);
85960
86165