cneben / QuickQanava

:link: C++17 network / graph visualization library - Qt6 / QML node editor.
http://cneben.github.io/QuickQanava/index.html
Other
1.18k stars 230 forks source link

:construction: Why not use a Flickable as a Navigable (in order to have a bounding box behavior for the canvas) #232

Closed emmenlau closed 2 months ago

emmenlau commented 3 months ago

There is something that I'm missing in QuickQanava: The Navigable canvas allows to zoom and pan in such a way that none of the graph nodes remain visible (empty space). For me, that is not such a good behavior. I would prefer if zooming and panning is only allowed in such a way that there is not too much empty space visible.

More concretely, that means:

I think that is the default behavior of a Flickable, if I'm not mistaken? Could the Navigable be replaced with Flickable to get a similar behavior, but with some of the extra nice zooming and panning behavior of Qt default?

cneben commented 2 months ago

Hi @emmenlau I actually tried to implement a "zoom on mouse wheel in/out" with Fickable with early Qt5 version and never succeed to get it working, hence the custom qan::Navigable implementation.

It would be especially nice for touch and scrollbar support. I won't have time in the next weeks to have a try, but can review a PR ! This feature would be extremely nice and is a P1 on my side...

cneben commented 2 months ago

@emmenlau Again, I did not succeed to make it works. I will borrow some concepts for Navigable, closing for #244.

For records: There is a working implementation of Flickable "zoom on point with mousewheel" in this branch GraphView.qml. Graph size management en centering is not working.