Mouse events errors after last version
I'm using the library in an Angular project, and it started to throw errors at mouse move / click, after the recent changes. Specifically this from the screenshot below, caused by clientX_rel and clientX_rel inside function LGraphCanvas.prototype.adjustMouseEvent, which are not declared nor initialized (litegraph.js line 7483).

I was able to fix it by just adding these two lines at the beginning of the function:
var clientX_rel = 0;
var clientY_rel = 0;
We should avoid using undeclared variables, angular is right,i create a pull request in here
https://github.com/jagenjo/litegraph.js/pull/273
By the way : I think this library can separate core library and node library. others distribute their own node library, just like a plugin.
I want to use it like this :
import MyNodePlugin from "MyNodePlugin"
LiteGraph.use(MyNodePlugin)
#273
Thanks for the fix The change that caused the issue is my fault, in my browsers the console was not showing that up and I missed it.
By the way : I think this library can separate core library and node library. others distribute their own node library, just like a plugin.
I want to use it like this :
import MyNodePlugin from "MyNodePlugin" LiteGraph.use(MyNodePlugin)
@gausszhou The first part of this I already did in the fork called litegraph.core.js (https://github.com/mikeandtherest/litegraph.core.js). You might want to check it out.
I might also do at some point a separate library for a nodes / node plugin system, if the project I'm currently working on would require it.
Hi @mikeandtherest and @gausszhou!
Separating nodes and plugins it's a nice thing to do. They could be shared easily between different projects. Sharing nodes could be amazing.
@gausszhou, you are right, undeclared variables aren't meat to be as others issues, especially in productions. We should not auto update, and make better use of releases and versions.
@mikeandtherest, can I ask what are you working on? What differs in your only core version?
@atlasan The project is just a SaaS idea for a tool that would allow others to build web apps easier. So far there is no difference between litegraph.js and litegraph.core.js, except that in the core version I removed all the predefined nodes. I had to do that since the main library doesn't have a "barebone" version of the js file.
By the way : I think this library can separate core library and node library. others distribute their own node library, just like a plugin. I want to use it like this :
import MyNodePlugin from "MyNodePlugin" LiteGraph.use(MyNodePlugin)@gausszhou The first part of this I already did in the fork called litegraph.core.js (https://github.com/mikeandtherest/litegraph.core.js). You might want to check it out.
I might also do at some point a separate library for a nodes / node plugin system, if the project I'm currently working on would require it.
@mikeandtherest Yes, I found your code repository, which aroused my thoughts.
Maybe I will fork this, and then make the transformation of monorepo and esbuild.
But I don't know much about the history of litegraph.js, exapmle, some of the csharp code is not necessary for me.
I will spend some time to do these tasks in the near
@mikeandtherest there is now a litegraph-mini.js which only contains core and basic nodes (like events, and logic).
@jagenjo Awesome, thanks. For my use case however, having a zero-nodes version is still preferable.