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", 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 } } } diff --git a/src/components/graph-view.js b/src/components/graph-view.js index 502c7780..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() + } } } } @@ -509,6 +513,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); @@ -874,8 +880,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() {