Lightweight controller library for JavaScript.
Go to file
mike 581e482823 formatted source
I’ve run the source files through js-beautify because my editor (Atom)
kept barfing on things like not having newlines at the ends of files.
2016-06-25 14:25:23 -04:00
build Fix: numbers were uneditable when using listen() 2016-06-24 08:29:00 -04:00
src/dat formatted source 2016-06-25 14:25:23 -04:00
tests increased the controllers in the test to account for a monitor turned sideways 2013-12-18 18:10:13 -08:00
utils prep for using js-beautify 2016-06-25 14:24:30 -04:00
.gitignore merging github and google code 2013-12-18 14:24:50 -08:00
.jsbeautifyrc prep for using js-beautify 2016-06-25 14:24:30 -04:00
.jsbeautifyrc-css prep for using js-beautify 2016-06-25 14:24:30 -04:00
.jsbeautifyrc-html prep for using js-beautify 2016-06-25 14:24:30 -04:00
bower.json fix not using a relativ path in bower.json 2015-03-26 12:53:43 +01:00
example.html formatted source 2016-06-25 14:25:23 -04:00
LICENSE Add Apache 2.0 License 2014-12-01 11:01:01 -08:00
README.md cleaning a few things up 2013-12-18 15:51:21 -08:00

#dat.GUI 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.


##Packaged Builds 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="dat.gui.min.js"></script>

##Using dat.GUI with require.js 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="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();

});

##Directory Contents

  • build: Concatenated source code.
  • src: Modular code in require.js format. Also includes css, scss, and html, some of which is included during build.
  • tests: QUnit test suite.
  • utils: node.js utility scripts for compiling source.

##Building your own dat.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.


##Change log

###0.5

  • Moved to requirejs for dependency management.
  • Changed global namespace from DAT to dat (lowercase).
  • Added support for color controllers. See Color Controllers.
  • Added support for folders. See Folders.
  • Added support for saving named presets. See Presets.
  • Removed 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.
  • Made Controller code completely agnostic of GUI. Controllers can easily be created independent of a GUI panel.

#0.4

  • Migrated from GitHub to Google Code.

##Thanks The following libraries / open-source projects were used in the development of dat.GUI: