diff options
Diffstat (limited to 'src')
5 files changed, 6 insertions, 6 deletions
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<FieldViewProps>() { 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<FieldViewProps>() { } 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 <div className="start-message"> 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<HistogramProps> { this.componentDidMount(); - if (this._histogramData.length>0){ + if (this._histogramData.length>0 || (!this.incomingLinks || this.incomingLinks.length==0)){ return ( this.props.axes.length >= 1 ? ( <div className="chart-container" > 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<LineChartProps> { 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]]) ? ( <div className="chart-container" > 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<PieChartProps> { 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 ? ( <div className="chart-container"> 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<TableBoxProps> { })} 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 ( <td key={this.columns.indexOf(col)} style={{border: colSelected? '3px solid black' : '1px solid black', fontWeight: colSelected? 'bolder' : 'normal'}}> {p[col]} |