feat(edges): allow different types

This commit is contained in:
moklick
2019-07-24 23:25:14 +02:00
parent 6312f6bd1e
commit 9d44f26c68
10 changed files with 109 additions and 40 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ export default NodeComponent => (props) => {
const { state, dispatch } = useContext(GraphContext);
const [offset, setOffset] = useState({ x: 0, y: 0 });
const { data, onNodeClick, __rg } = props;
const { data, onClick, __rg } = props;
const { position } = __rg;
const { id } = data;
const [ x, y, k ] = state.transform;
@@ -70,7 +70,7 @@ export default NodeComponent => (props) => {
}
dispatch(setSelectedNodesIds(id));
onNodeClick({ data, position });
onClick({ data, position });
}}
>
<NodeComponent {...props} />