Closed EAzari closed 4 years ago
Not sure if I understand you correctly, but LitElement itself does not provide any components. You can use LitElement to build pretty much any component you can imagine though. From the looks of it, litegraph.js renders to a HTMLCanvasElement. So, you could define a LitElement component which contains a canvas and litegraph.js.
@Christian24 for instance for drag & drop it seems that there are some native components ? like:
<div draggable="true"></div>
<div draggable=${true}></div>
<div draggable=${'true'}></div>
So, do we have such native ones for nodes too?
I checked litegraph.js before, so it's based on some old ideas, for instance, canvas grids are based on repetitive png tile. And as you mentioned it's based on HTMLCanvas, which just renders "one" DOM, but I'm looking for a solution that supports "explicit DOMs"
As far as I see, draggable
is only an attribute, not a component: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
I am sorry, but I do not understand what you mean here: Your example defines three separate div elements or nodes. litegraph.js only seems to render to canvas by design. LitElement renders the templates you define. There are no builtin components in LitElement. You can only use LitElement to implement your own components. How you define these is your design decision.
@Christian24 So, web components' goal is to build "ready-to-use" components, am I wrong? If no, why not have some components to build nodes/networks/graphs "templates or components" natively?
What is a template? A structure What is a component? Some properties/attributes together
why not have some components to build nodes/networks/graphs "templates or components" natively?
Such a library of components could be built using LitElement or lit-html, but providing these types of components is out of the scope of Lit itself.
Perhaps someone in the community knows of a project that might be helpful.
@sorvell OK, thank you, I close the issue Hope in the near future we build such a library
Does lit-element have web components to build a node editor similar to litegraph.js? especially widget nodes? and subgraphs?