diff options
| author | srichman333 <sarah_n_richman@brown.edu> | 2023-08-07 13:30:40 -0400 |
|---|---|---|
| committer | srichman333 <sarah_n_richman@brown.edu> | 2023-08-07 13:30:40 -0400 |
| commit | 85f91733a21c7b41829eb9280ce33e90783c926d (patch) | |
| tree | 867a51a683b04dc15c00b77aeb63ccd2ff5c4639 /src/client/views/nodes/DataVizBox/components | |
| parent | 1bfa61ae441458cdcd860eb39e617417d013f1fa (diff) | |
selected data at bottom of graph
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components')
5 files changed, 12 insertions, 8 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Chart.scss b/src/client/views/nodes/DataVizBox/components/Chart.scss index 996183cb8..35e5187b2 100644 --- a/src/client/views/nodes/DataVizBox/components/Chart.scss +++ b/src/client/views/nodes/DataVizBox/components/Chart.scss @@ -4,6 +4,7 @@ align-items: center; cursor: default; margin-top: 10px; + overflow-y: visible; .graph{ overflow: visible; @@ -22,8 +23,8 @@ display: flex; flex-direction: row; margin: 10px; - margin-top: 0px; - margin-bottom: -5px; + margin-top: -25px; + margin-bottom: 5px; } .slice { &.hover { @@ -78,4 +79,6 @@ .table-container{ overflow: scroll; margin: 10px; + margin-left: 25px; + margin-top: 25px; }
\ No newline at end of file diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index 2a47abf32..cb882cf4a 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -454,6 +454,7 @@ export class Histogram extends React.Component<HistogramProps> { size={Size.XSMALL} /> </div> + <div ref={this._histogramRef} /> {selected != 'none' ? <div className={'selected-data'}> Selected: {selected} @@ -477,7 +478,6 @@ export class Histogram extends React.Component<HistogramProps> { /> </div> : null} - <div ref={this._histogramRef} /> </div> ) : <span className="chart-container"> {'first use table view to select a column to graph'}</span> ); 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> ); diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx index cc5cc231b..ca93a2942 100644 --- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx +++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx @@ -410,6 +410,7 @@ export class PieChart extends React.Component<PieChartProps> { fillWidth /> </div> + <div ref={this._piechartRef} /> {selected != 'none' ? <div className={'selected-data'}> Selected: {selected} @@ -424,7 +425,6 @@ export class PieChart extends React.Component<PieChartProps> { /> </div> : null} - <div ref={this._piechartRef} /> </div> ) : <span className="chart-container"> {'first use table view to select a column to graph'}</span> ); diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index a7cc3f2fb..38dd62d8d 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -49,7 +49,7 @@ export class TableBox extends React.Component<TableBoxProps> { if (!this.props.layoutDoc.rowGuids) this.props.layoutDoc.rowGuids = new List<string>(); const guids = Cast(this.props.layoutDoc.rowGuids, listSpec("string"), null); if (guids.length==0) this.props.pairs.map(row => guids.push(Utils.GenerateGuid())); - return this._tableData.length ? Array.from(Object.keys(this._tableData[0])).filter(header => header!='') : []; + return this._tableData.length ? Array.from(Object.keys(this._tableData[0])).filter(header => header!='' && header!=undefined) : []; } filterSelectedRowsDown() { @@ -66,7 +66,7 @@ export class TableBox extends React.Component<TableBoxProps> { this.filterSelectedRowsDown(); if (this._tableData.length>0){ return ( - <div className="table-container" style={{height: this.props.height+this.props.margin.top+this.props.margin.bottom}}> + <div className="table-container" style={{height: this.props.height}}> <table className="table"> <thead> <tr className="table-row"> |
