FlowFuse / node-red-dashboard

https://dashboard.flowfuse.com
Apache License 2.0
200 stars 48 forks source link

Informational question: gestures support #792

Open bartbutenaers opened 6 months ago

bartbutenaers commented 6 months ago

Hi folks,

In my old svg ui node I used the panzoom and hammer.js libraries to support pan/zoom/pinch gestures/... That is quite useful if you display a floorplan in your dashboard, and you want quickly navigate through it.

But I was wondering if that is still the way to go in my new svg node for D2. I see that there is e.g. a Vue UseGesture library. So I assume Vue does not support this out of the box, and that it would be better that I use such a library?

Or are there any plans that this will be standard D2 functionality, or perhaps already is?

Thanks for illuminating me! Bart

bartbutenaers commented 6 months ago

That Vue UseGesture library is not maintained anymore the last 3 years, so might not be my best choice for a new ui node ;-(

bartbutenaers commented 6 months ago

From this StackOverflow discussion I understand that VueJs supports all these mouse and touch events out of the box, but that you need to use Vue UseGesture for special things like dragging, swiping, ... So I assume I cannot do stuff like panning, zooming, ... with VueJs out of the box?

bartbutenaers commented 6 months ago

At the moment I think that the Vueuse is the best option at the moment.
Because their Github repo has quite some impressive statistics:

That same group offers a well maintained library @vueuse.gesture for all kind of interactivity.

From their getting started page I assume that this gestureplugin needs to be loaded by the Flowfuse dashboard (i.e. not by my own svg ui node?) in the main.mjs file. Can anybody confirm whether that is correct?

Would be nice to get some thoughts about this. And whether such a proposal (to load this plugin by the flowfuse dashboard) would be accepted or not? Not sure whether other ui nodes could benefit from this feature. Otherwise I need to look for another solution...

About the size of the gesture library. I see this in their dist folder:

image

Note that I have not tested any of this at the moment.

bartbutenaers commented 6 months ago

I assume that this gestureplugin needs to be loaded by the Flowfuse dashboard (i.e. not by my own svg ui node?)

I think I was talking nononse, because I have also my own main.js file where an app is created. So I assume I need to load my own plugin(s) ...

bartbutenaers commented 6 months ago

I have also my own main.js file where an app is created. So I assume I need to load my own plugin(s)

Talking nononse again, when looking at the default comment in my main.js file:

image

Will pause this feature, until somebody with Vue knowledge jumps in.

joepavitt commented 6 months ago

Not something I've had much experience with actually. @cstns anything like this crossed your desk before?

cstns commented 6 months ago

Haven't worked with gestures that much I'm afraid, but I'm familiar with the vueuse library and see no harm in using it.