Skip to content

Commit

Permalink
feat(edges): click handler
Browse files Browse the repository at this point in the history
  • Loading branch information
moklick committed Jul 24, 2019
1 parent d3929c1 commit 6312f6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/EdgeRenderer/Edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default (props) => {
<path
className="react-graph__edge"
d={`M ${sourceX},${sourceY}L ${targetX},${targetY}`}
onClick={e => console.log('on edge click')}
/>
);
};
5 changes: 5 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@
}

.react-graph__edges {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
z-index: 2;
}

.react-graph__edge {
fill: none;
stroke: #333;
stroke-width: 2;
pointer-events: all;
}

.react-graph__nodes {
Expand Down

0 comments on commit 6312f6b

Please sign in to comment.