A lightweight graphical user interface for changing variables in JavaScript.
Get started with dat.GUI by reading the tutorial at http://workshop.chromeexperiments.com/examples/gui.
The easiest way to use dat.GUI in your code is by using the built source at build/dat.gui.min.js
. These built JavaScript files bundle all the necessary dependencies to run dat.GUI.
In your head
tag, include the following code:
<script type="text/javascript" src="https://github.com/sailingsumo/dat-gui/raw/master/dat.gui.min.js"></script>
Internally, dat.GUI uses require.js to handle dependency management. If you're making changes to the source and want to see the effects of your changes without building, use require js.
In your head
tag, include the following code:
<script data-main="path/to/main" src="https://github.com/sailingsumo/dat-gui/raw/master/path/to/requirejs/require.js"></script>
Then, in path/to/main.js
:
require([
'path/to/gui/module/GUI'
], function(GUI) {
// No namespace necessary
var gui = new GUI();
});
In the terminal, enter the following:
$ cd utils
$ node build_gui.js
This will create a namespaced, unminified build of dat.GUI at build/dat.gui.js
_To export minified source using Closure Compiler, open utils/build_gui.js
and set the minify
parameter to true
._
height
parameter from GUI constructor. Scrollbar automatically induced when window is too short.dat.GUI.autoPlace
parameter removed. Use new dat.GUI( { autoPlace: false } )
. See Custom Placement.gui.autoListen
and gui.listenAll()
removed. See Updating The Display Manually.dat.GUI.load
removed. See Saving Values.The following libraries / open-source projects were used in the development of dat.GUI: