Remove height prop from line graphs

pull/10616/head
Alex P 2017-02-21 16:27:40 -08:00
parent 8ad290dc85
commit 36177b204d
2 changed files with 8 additions and 28 deletions

View File

@ -10,9 +10,7 @@ const RefreshingLineGraph = AutoRefresh(LineGraph);
const RefreshingSingleStat = AutoRefresh(SingleStat);
const {
children,
arrayOf,
node,
number,
shape,
string,
@ -114,9 +112,12 @@ export const LayoutRenderer = React.createClass({
}
return (
<Wrapper key={cell.i}>
<RefreshingLineGraph queries={qs} autoRefresh={autoRefreshMs} showSingleStat={cell.type === "line-plus-single-stat"} />
</Wrapper>
<div key={cell.i}>
<h2 className="hosts-graph-heading">{cell.name}</h2>
<div className="hosts-graph graph-container ">
<RefreshingLineGraph queries={qs} autoRefresh={autoRefreshMs} showSingleStat={cell.type === "line-plus-single-stat"} />
</div>
</div>
);
});
},
@ -147,24 +148,4 @@ export const LayoutRenderer = React.createClass({
},
});
const Wrapper = React.createClass({
propTypes: {
children: node.isRequired,
},
render() {
const that = this;
const newChildren = React.Children.map(this.props.children, (child) => {
return React.cloneElement(child, {
height: that.props.style.height,
})
})
return (
<div {...this.props}>
{newChildren}
</div>
);
}
});
export default LayoutRenderer;
export default LayoutRenderer;

View File

@ -25,7 +25,6 @@ export default React.createClass({
y: arrayOf(number),
y2: arrayOf(number),
}),
height: string,
title: string,
isFetchingInitially: bool,
isRefreshing: bool,
@ -105,7 +104,7 @@ export default React.createClass({
<div className={classNames({"graph--hasYLabel": !!(options.ylabel || options.y2label)})}>
{isRefreshing ? this.renderSpinner() : null}
<Dygraph
containerStyle={{width: '95%', height: this.props.height && parseInt(this.props.height, 10) - 20 + 'px' || '100%'}}
containerStyle={{width: '100%', height: '100%'}}
overrideLineColors={overrideLineColors}
isGraphFilled={isGraphFilled}
timeSeries={timeSeries}