Zoom to fit
I'm wondering if there's a way to auto zoom the diagram to the canvas size? Fitting all the nodes and links into the frame. Thanks.
Hi there!
I implemented zoom to fit, please see example:
https://github.com/JokerNN/react-diagrams/commit/5b235238cf8454bcd57be70b525a7b5a1e2513ae
I don't know if it's necessary to have as a part of library though because there's a some nuances. (For example what to count as a top left corner of diagram, (0, 0) or most top-left node?)
Also I faced issue #109 . So used key workaround
hey man, can you open up a PR 👍
@dylanvorster for sure! I just wanted to deal with listeners problem first
@JokerNN how would be the implementation considering the most top-left node? I think is better than considering (0,0)