refactor(nodes,edges): data structure

This commit is contained in:
moklick
2019-07-25 16:33:19 +02:00
parent 064f7d9c75
commit 7de43f7843
14 changed files with 197 additions and 169 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import { Consumer } from '../GraphContext';
class NodeRenderer extends PureComponent {
renderNode(d, onElementClick) {
const nodeType = d.data.type || 'default';
const nodeType = d.type || 'default';
if (!this.props.nodeTypes[nodeType]) {
console.warn(`No node type found for type "${nodeType}". Using fallback type "default".`);
}
@@ -14,7 +14,7 @@ class NodeRenderer extends PureComponent {
return (
<NodeComponent
key={d.data.id}
key={d.id}
onClick={onElementClick}
{...d}
/>