From 18b3b9e5eab4a7902390033feb0a1c7e379cf7d6 Mon Sep 17 00:00:00 2001 From: srichman333 Date: Thu, 17 Aug 2023 10:41:34 -0400 Subject: text tells user to select more / different data bug fix + other console error fixes --- src/client/views/nodes/DataVizBox/DataVizBox.tsx | 4 ++-- src/client/views/nodes/DataVizBox/components/Histogram.tsx | 2 +- src/client/views/nodes/DataVizBox/components/LineChart.tsx | 2 +- src/client/views/nodes/DataVizBox/components/PieChart.tsx | 2 +- src/client/views/nodes/DataVizBox/components/TableBox.tsx | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index 0cc73f32f..220a082d1 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -1,4 +1,4 @@ -import { action, computed, ObservableMap, ObservableSet } from 'mobx'; +import { action, computed, ObservableMap } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import { Doc, Field, StrListCast } from '../../../../fields/Doc'; @@ -108,6 +108,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { componentDidMount() { this.props.setContentView?.(this); this.fetchData(); + if (!this.layoutDoc._dataVizView) this.layoutDoc._dataVizView = this.dataVizView; } fetchData() { @@ -118,7 +119,6 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { } render() { - if (!this.layoutDoc._dataVizView) this.layoutDoc._dataVizView = this.dataVizView; return !this.pairs?.length ? ( // displays how to get data into the DataVizBox if its empty
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index df6aac6bc..e078043c1 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -429,7 +429,7 @@ export class Histogram extends React.Component { this.componentDidMount(); - if (this._histogramData.length>0){ + if (this._histogramData.length>0 || (!this.incomingLinks || this.incomingLinks.length==0)){ return ( this.props.axes.length >= 1 ? (
diff --git a/src/client/views/nodes/DataVizBox/components/LineChart.tsx b/src/client/views/nodes/DataVizBox/components/LineChart.tsx index 8bace941f..468780185 100644 --- a/src/client/views/nodes/DataVizBox/components/LineChart.tsx +++ b/src/client/views/nodes/DataVizBox/components/LineChart.tsx @@ -358,7 +358,7 @@ export class LineChart extends React.Component { else if (this.props.axes.length>0) titleAccessor = 'lineChart-title-'+this.props.axes[0]; if (!this.props.layoutDoc[titleAccessor]) this.props.layoutDoc[titleAccessor] = this.defaultGraphTitle; const selectedPt = this._currSelected ? `{ ${this.props.axes[0]}: ${this._currSelected.x} ${this.props.axes[1]}: ${this._currSelected.y} }` : 'none'; - if (this._lineChartData.length>0){ + if (this._lineChartData.length>0 || (!this.incomingLinks || this.incomingLinks.length==0)){ return ( this.props.axes.length>=2 && /\d/.test(this.props.pairs[0][this.props.axes[0]]) && /\d/.test(this.props.pairs[0][this.props.axes[1]]) ? (
diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx index 0c54d0a4e..657d496aa 100644 --- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx +++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx @@ -337,7 +337,7 @@ export class PieChart extends React.Component { var sliceColors = StrListCast(this.props.layoutDoc.pieSliceColors).map(each => each.split('::')); sliceColors.map(each => {if (each[0]==curSelectedSliceName!) selectedSliceColor = each[1]}); - if (this._piechartData.length>0){ + if (this._piechartData.length>0 || (!this.incomingLinks || this.incomingLinks.length==0)){ return ( this.props.axes.length >= 1 ? (
diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index f56d34fa6..7b3e700ac 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -155,7 +155,7 @@ export class TableBox extends React.Component { })} style={{ background: StrListCast(this.props.layoutDoc.selected).includes(guid) ? 'lightgrey' : '', width: '110%' }}> {this.columns.map(col => { // each cell - var colSelected = this.props.axes[0]==col || this.props.axes[1]==col; + var colSelected = this.props.axes.length>1? (this.props.axes[0]==col || this.props.axes[1]==col) : this.props.axes.length>0? this.props.axes[0]==col : false; return ( {p[col]} -- cgit v1.2.3-70-g09d2 From 5e8a263c2d891370467f0faccf3330179cedd699 Mon Sep 17 00:00:00 2001 From: srichman333 Date: Thu, 17 Aug 2023 10:55:42 -0400 Subject: merge --- src/client/views/nodes/DataVizBox/components/Histogram.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index 954569910..b3bdccbbb 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -457,11 +457,10 @@ export class Histogram extends React.Component { this.componentDidMount(); - if (this._histogramData.length>0 || (!this.incomingLinks || this.incomingLinks.length==0)){ - return ( - this.props.axes.length >= 1 ? ( -
-
+ if (this._histogramData.length > 0 || (!this.incomingLinks || this.incomingLinks.length==0)) { + return this.props.axes.length >= 1 ? ( +
+
{
Selected rows of data from the incoming DataVizBox to display.
); } -} +} \ No newline at end of file -- cgit v1.2.3-70-g09d2