diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 6 | ||||
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/TableBox.tsx | 42 |
2 files changed, 26 insertions, 22 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index efe17297b..1077df844 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -267,10 +267,10 @@ export class Histogram extends React.Component<HistogramProps> { var histogram = d3.histogram() .value(function(d) {return d}) .domain([startingPoint!, endingPoint!]) - .thresholds(x.ticks(numBins-1)) + .thresholds(x.ticks(numBins)) var bins = histogram(data) var eachRectWidth = width/(bins.length) - var graphStartingPoint = bins[0].x1? bins[0].x1! - (bins[1].x1! - bins[1].x0!) : 0; + var graphStartingPoint = (bins[0].x1 && bins[1])? bins[0].x1! - (bins[1].x1! - bins[1].x0!) : 0; bins[0].x0 = graphStartingPoint; x = x.domain([graphStartingPoint, endingPoint]) .range([0, Number.isInteger(this.rangeVals.xMin!)? (width-eachRectWidth) : width ]) @@ -286,7 +286,7 @@ export class Histogram extends React.Component<HistogramProps> { index = j; } } - bins[index].push(data[i]) + if (bins[index]) bins[index].push(data[i]) } bins.pop(); eachRectWidth = width/(bins.length) diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index 5653adbce..f244502a4 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -120,25 +120,29 @@ export class TableBox extends React.Component<TableBoxProps> { </thead> <tbody> {this._tableData?.map((p, i) => { - return ( - <tr key={i} className="table-row" onClick={action(e => { - if (!this.props.layoutDoc.selected) this.props.layoutDoc.selected = new List<string>(); - const selected = Cast(this.props.layoutDoc.selected, listSpec("string"), null); - if (selected.includes(p.guid)) selected.splice(selected.indexOf(p.guid), 1); - else { - selected.push(p.guid)}; - })} style={ - { fontWeight: StrListCast(this.props.layoutDoc.selected).includes(p.guid) ? 'bold' : '' , width: '110%', - background: StrListCast(this.props.layoutDoc.selected).includes(p.guid) ? 'lightgrey' : '' }}> - {this.columns.map(col => ( - (this.props.layoutDoc.selected)? - <td key={this.columns.indexOf(col)} style={{border: '1px solid black'}}> - {p[col]} - </td> - : <td key={this.columns.indexOf(col)} style={{border: '1px solid black'}}> {p[col]} </td> - ))} - </tr> - ); + var containsData = false; + this.columns.map(col => {if (p[col]!='' && p[col]!=null && p[col]!=undefined) containsData = true}) + if (containsData){ + return ( + <tr key={i} className="table-row" onClick={action(e => { + if (!this.props.layoutDoc.selected) this.props.layoutDoc.selected = new List<string>(); + const selected = Cast(this.props.layoutDoc.selected, listSpec("string"), null); + if (selected.includes(p.guid)) selected.splice(selected.indexOf(p.guid), 1); + else { + selected.push(p.guid)}; + })} style={ + { fontWeight: StrListCast(this.props.layoutDoc.selected).includes(p.guid) ? 'bold' : '' , width: '110%', + background: StrListCast(this.props.layoutDoc.selected).includes(p.guid) ? 'lightgrey' : '' }}> + {this.columns.map(col => ( + (this.props.layoutDoc.selected)? + <td key={this.columns.indexOf(col)} style={{border: '1px solid black'}}> + {p[col]} + </td> + : <td key={this.columns.indexOf(col)} style={{border: '1px solid black'}}> {p[col]} </td> + ))} + </tr> + ); + } })} </tbody> </table> |