From 85ab7f610e873dfe629fa9fb5d8a041db8e78b08 Mon Sep 17 00:00:00 2001 From: John Faichney Date: Thu, 1 Dec 2016 14:05:27 -0800 Subject: [PATCH 1/5] swapped node/edge draw order --- src/components/graph-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/graph-view.js b/src/components/graph-view.js index 502c7780..e86faa22 100644 --- a/src/components/graph-view.js +++ b/src/components/graph-view.js @@ -874,8 +874,8 @@ class GraphView extends Component { const entities = d3.select(this.refs.entities) - this.renderEdges(entities, edges); this.renderNodes(entities, nodes); + this.renderEdges(entities, edges); } render() { From 6865e6083457b517174d28fc2731839d7ed0d256 Mon Sep 17 00:00:00 2001 From: John Faichney Date: Thu, 1 Dec 2016 14:20:11 -0800 Subject: [PATCH 2/5] fixed button styles --- src/components/graph-controls.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/graph-controls.js b/src/components/graph-controls.js index 5bd20917..46e437c5 100644 --- a/src/components/graph-controls.js +++ b/src/components/graph-controls.js @@ -61,9 +61,10 @@ function makeStyles(primary){ color: primary, border: `solid 1px lightgray`, outline: 'none', - padding: 9.5, - position: 'relative', - bottom: 2 + position: 'absolute', + width: 31, + height: 31, + top: -3 } } } From e89aa7f41f53ac045245f3f922d3a7f187ed5fd1 Mon Sep 17 00:00:00 2001 From: John Faichney Date: Thu, 1 Dec 2016 15:44:10 -0800 Subject: [PATCH 3/5] handling case where edge handle is clicked --- src/components/graph-view.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/graph-view.js b/src/components/graph-view.js index e86faa22..d13d9108 100644 --- a/src/components/graph-view.js +++ b/src/components/graph-view.js @@ -509,6 +509,8 @@ class GraphView extends Component { // assume the click occurred on the arrow arrowClicked(d){ + if(event.target.tagName != 'path') return false; // If the handle is clicked + const xycoords = d3.mouse(event.target); const target = this.props.getViewNode(d.target); const dist = getDistance({x: xycoords[0], y: xycoords[1]}, target); From 4c6ce00e4e84453b179a194ccc81ce30b60c61ee Mon Sep 17 00:00:00 2001 From: John Faichney Date: Thu, 1 Dec 2016 16:04:28 -0800 Subject: [PATCH 4/5] calling swapErrBack if not canCreateEdge or not canSwapEdge --- src/components/graph-view.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/graph-view.js b/src/components/graph-view.js index d13d9108..50ec6e86 100644 --- a/src/components/graph-view.js +++ b/src/components/graph-view.js @@ -345,6 +345,10 @@ class GraphView extends Component { } else { self.props.onCreateEdge(sourceNode, hoveredNode) } + } else { + if (swapErrBack){ + swapErrBack() + } } } } From 30235c7dc20521dc2230da1b7c12bb88098260b5 Mon Sep 17 00:00:00 2001 From: John Faichney Date: Thu, 1 Dec 2016 16:05:07 -0800 Subject: [PATCH 5/5] bumped version # --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce181649..0795d0f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-digraph", "description": "directed graph react component", - "version": "1.0.4", + "version": "1.0.5", "author": "", "keywords": [ "uber-library",