make frontend more resilient to a broken graph
This commit is contained in:
parent
dfaf15fb51
commit
f4044a4cd7
|
@ -64,10 +64,13 @@ class GraphImpl extends React.Component {
|
|||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const sigma = this.sigmaComponent.current.sigma;
|
||||
const sigma = this.sigmaComponent && this.sigmaComponent.current.sigma;
|
||||
// Check if sigma exists s.t. nothing breaks if the graph didn't load (for whatever reason)
|
||||
if (sigma) {
|
||||
sigma.graph.nodes().map(this.colorNodes);
|
||||
sigma.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
onClickNode = (e) => {
|
||||
this.props.selectAndLoadInstance(e.data.node.label);
|
||||
|
|
Loading…
Reference in a new issue