fix dragging causing instance deselect (#2) (#20)

This commit is contained in:
Tao Bror Bojlén 2018-12-06 16:46:44 +00:00 committed by GitHub
parent 1fce69b842
commit 7182f14c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -46,13 +46,20 @@ class GraphImpl extends React.Component {
settings={SETTINGS}
style={STYLE}
onClickNode={(e) => this.props.selectAndLoadInstance(e.data.node.label)}
onClickStage={(e) => this.props.selectAndLoadInstance(null)}
onClickStage={this.onClickStage}
>
<Filter neighborsOf={this.props.currentInstanceName} />
<ForceAtlas2 iterationsPerRender={1} timeout={6000}/>
</Sigma>
)
}
onClickStage = (e) => {
// Deselect the instance (unless this was a drag event)
if (!e.data.captor.isDragging) {
this.props.selectAndLoadInstance(null);
}
}
}
const mapStateToProps = (state) => ({