A repository for all our simulations
Clone or download
Latest commit c76ae20 Sep 10, 2018
Permalink
Failed to load latest commit information.
arrow-test Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
battery-resistor-circuit update battery deps Sep 7, 2018
bending-light Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
beta-decay Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
capacitor-lab Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
charges-and-fields Fixes #444 Jun 16, 2016
circuit-construction-kit-dc-only Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
circuit-construction-kit Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
collision-lab Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
common Upgraded Masses and Springs to v3 Jun 17, 2016
discharge-lamps Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
electric-field-of-dreams Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
energy-forms-and-changes Delints and therefore fixes a dist-only error in Energy Forms and Cha… Jun 17, 2016
faraday Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
generator Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
geometric-optics Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
gravity-and-orbits Delinted Gravity and Orbits. Fixes #447 Jun 27, 2016
greenhouse-effect Upgraded Greenhouse Effect to v3 of Pixi Jun 16, 2016
grunt Created an npm-clean command to clean out all the node_modules folders Jun 13, 2016
hydrogen-atom Fixed a bug that caused the old styling to appear in the built versio… Jul 1, 2016
ladybug-motion This improves the controls for position/velocity/acceleration. See fb… Jun 17, 2016
lasers Fixed errors and delinted lasers Jun 16, 2016
magnet-and-compass Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
magnets-and-electromagnets Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
masses-and-springs Upgraded Masses and Springs to v3 Jun 17, 2016
maze-game Revert "Made the controls nicer in Maze Game by making them behave li… Jun 16, 2016
moving-man Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
my-solar-system Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
nuclear-fission Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
nuclear-physics Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
pendulum-lab Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
photoelectric-effect Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
projectile-motion Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
radio-waves Upgraded Radio Waves to v3 Jun 17, 2016
radioactive-dating-game Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
rutherford-scattering Fixed references to non-v3 code in Rutherford Scattering Jun 17, 2016
sound Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
states-of-matter Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
template Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
vector-addition Fixed a bug where the different component views would not really get … Jun 17, 2016
wave-interference Updated dev dependencies everywhere to use the latest version of grun… Jun 16, 2016
.gitignore The getUpdatedSimDirs function returns only the simulation directorie… Apr 14, 2016
Gruntfile.js Fixed the `deploy` task and some minor things Apr 15, 2016
LICENSE.txt Including the actual GNU license Aug 18, 2014
README.md Added demo link to readme Mar 23, 2015
index.html Added screenshots and added to the dist list. Jun 13, 2016
package.json The getUpdatedSimDirs function returns only the simulation directorie… Apr 14, 2016

README.md

OpenStax Simulations

This repository holds all simulations that will be embedded into OpenStax textbooks.

Demo here

Building and Deploying

Pre-Build Setup:

  • First install node dependencies by running npm install.
  • Install grunt-cli globally by running npm install -g grunt-cli to make things simpler.

Building:

  • To build all the simulations and place their dist folders into a single top-level dist folder for serving, run grunt dist from the repository root.

Deploying

  • To build and deploy all simulations to github-pages, run grunt deploy.

Development

Hosting

The simulations can be hosted for development with any web host, but two options are documented here:

  1. Using Node.js
  2. Using Nginx

Both methods will create a server whose web root is this repository root; therefore, to access a specific simulation in dev mode, simply point your browser to

http://localhost:PORT/simulations/SIM-NAME/src

where PORT and SIM-NAME are replaced by appropriate values. Example:

http://localhost:8080/simulations/wave-interference/src

Node.js Hosting

  1. Follow the Pre-Build Setup under Building and Deploying
  2. Run grunt dev from the repository root.
  3. Open up http://localhost:8080 in your browser to view a list of simulations.

Nginx Hosting

  1. Install nginx

  2. Set up a virtual host pointing to your moving-man/src directory. You can follow a tutorial like this one, but when you get to the part where you're defining a server config, do something like this (replacing path-to-simulations appropriately):

     server {
       listen 8080;
       server_name $hostname;
       root /path-to-simulations/simulations/;
       index index.html;
       try_files $uri $uri/ /index.html;
     }
    
  3. Run sudo nginx to start the server.

  4. Open up http://localhost:8080 in your browser to view a list of simulations.

License

This software is subject to the provisions of the GNU Affero General Public License Version 3.0 (AGPL). See license.txt for details. Copyright (c) 2013 Rice University.