From 85f91733a21c7b41829eb9280ce33e90783c926d Mon Sep 17 00:00:00 2001
From: srichman333 <sarah_n_richman@brown.edu>
Date: Mon, 7 Aug 2023 13:30:40 -0400
Subject: selected data at bottom of graph

---
 src/client/views/nodes/DataVizBox/components/LineChart.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/nodes/DataVizBox/components/LineChart.tsx b/src/client/views/nodes/DataVizBox/components/LineChart.tsx
index 77b3acf47..3a416c401 100644
--- a/src/client/views/nodes/DataVizBox/components/LineChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/LineChart.tsx
@@ -216,7 +216,6 @@ export class LineChart extends React.Component<LineChartProps> {
         // TODO: nda - get rid of svg element in the list?
         this._currSelected = x !== undefined && y !== undefined ? { x, y } : undefined;
         this.props.pairs.forEach(pair => pair[this.props.axes[0]] === x && pair[this.props.axes[1]] === y && (pair.selected = true));
-        this.props.pairs.forEach(pair => (pair.selected = pair[this.props.axes[0]] === x && pair[this.props.axes[1]] === y ? true : undefined));
     }
 
     drawDataPoints(data: DataPoint[], idx: number, xScale: d3.ScaleLinear<number, number, never>, yScale: d3.ScaleLinear<number, number, never>) {
@@ -369,8 +368,10 @@ export class LineChart extends React.Component<LineChartProps> {
                         fillWidth
                     />
                 </div>
-                <div className={'selected-data'}> {`Selected: ${selectedPt}`}</div>
                 <div ref={this._lineChartRef} />
+                {selectedPt!='none'? 
+                    <div className={'selected-data'}> {`Selected: ${selectedPt}`}</div>
+                : null}
             </div>
             ) : <span className="chart-container"> {'first use table view to select two axes to plot'}</span>
         );
-- 
cgit v1.2.3-70-g09d2

