Skip to content
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff line change
Expand Up@@ -345,6 +345,10 @@ class GraphView extends Component {
} else {
self.props.onCreateEdge(sourceNode, hoveredNode)
}
} else {
if (swapErrBack){
swapErrBack()
}
}
}
}
Expand DownExpand 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 DownExpand 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