Extending lil-gui

This is really a lil-gui question more than a Three.js question. Apologies if asking in the wrong place, but where would be the right place?

I am upgrading my Three.js version and getting lil-gui along with it instead of dat.gui. Previously, when using dat.gui, I needed to set a variable whenever a gui folder was opened and unset that variable when the folder was closed. I accomplished that by using Common.extend to override the open() and close() methods in dat.gui.module.js.

But there is no Common in lil-gui, so is there a way to override open() and close()? Doing so may be complicated by Three.js including only lil-gui.module.min.js instead of the complete module.js.

Any advice? And if it’s not obvious already, I know barely enough javascript to be dangerous. Thanks.

you can still get dat gui separately from here

Ahhh, yes I could. Or I could just continue using the dat.gui I’ve been using with r131. But I assume the switch to lil-gui was made for some reason, though it’s not really obvious what those advantages might be.

Could anyone explain? Thanks.

The dat.gui project has not been maintained for a long time, and probably won’t be again. three.js switched to lil.gui to have something that is actually maintained; lil.gui’s mobile support is also better. But you should make your own decision for your project — there’s no reason you have to use the same GUI library as three.js. There are plenty of others, like tweakpane or leva (for React). We do not maintain any of these libraries and aren’t trying to convince anyone which to use.

1 Like