The source code for this project is at: http://github.com/decc/twenty-fifty
See the README.
The code is written in:
- Ruby, using the 'bundler' gem to sort out dependencies and the 'sinatra' framework for the server
- Javascript, html and css for the user interface
The server is setup in config.ru. This:
- Maps /assets to a set of code that will compile the javascripts in src/javascripts and the stylesheets in src/stylesheets. It is only used in 'development' mode.
- Loads src/server.rb
All of the underlying model calculations are in the model folder
The javascripts in src/javascripts contain almost all of the important code.
The calculating engine of this tool is contained in the model folder. See the README there for how to update the code if the Excel model is updated.
Most of the meaningful code is in the src/javascripts folder. Most of it is written in coffescript, a variant of javascript.
- src/javascripts/application.js - loads all the javascript code
- src/javascripts/controller.js - contains the code that loads the model data and ensures the correct view is displayed.
- src/javascripts/views/ - contains the code that displays the different views, with one file per view
Each view in a class with the same rough format:
- setup() - is called when the webpage is ready for the chart to be drawn
- teardown() - is called when the user has selected a different view. It should remove all html that has been added in setup.
- updateResults(pathway) - is called when the data for a pathway has been received. It should update the results on the web page.
The example pathways are taken from the excel spreadsheet. If they aren't appearing correctly, check model/data_from_model.rb is pointint to the right bit.
The one page notes are separate pdf files in:
public/assets/onepage
If the order of the controls is changed, or a new control is added, then the mapping in the model/data_from_model.rb also needs to be chaned.
Please report bugs using the tool at: http://github.com/tamc/twenty-fifty/issues
Please fork the project and then push changes using the methodology described here: http://help.github.com/forking/