cats-charts 0.0.97 → 0.0.98

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.
@@ -4560,49 +4560,53 @@ class SankeyChart {
4560
4560
  this.chartInstance.off();
4561
4561
  this.bindSankeyDragBounds();
4562
4562
  this.events.forEach((eventName) => {
4563
- this.chartInstance.on(eventName, (params) => {
4564
- const event = params?.event?.event;
4565
- if (eventName === 'contextmenu' && event) {
4566
- params.event.event.preventDefault();
4567
- const container = this.chartInstance.getDom();
4568
- const rect = container.getBoundingClientRect();
4569
- this.cardPosition = {
4570
- x: event.clientX - rect.left,
4571
- y: event.clientY - rect.top,
4572
- };
4573
- this.openCard = true;
4574
- this.cdr.markForCheck();
4563
+ if (eventName === 'contextmenu') {
4564
+ this.chartInstance.on(eventName, (params) => {
4565
+ const event = params?.event?.event;
4566
+ if (event) {
4567
+ params.event.event.preventDefault();
4568
+ const container = this.chartInstance.getDom();
4569
+ const rect = container.getBoundingClientRect();
4570
+ this.cardPosition = {
4571
+ x: event.clientX - rect.left,
4572
+ y: event.clientY - rect.top,
4573
+ };
4574
+ this.openCard = true;
4575
+ this.cdr.markForCheck();
4576
+ }
4575
4577
  this.chartEvent.emit({
4576
4578
  type: eventName,
4577
4579
  data: params,
4578
4580
  });
4579
- }
4580
- else if (eventName === 'click') {
4581
- this.chartInstance.on('click', (params) => {
4581
+ });
4582
+ }
4583
+ else if (eventName === 'click') {
4584
+ this.chartInstance.on('click', (params) => {
4585
+ this.chartEvent.emit({
4586
+ type: 'click',
4587
+ data: params,
4588
+ });
4589
+ });
4590
+ const zr = this.chartInstance.getZr();
4591
+ zr.on('click', (zrEvent) => {
4592
+ if (!zrEvent.target) {
4593
+ const nativeEvent = zrEvent.event;
4594
+ nativeEvent.preventDefault();
4582
4595
  this.chartEvent.emit({
4583
- type: 'click',
4584
- data: params,
4596
+ type: 'blur',
4597
+ data: { ...zrEvent, type: 'blur' },
4585
4598
  });
4586
- });
4587
- const zr = this.chartInstance.getZr();
4588
- zr.on('click', (zrEvent) => {
4589
- if (!zrEvent.target) {
4590
- const nativeEvent = zrEvent.event;
4591
- nativeEvent.preventDefault();
4592
- this.chartEvent.emit({
4593
- type: 'blur',
4594
- data: { ...zrEvent, type: 'blur' },
4595
- });
4596
- }
4597
- });
4598
- }
4599
- else {
4599
+ }
4600
+ });
4601
+ }
4602
+ else {
4603
+ this.chartInstance.on(eventName, (params) => {
4600
4604
  this.chartEvent.emit({
4601
4605
  type: eventName,
4602
4606
  data: params,
4603
4607
  });
4604
- }
4605
- });
4608
+ });
4609
+ }
4606
4610
  });
4607
4611
  }
4608
4612
  /**