Create custom sigma-aware components
masterThe Sigma container mounts any child component with the sigma instance available under props.sigma. You can use this to write components that interact directly with the graph instance.
class MyCustomSigma extends React.Component {
constructor(props) {
super(props)
// Access the sigma instance via props.sigma
props.sigma.graph.addNode({id:"n3", label:props.label})
}
render() { return null; }
}
// Usage:
<Sigma>
<MyCustomSigma label="Label" />
</Sigma>