[vis] bug num improvements (#2523)

* fix js error, make should render viz more readable, add tooltips, style axis and add min/max to xaxis

* put getTextWidth in utils

* add document to eslint globals config
This commit is contained in:
Alanna Scott
2017-04-04 20:05:36 -07:00
committed by GitHub
parent d93b1fc686
commit c1d9918abe
5 changed files with 183 additions and 102 deletions

View File

@@ -56,19 +56,22 @@ class ChartContainer extends React.PureComponent {
}
componentDidUpdate(prevProps) {
if (
(
prevProps.queryResponse !== this.props.queryResponse ||
prevProps.height !== this.props.height ||
this.props.triggerRender
) && !this.props.queryResponse.error
&& this.props.chartStatus !== 'failed'
&& this.props.chartStatus !== 'stopped'
) {
if (this.shouldRenderViz(prevProps)) {
this.renderViz();
}
}
shouldRenderViz(prevProps) {
const hasHeightChanged = prevProps.height !== this.props.height;
const hasQueryChanged = prevProps.queryResponse !== this.props.queryResponse;
const hasErrors = this.props.queryResponse && this.props.queryResponse.error;
return (hasQueryChanged || hasHeightChanged || this.props.triggerRender)
&& !hasErrors
&& this.props.chartStatus !== 'failed'
&& this.props.chartStatus !== 'stopped';
}
getMockedSliceObject() {
const props = this.props;
const getHeight = () => {