From de064a6b0acf7f3dff04c579afc2562d782472d2 Mon Sep 17 00:00:00 2001
From: srichman333 <sarah_n_richman@brown.edu>
Date: Wed, 2 Aug 2023 17:50:25 -0400
Subject: selected fix

---
 src/client/views/nodes/DataVizBox/components/PieChart.tsx | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

(limited to 'src/client/views/nodes/DataVizBox/components/PieChart.tsx')

diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
index d3d16aa4c..d01d4429f 100644
--- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
@@ -43,7 +43,7 @@ export class PieChart extends React.Component<PieChartProps> {
     private byCategory: boolean = true; // whether the data is organized by category or by specified number percentages/ratios
     @observable _currSelected: any | undefined = undefined;
     private curSliceSelected: any = undefined;
-    private selectedTry: any = undefined;
+    private selectedData: any = undefined;
     // TODO: nda - some sort of mapping that keeps track of the annotated points so we can easily remove when annotations list updates
 
     @computed get _piechartData() {
@@ -329,23 +329,16 @@ export class PieChart extends React.Component<PieChartProps> {
                         : 
                         this._currSelected===showSelected;
                     this._currSelected = sameAsCurrent? undefined: showSelected;
-                    this.selectedTry = sameAsCurrent? undefined: d;
+                    this.selectedData = sameAsCurrent? undefined: d;
                     return true;
                 }
                 return false;
             });
-            const elements = document.querySelectorAll('.slice');
-            for (let i = 0; i < elements.length; i++) {
-                elements[i].classList.remove('hover');
-            }
             if (sameAsCurrent!) this.curSliceSelected = undefined;
-            else {
-                selected.attr('class', 'slice hover') 
-                this.curSliceSelected = selected;
-            }
+            else  this.curSliceSelected = selected;
         });
 
-        var selected = this.selectedTry;
+        var selected = this.selectedData;
         var arcs = g.selectAll("arc")
             .data(pie(data))
             .enter()
-- 
cgit v1.2.3-70-g09d2

