Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Categories #1

Open
SergioRibera opened this issue Nov 30, 2023 · 5 comments
Open

Node Categories #1

SergioRibera opened this issue Nov 30, 2023 · 5 comments

Comments

@SergioRibera
Copy link

Well, this is a suggestion, the suggestion comes from the need to have a dynamic creator of Nodes (From a contextual menu), that is simple but to achieve it well, it would be good to be by categories, this idea is similar to the implementation that egui_node_graph has, but I would like to put it to debate here to see if you agree before making a PR.

NOTE: along with this feature or later, I would suggest that the colors of the nodes and unions are based on the category color.

image

@zakarumych
Copy link
Owner

Node creation in UI will be also handled by SnarlViewer.

As configured (on right click to empty place by default), viewer will be asked to present context menu. Viewer than can show any kind of UI and, if it wants, create a node.

@zakarumych
Copy link
Owner

With current version you SnarlViewer is given opportunity to show context menu when right-clicking on a node or background.
So one can implement a viewer that shows a menu with buttons to create new nodes.

@attackgoat
Copy link

When dragging a wire off of a node and releasing the mouse buttons a callback (similar to the context function) should exist so that I can display a list of applicable nodes. The current function has no context about the node I am working with and so all nodes must be displayed.

@SergioRibera
Copy link
Author

A function like this would be great, I add something that is related to my proposal of categories, when you drag a node input/output we know what data is and the category to which it corresponds so we could open a context menu with the list of nodes that belong to the same category with the possibility of adding it and connect it automatically

@zakarumych
Copy link
Owner

When dragging a wire off of a node and releasing the mouse buttons a callback (similar to the context function) should exist so that I can display a list of applicable nodes. The current function has no context about the node I am working with and so all nodes must be displayed.

Do you mean releasing new dragged wire at empty space?
Not sure this can be done with current egui version. The function to bring context menu is hardcoded to react on secondary mouse button click.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants