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.
- package/fesm2022/cats-charts.mjs +41 -34
- package/fesm2022/cats-charts.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/cats-charts.mjs
CHANGED
|
@@ -4140,12 +4140,15 @@ class SankeyChart {
|
|
|
4140
4140
|
: labelTypography?.underline
|
|
4141
4141
|
? 'underline'
|
|
4142
4142
|
: undefined,
|
|
4143
|
-
|
|
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
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
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
|
-
|
|
4581
|
-
|
|
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: '
|
|
4584
|
-
data:
|
|
4599
|
+
type: 'blur',
|
|
4600
|
+
data: { ...zrEvent, type: 'blur' },
|
|
4585
4601
|
});
|
|
4586
|
-
}
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
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
|
/**
|