Here’s the info you will need to get started on authoring interactives.
The codebases are managed as Git repositories on Github. The codebase in which you will do most, if not all, of your work is the
lab-interactives-site. This is where all the interactive definitions and model definitions are stored. To do work here, you should fork the repo and follow the directions in the Readme file (shown on the landing page of the repo) to set up a local clone of your fork of the repository, and then create a branch for doing work on a particular interactive. Once you have work you want to share you can submit a pull request for that branch and we can take a look at it to make sure it is running properly and the format is compliant with how we format other interactive files (mainly how things are indented and where line breaks are used). You can look at many other examples at the lab-interactives-site to see what is expected.
The Lab framework is another repository. This contains the code for the molecular dynamics engine (as well as some other modeling engines) and has the code for rendering the view of the models and the surrounding interactives. If you wanted to create new modeling features, user interface widgets, or outputs, this is where those kinds of changes would be made, but this codebase is more complex than making new interactives using current features. There are a few parts of this repo that will be helpful to be familiar with even if you are not modifying it.
Generally you will look at other interactives for examples of how to do things you want to do in the one you are working on, but there are some formal definitions of the interactive and model JSON files. These will give you some sense of the parts that are possible to be present, and in some cases what they refer to. See:
Sometimes it is not clear what properties are allowable (or required) when authoring an interactive. This should be a comprehensive list. The comments in the code can also sometimes help you understand what the properties relate to.
The models have their own JSON definition. This file shows what properties are associated with the molecular dynamics models. Mostly you will not be hand coding these model JSON files. Instead you will likely create and modify them using the original Java-based version of our modeling tool—the Molecular Workbench. You should become familiar with how to make models in this tool. Please download it and take a look at the extensive user manual. You don’t need to become an expert, but you will use this tool to create the initial state of some models in the form of a .mml file. See below how we convert this to the model JSON format to use in the HTML5-based interactives you will make.
In the Interactive you will often have to write JavaScript that talks to the model via an API. The scripting API for the molecular dynamics model is here:
I recommend you join the lab-models google group. That is the best place to ask questions while working on interactives.
I would love to start by working on the
Intro to Modeling Activity However, this would require adding a new feature to the modeling engine, in which a property of “elasticity” is added to obstacles. I’m not sure how comfortable you would feel jumping into the Lab framework and modifying the molecular dynamics engine. It’s a big first step. Perhaps the best way to get started would be to create the interactive on
page 6 of this activity with a non-functioning elasticity slider that we could connect to the new elasticity property once that has been added to the engine. That way you can build a new interactive first and then we’ll see if it makes sense to dive into the modeling code.
Hope that is enough to get you started,
-Dan
P.S. The links to the Intro to Modeling Activity and page 6 above will download a .jnlp file. This may or may not get launched automatically by your browser. If on a Mac you may need to find the download, right-click on it, and approve opening it manually.