summaryrefslogtreecommitdiff
path: root/frontend/views/graph/components/graph.editor.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-10 22:39:27 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-10 22:39:27 +0200
commit2001ddd7e2a8926ec97fdd4d5c73b2d4e5b293de (patch)
treebe929f7cceaff183c7233f99b28bc93fcab53677 /frontend/views/graph/components/graph.editor.js
parentcc465329a2261b7db11c12665cab62affb266592 (diff)
highlight graph links when hovering
Diffstat (limited to 'frontend/views/graph/components/graph.editor.js')
-rw-r--r--frontend/views/graph/components/graph.editor.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend/views/graph/components/graph.editor.js b/frontend/views/graph/components/graph.editor.js
index a5c7c45..f0a5753 100644
--- a/frontend/views/graph/components/graph.editor.js
+++ b/frontend/views/graph/components/graph.editor.js
@@ -23,6 +23,7 @@ const defaultState = {
w: 0, h: 0,
},
page: null,
+ highlightedPageId: null,
measurements: {},
}
@@ -161,13 +162,15 @@ class GraphEditor extends Component {
}
handleMouseEnter(e, page) {
+ this.setState({ highlightedPageId: page.id })
}
handleMouseLeave(e, page) {
+ this.setState({ highlightedPageId: null })
}
render(){
// console.log(this.props.graph.show.res)
- const { page: currentPage, box, measurements } = this.state
+ const { page: currentPage, box, measurements, highlightedPageId } = this.state
const { res: graph } = this.props.graph.show
// console.log(res.pages)
return (
@@ -176,6 +179,7 @@ class GraphEditor extends Component {
bounds={this.state.bounds}
pages={graph.pages}
currentPage={currentPage}
+ highlightedPageId={highlightedPageId}
measurements={measurements}
box={box}
/>