Zoom in node editor
Is there any way to zoom in the node editor?
To my knowledge, no, because zooming hasn't been implemented in ImNodes yet - see Nelarius/imnodes#134, Nelarius/imnodes#192.
Can this help or did I misunderstand, https://github.com/Nelarius/imnodes/pull/134
That's exactly one of the pull requests I mentioned in my previous comment. Neither of these pull requests have been merged in ImNodes, and therefore is not included into the release. Since DearPyGui relies on stable releases of third party libraries, the version of ImNodes that DPG uses does not support zooming.
Understandably
I was hoping the changes would come in upstream, but even if the above PR get merged, there are still a few blockers—for example, DearPyGui relies on a fixed ImGui version rather than the latest, which makes the patch in https://github.com/Nelarius/imnodes/pull/192 incompatible with the current DearPyImGui.
So I’ve been working on a fix, directly in the DearPyGui repository (based on the above PR, it modifies also imnodes but in a manner that is aligned with the version of ImGui) and it’s working on my end. It uses the mouse wheel.
https://github.com/user-attachments/assets/025fb5f9-557e-452d-87f7-a52bde11ffa4
@v-ein: Do you think it’s worth opening a PR? It's not so clean, as it modifies more the dependencies rather than the library itself, but I've seen a lot of requests (mines included) for this fix. I don't know if / how that can fit in your roadmap / repo philosophy.
While I welcome any and all improvements to the library, I don't think modifying dependencies is a good idea. For this particular change, it's best to implement it in ImNodes, rather than "hack it" on DPG level (sorry for a bit harsh wording).
We can update DPG to newer ImGui and then see if the PR in ImNodes comes along as well. This takes quite a lot of time and effort, but IMHO it's the right way to do it. Unfortunately I myself will be pretty busy for several weeks at least, but in fact I've started looking into upgrading DPG to the newest ImGui. No ETA on this, I have to put it aside for a while.
No problem, I agree it's not clean. I went to do it there as I don't see any updates anytime soon upstream, but 100% agree it's a bag of wasps for the future.
I published my code in a forked repo so that anyone who wants to have the feature without waiting for the "official" fix can have it, without polluting the original codebase. Here it is, on "main". https://github.com/Maltergate/DearPyGui
The package is available on PyPI: https://pypi.org/project/dearpygui-nodezoomfork/
I was hoping the changes would come in upstream, but even if the above PR get merged, there are still a few blockers—for example, DearPyGui relies on a fixed ImGui version rather than the latest, which makes the patch in https://github.com/Nelarius/imnodes/pull/192 incompatible with the current DearPyImGui.
So I’ve been working on a fix, directly in the DearPyGui repository (based on the above PR, it modifies also imnodes but in a manner that is aligned with the version of ImGui) and it’s working on my end. It uses the mouse wheel.
https://github.com/user-attachments/assets/025fb5f9-557e-452d-87f7-a52bde11ffa4
@v-ein: Do you think it’s worth opening a PR? It's not so clean, as it modifies more the dependencies rather than the library itself, but I've seen a lot of requests (mines included) for this fix. I don't know if / how that can fit in your roadmap / repo philosophy.
That's amazing and currently necessary!