From 2001ddd7e2a8926ec97fdd4d5c73b2d4e5b293de Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 10 Jul 2020 22:39:27 +0200 Subject: highlight graph links when hovering --- frontend/views/graph/components/graph.editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'frontend/views/graph/components/graph.editor.js') 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} /> -- cgit v1.2.3-70-g09d2