Remove data links sorting from pie chart slices

Remove the sort() call that was reordering pie slices based on data links presence. Pie slices should maintain their original order regardless of data links.
This commit is contained in:
Abhijnya002
2026-01-05 12:37:34 -05:00
parent 65919fc0bf
commit eb3df4fa00
+1 -13
View File
@@ -115,19 +115,7 @@ export const PieChart = ({
>
{(pie) => (
<>
{pie.arcs
.sort((a, b) => {
const aHasLinks = a.data.hasLinks && a.data.getLinks;
const bHasLinks = b.data.hasLinks && b.data.getLinks;
if (aHasLinks && !bHasLinks) {
return -1;
}
if (!aHasLinks && bHasLinks) {
return 1;
}
return 0;
})
.map((arc) => {
{pie.arcs.map((arc) => {
const color = arc.data.display.color ?? FALLBACK_COLOR;
const highlightState = getHighlightState(highlightedTitle, arc);