If you think you have a nice feature to add to
science.js, then here are some tips on how to add it:
The library is built from several smaller js files contained in the
srcfolder. For example, the arrows are made by code found in the
These files get consolidated into one big file:
This is done using grunt. (Grunt will also tidy the src files and make a minified version of the science.js code.)
In short, _don’t put your changes in the science.js file, but rather in a src file in the src folder.
Your additions should come with a few examples too, that show how it is used. These don’t have to be (and shouldn’t be) full fledged sims, but instead, super simple demos that highlight the important aspects of the science object.
To maintain uniformity, please use the following conventions.
File and folder naming. As suggested by google, please use dashes, not underscores to separate words in a file or directory name. i.e.
Please use two spaces to indent when writing code for @examples in JSDoc. (Check for lurking tabs if the white space is coming out weird post JSDocing.) You’ll also need to include a single space between the “*” and your “//” for it to compile comments ok.