Giter Club home page Giter Club logo

Comments (3)

setzer22 avatar setzer22 commented on July 23, 2024

I don't think there's any reason for the central panel, other than the code I extracted this from being structured that way. So it would make a lot of sense to let the user customize the container where the graph is drawn in.

I can give this a go, or let me know if you'd like to work on a PR! 👍

from egui_node_graph.

jorgeja avatar jorgeja commented on July 23, 2024

I would also really like this. I did a quick test by creating a egui::Window and passed in the UI parameter to draw_graph_editor. I had some trouble with the sizing of the window container. The right-click menu is available outside the Window, and the node widget is not possible to interact with, until I move the very small window on top of the Node widget. The positioning of the Node widget seems to be global and not relative to the window as well.

I don't really know that much about egui to figure this out at the moment..

fn update(&mut self, ctx: &egui::CtxRef, _frame: &epi::Frame) {
    egui::Window::new("Graph Editor").show(ctx, |ui|{
        let graph_response = self.state.draw_graph_editor(ctx, ui, AllMyNodeTemplates)
    }
}

bilde

from egui_node_graph.

rsaccon avatar rsaccon commented on July 23, 2024

In the meantime I also played with an example where I pass UI to draw_graph_editor and made the same observations as @jorgeja. I do not know how in egui normally this is handled, but peeking at the source of some other projects which use egui it looks to me like Ui.interact might be helpful to restrict and handle interactions.

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.