Giter Club home page Giter Club logo

Comments (4)

setzer22 avatar setzer22 commented on August 25, 2024 1

This library is mainly about creating and displaying node graphs using egui. Execution semantics is up to the user, so the meaning of a loop should not be defined by the library. However, I'm open to a solution that detects and breaks depdendency cycles for the example crate, since you're right that the current implementation gets into an infinite loop.

I didn't include this check to avoid over-complicating the example code, but maybe a simple solution using petgraph wouldn't add a lot of noise to it. I'm a bit busy currently, but I'd be happy to review and merge a PR for this πŸ˜„

from egui_node_graph.

setzer22 avatar setzer22 commented on August 25, 2024 1

This is because there are no applications that allow infinite loops (and even if there were, they could not be implemented in this library).

What I mean is that everything depends on execution semantics. In a graph loops are not infinite, they're just loops, it's up to you how to interpret them. For instance, I can easily imagine a system where the node ports are used for control flow (like in UE5 blueprints or Godot's VisualScripting), where cycles in the graph are used to represent loops in the visual script. Some users of this library want to do just that, and while it's not exactly supported just yet, it's definitely something that I'd like to support.

Still, I see your point. If you're thinking about data flow "dependency" graphs like most things Blender uses graphs for, then yes, loops are quite undesirable in that situation because they represent a dependency cycle (i.e. a dependency that can never be fulfilled).

I would at least like to have a function that turns the connection red

I think this would be helpful. It is fair to assume many applications are going to want an acyclic graph, but this needs to be implemented in a way users that don't need it can disable it πŸ‘

Still a bit busy to work on this actively, but I'd be happy to guide anyone who wants to take on this issue! πŸ˜„

from egui_node_graph.

kkngsm avatar kkngsm commented on August 25, 2024

Thank you for your response.

To add an addendum.
First, I would like the connection to turn red when an infinite loop occurs, like in Blender. It is easy to see where the loop is.
Secondly, if it should be handled on the application side, I would at least like to have a function that turns the connection red.

However, I think it would be easier to handle this on the library side.
This is because there are no applications that allow infinite loops (and even if there were, they could not be implemented in this library).
I don't think it's smart to implement the exact same implementation by all library users.

from egui_node_graph.

kkngsm avatar kkngsm commented on August 25, 2024

I see! I understand now. It seems my knowledge was shallow.
I would like to work on it, but my technical skills seem to be lacking😒.

from egui_node_graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.