Skip to content

Commit 8e58223

Browse files
Merge pull request #190 from MetaCell/feature/VFB-220
#VFB-220 fix Term context resize
2 parents 609a239 + 6e06063 commit 8e58223

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • applications/virtual-fly-brain/frontend/src/components

applications/virtual-fly-brain/frontend/src/components/VFBGraph.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { cypherQuery } from './configuration/VFBGraph/graphConfiguration';
1414
import { stylingConfiguration } from './configuration/VFBGraph/graphConfiguration';
1515
import { getInstanceByID } from '../reducers/actions/instances';
1616
import { getGraphTypes } from '../reducers/actions/types/getGraphTypes'
17+
import ReactResizeDetector from 'react-resize-detector'
18+
1719
/**
1820
* If no configuration is given for queries in graphConfiguration.js, we use this configuration.
1921
*/
@@ -482,9 +484,10 @@ class VFBGraph extends Component {
482484
<p style={{ float : "right", width : "80%", paddingTop : "2vh" }}>No graph available for {this.getErrorLabel()}</p>
483485
</div>
484486
:
487+
<ReactResizeDetector handleWidth handleHeight onResize={this.resize} skipOnMount={true}>
485488
<div ref={this.containerRef}>
486489
<Box sx={{
487-
width: 600,
490+
width: '100%',
488491
height: 800,
489492
backgroundColor: 'primary.dark',
490493
'&:hover': {
@@ -663,6 +666,7 @@ class VFBGraph extends Component {
663666
}
664667
/></Box>
665668
</div>
669+
</ReactResizeDetector>
666670
)
667671
}
668672
}

0 commit comments

Comments
 (0)