devuiGuideDemosAPIGitHub

From lil-gui

import { GUI } from '@haxiomic/devui/compat';   // lil-gui API: add(obj, k, min, max, step), addColor, addFolder, .name(), .onChange()…
// haxiomic-engine/dev/DevUI.ts can become:
export { DevUI } from '@haxiomic/devui/three/devui';

Changing the import is usually all it takes, or alias lil-gui to @haxiomic/devui/compat in your bundler. What runs unchanged: add with min, max and step or options, addColor (hex strings and numbers, { r, g, b }, rgbScale), addFolder, name, onChange and onFinishChange (on a controller or a folder), listen (devui polls what's on screen anyway), disable, show/hide, open/close, reset, destroy, children, parent, root, and save()/load() in lil-gui's format. What's different:

Moving to devui's own API

The compat layer runs lil-gui code as it is. Moving a panel to devui's own API is mostly mechanical, and TypeScript flags each call to change:

lil-guidevui
folder.add(o, 'k', min, max, step).name('Label')folder.add(o, 'k', { label: 'Label', min, max, step })
folder.add(o, 'k', { A: 1, B: 2 }), add(o, 'k', ['a', 'b'])folder.add(o, 'k', { options: { A: 1, B: 2 } })
folder.addColor(o, 'k')folder.add(o, 'k') (colours are inferred; a hex number needs color: true)
folder.add(o, 'k').listen().disable()folder.monitor(o, 'k')
.listen(), .updateDisplay()nothing: devui polls what's on screen
folder.add({ go() {} }, 'go').name('Go')folder.button('Go', () => …)
gui.addFolder('X').close()gui.folder('X', { collapsed: true })
controller.domElement.title = …the description hint

Two things behave differently:

demo/engine runs haxiomic-engine's PhysicallyBasedViewer unmodified, with its DevUI resolved to devui (run git submodule update --init first).