Open hajicj opened 2 years ago
I remembered I already did this! Adapted some panzoom component that was no longer maintained.
https://github.com/hajicj/volpiano-editor/tree/main/src/app/image-view/zoomable-canvas
Also, the graph canvas should have a border.
Requires refactoring the ZommableCanvas component to work with SVG inputs.
This can be done by passing the SVG as XML data to the src
attribute of the HTMLImageElement
that then gets drawn using context
's drawImage()
method (see: https://infoheap.com/html5-canvas-draw-image-using-svg-string/).
However, it requires a new component that wraps loading a new SVG onto the canvas.
It should be possible to zoom the graph in and out.