[explorev2] Make chart container more responsive (#1724)

* Make chart container more responsive
 **Leave chart empty when theres error
 **Make all boolean fields auto-query chart when changed

* Replace forEach with some

* Added fields to autoQueryFields
This commit is contained in:
vera-liu
2016-12-01 11:59:44 -08:00
committed by GitHub
parent 1a16491971
commit 2d0ebeae1b
3 changed files with 54 additions and 26 deletions

View File

@@ -144,6 +144,32 @@ class ChartContainer extends React.Component {
return title;
}
renderChart() {
if (this.props.alert) {
return (
<Alert bsStyle="warning">
{this.props.alert}
<i
className="fa fa-close pull-right"
onClick={this.removeAlert.bind(this)}
style={{ cursor: 'pointer' }}
/>
</Alert>
);
}
if (this.props.isChartLoading) {
return (<img alt="loading" width="25" src="/static/assets/images/loading.gif" />);
}
return (
<div
id={this.props.containerId}
ref={(ref) => { this.chartContainerRef = ref; }}
className={this.props.viz_type}
style={{ 'overflow-x': 'scroll' }}
/>
);
}
render() {
return (
<div className="chart-container">
@@ -187,26 +213,7 @@ class ChartContainer extends React.Component {
</div>
}
>
{this.props.alert &&
<Alert bsStyle="warning">
{this.props.alert}
<i
className="fa fa-close pull-right"
onClick={this.removeAlert.bind(this)}
style={{ cursor: 'pointer' }}
/>
</Alert>
}
{this.props.isChartLoading ?
(<img alt="loading" width="25" src="/static/assets/images/loading.gif" />)
:
(<div
id={this.props.containerId}
ref={(ref) => { this.chartContainerRef = ref; }}
className={this.props.viz_type}
style={{ 'overflow-x': 'scroll' }}
/>)
}
{this.renderChart()}
</Panel>
</div>
);