ui: resize infection map when window resizes

Fixes #150
This commit is contained in:
Mike Salvatore 2021-01-20 15:34:33 -05:00
parent b191eff2b3
commit 5d5091d914
2 changed files with 12 additions and 4 deletions

View File

@ -12,12 +12,14 @@ class GraphWrapper extends React.Component {
let newOptions = null;
if(this.props.options !== undefined){
newOptions = this.props.options;
newOptions.height = this.props.containerHeight.toString() + 'px';
newOptions.width = this.props.containerWidth.toString() + 'px';
}
return (<Graph graph={this.props.graph} options={newOptions} events={this.props.events}/>)
return (
<div class={'net-graph-wrapper'}>
<Graph graph={this.props.graph} options={newOptions} events={this.props.events}/>
</div>
)
}
}
let ReactiveGraph = Dimensions()(GraphWrapper);
let ReactiveGraph = GraphWrapper;
export {ReactiveGraph};

View File

@ -1,3 +1,9 @@
.map-window {
position: relative;
}
.net-graph-wrapper {
height: calc(100% - 130px);
width: 100%;
padding-bottom: 10px;
}