cats-charts 0.0.97 → 0.0.99

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.
@@ -4140,12 +4140,15 @@ class SankeyChart {
4140
4140
  : labelTypography?.underline
4141
4141
  ? 'underline'
4142
4142
  : undefined,
4143
- align: styling?.labels?.alignment === 'default' ? undefined : styling?.labels?.alignment,
4143
+ ...(styling?.labels?.alignment !== 'default' && {
4144
+ position: styling?.labels?.alignment,
4145
+ }),
4144
4146
  formatter: (params) => this.formatNodeLabel(String(params.name ?? ''), visibleNodeMeta.get(String(params.name ?? '')), totalValue),
4145
4147
  },
4146
4148
  },
4147
4149
  ],
4148
4150
  };
4151
+ console.log(this.chartOption);
4149
4152
  if (this.chartInstance) {
4150
4153
  this.chartInstance.setOption(this.chartOption, true);
4151
4154
  }
@@ -4560,49 +4563,53 @@ class SankeyChart {
4560
4563
  this.chartInstance.off();
4561
4564
  this.bindSankeyDragBounds();
4562
4565
  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();
4566
+ if (eventName === 'contextmenu') {
4567
+ this.chartInstance.on(eventName, (params) => {
4568
+ const event = params?.event?.event;
4569
+ if (event) {
4570
+ params.event.event.preventDefault();
4571
+ const container = this.chartInstance.getDom();
4572
+ const rect = container.getBoundingClientRect();
4573
+ this.cardPosition = {
4574
+ x: event.clientX - rect.left,
4575
+ y: event.clientY - rect.top,
4576
+ };
4577
+ this.openCard = true;
4578
+ this.cdr.markForCheck();
4579
+ }
4575
4580
  this.chartEvent.emit({
4576
4581
  type: eventName,
4577
4582
  data: params,
4578
4583
  });
4579
- }
4580
- else if (eventName === 'click') {
4581
- this.chartInstance.on('click', (params) => {
4584
+ });
4585
+ }
4586
+ else if (eventName === 'click') {
4587
+ this.chartInstance.on('click', (params) => {
4588
+ this.chartEvent.emit({
4589
+ type: 'click',
4590
+ data: params,
4591
+ });
4592
+ });
4593
+ const zr = this.chartInstance.getZr();
4594
+ zr.on('click', (zrEvent) => {
4595
+ if (!zrEvent.target) {
4596
+ const nativeEvent = zrEvent.event;
4597
+ nativeEvent.preventDefault();
4582
4598
  this.chartEvent.emit({
4583
- type: 'click',
4584
- data: params,
4599
+ type: 'blur',
4600
+ data: { ...zrEvent, type: 'blur' },
4585
4601
  });
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 {
4602
+ }
4603
+ });
4604
+ }
4605
+ else {
4606
+ this.chartInstance.on(eventName, (params) => {
4600
4607
  this.chartEvent.emit({
4601
4608
  type: eventName,
4602
4609
  data: params,
4603
4610
  });
4604
- }
4605
- });
4611
+ });
4612
+ }
4606
4613
  });
4607
4614
  }
4608
4615
  /**