mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-17 13:34:22 +01:00
Merge pull request #116 from bob2402/pie-slice
problem: merits chart slice remains active after mouseout
This commit is contained in:
@@ -127,14 +127,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
$: {
|
||||
if (chartInstance && hoveredPubkey !== null) {
|
||||
const index = data.findIndex((item) => item.pubkey === hoveredPubkey);
|
||||
let prehoverdPubkey: string | null = null;
|
||||
|
||||
$: if (chartInstance) {
|
||||
if (hoveredPubkey !== null) {
|
||||
selectSlice(hoveredPubkey);
|
||||
prehoverdPubkey = hoveredPubkey;
|
||||
} else {
|
||||
if (prehoverdPubkey) {
|
||||
selectSlice(prehoverdPubkey);
|
||||
prehoverdPubkey = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selectSlice(pubkey: string) {
|
||||
const index = data.findIndex((item) => item.pubkey === pubkey);
|
||||
if (index !== -1) {
|
||||
chartInstance.toggleDataPointSelection(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="relative h-full w-full">
|
||||
|
||||
Reference in New Issue
Block a user