Skip to content

Fixes #2

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 5 commits into from
Dec 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-digraph",
"description": "directed graph react component",
"version": "1.0.4",
"version": "1.0.5",
"author": "",
"keywords": [
"uber-library",
Expand Down
7 changes: 4 additions & 3 deletions src/components/graph-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/graph-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ class GraphView extends Component {
} else {
self.props.onCreateEdge(sourceNode, hoveredNode)
}
} else {
if (swapErrBack){
swapErrBack()
}
}
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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() {
Expand Down