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 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$: {
|
let prehoverdPubkey: string | null = null;
|
||||||
if (chartInstance && hoveredPubkey !== null) {
|
|
||||||
const index = data.findIndex((item) => item.pubkey === hoveredPubkey);
|
$: if (chartInstance) {
|
||||||
if (index !== -1) {
|
if (hoveredPubkey !== null) {
|
||||||
chartInstance.toggleDataPointSelection(index);
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="relative h-full w-full">
|
<div class="relative h-full w-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user