feat(renderer): add connection line

This commit is contained in:
moklick
2019-07-31 11:32:56 +02:00
parent 915cba94a7
commit 2d5e2d9241
18 changed files with 336 additions and 175 deletions
+8 -4
View File
@@ -28,7 +28,8 @@ class ReactGraph extends PureComponent {
const {
style, onElementClick, children, onLoad,
onMove, onChange, elements, onElementsRemove,
onConnect, onNodeDragStop
onConnect, onNodeDragStop, connectionLineType,
connectionLineStyle
} = this.props;
const { nodes, edges } = elements
@@ -37,16 +38,17 @@ class ReactGraph extends PureComponent {
return (
<div style={style} className="react-graph">
<Provider nodes={nodes} edges={edges}>
<Provider nodes={nodes} edges={edges} onConnect={onConnect}>
<GraphView
onLoad={onLoad}
onMove={onMove}
onChange={onChange}
onElementClick={onElementClick}
onConnect={onConnect}
onNodeDragStop={onNodeDragStop}
nodeTypes={this.nodeTypes}
edgeTypes={this.edgeTypes}
connectionLineType={connectionLineType}
connectionLineStyle={connectionLineStyle}
/>
<GlobalKeyHandler
onElementsRemove={onElementsRemove}
@@ -74,7 +76,9 @@ ReactGraph.defaultProps = {
edgeTypes: {
default: BezierEdge,
straight: StraightEdge
}
},
connectionLineType: 'bezier',
connectionLineStyle: {}
};
export default ReactGraph;