pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

empty space click

Open bogdankol opened this issue 3 years ago • 4 comments

Hi :) I got a suggestion about Svelvet. For now there is a possibility to click on a node to do some actions with it. But there is no functionality to press on empty space like in React Flow. For example: I want some popup node to appear near clicked node (I can simulate its appearing by putting popup-node far-far-away and changing the position of it when clicked), but I cannot put it away when I don't want to see it anymore - when I click empty space in Svelvet container. It would be helpful to add such feature.

bogdankol avatar Jul 25 '22 08:07 bogdankol

@bogdankol are you referring to the handlers functionality which connects one container to another?

sher85 avatar Oct 05 '22 00:10 sher85

@sher85 no, I mean that for now you got onClick event handler (click on a node), but there is no such handler on empty space (when you click neither on node or handlers or edges) Like when you click on empty space - you can do something

bogdankol avatar Oct 31 '22 11:10 bogdankol

We can expose a Custom Event on the Svelvet component via something like on:gridClick/on:emptyClick/on:mapClick that developers could pass any function to. Perhaps we would send the graph object as part of the event.

Let me know if that's what you're looking for.

briangregoryholmes avatar Apr 21 '23 14:04 briangregoryholmes

Hi, yes I think it would be great to have this callback. For instance I am reflecting on a context menu to add nodes, but maybe there is another way to do that?

asiffer avatar Jun 16 '23 15:06 asiffer