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

Add properties/edit panel to demo? #30

Closed
gotwig opened this issue Apr 9, 2018 · 13 comments
Closed

Add properties/edit panel to demo? #30

gotwig opened this issue Apr 9, 2018 · 13 comments

Comments

@gotwig
Copy link

gotwig commented Apr 9, 2018

I would realy appreciate it if the demo would include a complete example on how to realize something like the panel in webglstudio or mui3d nodeeditor that appears when you select a node and you can change the values/properties of each node and more

Thank you for this awesome library (Y)!

@jagenjo
Copy link
Owner

jagenjo commented Apr 9, 2018

I guess you mean a sidebar with the properties of the selected node. I wanted to do that but because I want to keep the library lightweight I would do it in the litegraph-editor.js only. Every editor implements the inspectors in their way.

btw, good luck adding litegraph to babylon.js :D

@gotwig
Copy link
Author

gotwig commented Apr 9, 2018

thank you! :)
I would really appreciate it if you would add it to the demo :)

@thetooth
Copy link

Seconding this as a really useful feature. Something that doesn't even edit the node or just very simple debug output would be nice just to see some common ways of getting individual node data in and out of the graph in an adhoc way.

I am evaluating this as a tool for writing dialogue and behaviour trees for a simple game engine, only two missing features are the properties panel(since you can't really edit a wall of text in a widget :P) and dynamically adding outputs(for example in a dialogue choice node the choices are 1->N, so I'm going to play with the custom shapes node and make a +/- button to append outputs). Otherwise this is probably the best implementation I've seen so far!

@Iodine-
Copy link

Iodine- commented Apr 20, 2020

+1 to this - while I understand separating the editor layer form the graph layer; I think the node editing functionality should likely be in the graph. modifying the properties of a node is something that all flow editors need to do at some point if working with nodes beyond the most basic. I appreciate not wanting to be prescriptive as to how to visually present the interface, but a starting point would be helpful.

Afterall, it is one of the clear features I feel set litegraph ahead of something like rete.js, where everything is configured on the node itself! boiling down that functionality into something simple would help imo

@jagenjo
Copy link
Owner

jagenjo commented Apr 20, 2020

I added a panel to the LGraphEditor, you can open it if you double click:
https://tamats.com/projects/litegraph/demo/

I will try to improve it over time.

@clarkmcc
Copy link

clarkmcc commented Jan 2, 2024

@jagenjo I'm trying to get the sidebar working, right now it just shows up as unstyled content below the canvas (https://codepen.io/clarkmcc/pen/dyrYjay). I see that you've added the panel to the LGraphEditor, but per your comment here the editor is apparently only for demoing, and therefore is not a part of the NPM package.

Are there plans to include it in the NPM package, given that critical functionality like the properties editor are now included but only as part of the editor?

@jagenjo
Copy link
Owner

jagenjo commented Jan 3, 2024

It is included: https://github.com/jagenjo/litegraph.js/blob/master/src/litegraph.js#L12524
Are you included the right CSS?

@jagenjo jagenjo closed this as completed Jan 3, 2024
@clarkmcc
Copy link

clarkmcc commented Jan 3, 2024

I don't see the litegraph-editor.css in the NPM module, or on the CDN. I will manually copy to my repo for now.

@clarkmcc
Copy link

clarkmcc commented Jan 3, 2024

Okay, interesting so it looks like I don't need the litegraph-editor.css since the classes for the sidebar are part of the standard CSS file. I am using the latest CSS I believe and it does show the classes that are required by the properties panel. I even added the <style> block in the HTML page it the sidebar still wasn't working right. Do you see any issues with the codepen?

<link href="https://cdn.jsdelivr.net/npm/litegraph.js@0.7.14/css/litegraph.css" type="text/css" />

@atlasan
Copy link
Contributor

atlasan commented Jan 4, 2024

Hi @clarkmcc. I've seen your codepen, the canvas seems working. Do you want to add some controls around it?
You can check the html and js file of the editor included in this repository
https://github.com/jagenjo/litegraph.js/blob/master/editor/index.html
https://github.com/jagenjo/litegraph.js/blob/master/src/litegraph-editor.js
It's actually the js that builds up the editor.

@clarkmcc
Copy link

clarkmcc commented Jan 4, 2024

@atlasan as I mentioned, I'm trying to get the sidebar/properties editor working which (as I understand it) is supposed to be included as part of the core litegraph.js. You can see the properties editor is unstyled and shows below the canvas, even though I'm including the litegraph.css file which has what I believe are the appropriate CSS classes.

@jagenjo
Copy link
Owner

jagenjo commented Jan 4, 2024

@clarkmcc I realized the dialog is in the original litegraph.css, the problem is that the container that holds the canvas must have the litegraph class assigned and also the style position:absolute (I know I should fix it and make it automatic), otherwise it will appear out of place. Let me know if that works.

Check here: https://tamats.com/projects/litegraph/editor/

@clarkmcc
Copy link

clarkmcc commented Jan 4, 2024

@jagenjo thank you for the quick response! That solved it

<div class="litegraph litegraph-editor">
    <canvas id="canvas" width="720" height="580"></canvas>
</div>

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

6 participants