Function useDiagram

Hook for creating a diagram. The result is a Diagram object that can be passed into Renderer. You should use this hook rather than calling your diagram factory directly due to (important) performance considerations.