feat(renderer): add connection line
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user