Comments (2)
The NodeTemplate
in the example is a simple compile-time enum, but I was careful to never assume this when defining the traits. If there is something in the trait definitions that is forcing the templates to be compile-time only, this should be considered a bug.
The templates as they are right now can be completely dynamic. Maybe I should add a few notes about this in the example. Essentially, the contract is:
- You provide a list of templates to the library. Being immediate-mode, you can easily change this list of templates each frame as you see fit (this takes care of the use case of registering new node types).
- The template itself is just a data container with the necessary information required to create a node (that is, the parameters plus any user data you want to store).
1- I might want to implement the possibility for my user to select a bunch of nodes, group them, and create a "new template" that, to my application logic, is equivalent of all the grouped nodes.
This should be possible with the current template approach right now, as long as you have a way of representing the grouped objects as some sort of "compiled" thing (i.e. not a subgraph).
But perhaps more interestingly, I'm planning to add sub-graphs as a future feature to this library. With that, you'd be able to create a node containing a full node graph inside, and the UI would allow you to navigate inside the child graph. This is not possible right now, but I'm just mentioning it in case you'd also find this useful 👍
2- I might want to have plugins for my application, and the plugin would register new node types.
As I mentined above, this is entirely possible with the current version of the code. You just need to pass in a different list of templates each frame, as new node templates are registered.
When combined with our discussion in #6, I would say the best approach here is to tie the template mechanism to the optional "add node" menu. We should provide a way for users to sidestep this altogether if the mechanism is not useful to them, but not remove it entirely.
from egui_node_graph.
yeah i didn't understand it at first (how to dynamically add nodes) for example in cases where you would want Eg: lua defined nodes/functions
from egui_node_graph.
Related Issues (20)
- Add topological iterator to Graph class HOT 1
- Easy way to create pre-existing graph state? HOT 1
- Performance concerns HOT 1
- give example the ability to zoom in/out and scroll side to side HOT 1
- missing input on Connection Only and then Connection/Constant node
- Handling disconnection events on node deletion is a bit cumbersome
- Persistence HOT 1
- Suggestion: Read-only mode
- Please add minimalistic example using bevy_egui HOT 11
- Buttons drawn on (after) the graph doesn't working. HOT 4
- The example doesn't work with version 0.3.0 HOT 3
- Would be nice with an example using Bevy and bevy-egui together with this project HOT 1
- Right click output - create node and connect HOT 1
- Incorrect draw order HOT 1
- Hide close button of node widget HOT 3
- New crates.io release HOT 1
- Cant Compile to web HOT 1
- Remove Widget on input connection HOT 1
- Cannot use because Color32 is not in epaint::color::Color32 HOT 4
- Feature request - allow labeling of edges HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egui_node_graph.