Development of this codebase began in 2010 as part of the work of KCP Technologies' NSF-supported Data Games project. In a data game, the data generated by playing the game flows into CODAP for analysis and visualization. In a well-designed data game, the player cannot progress very far without using the data to inform and refine a strategy.
Starting in 2012 CODAP became the data analysis environment for Concord Consortium's NSF-supported InquirySpace project. Developed to promote scientific inquiry in high school science classes, students work with simulations or gather data with probes. The data flow into CODAP for analysis, facilitating hypothesis generation and iteration of experiments.
In April, 2014, CODAP received NSF funding as a project in its own right with the goal of developing a platform that can be used by developers of online curriculum materials that engage learners with data. Initial collaborations are: continuing work with InquirySpace and new work with OceanTracks at EDC and Terra Populus at the Minnesota Population Center. CODAP's success depends on the extent to which a community of developers embraces it as a way to bring dynamic, interactive data science tools to classroom (and other) learning. This work resulted in CODAP Version 2 which, by 2022 was being used by ~40K unique "28-day-active-users" in over 70 countries (stats from Google Analytics).
July 2022 saw the beginning of the development of CODAP Version 3, a complete reimplementation of CODAP using modern web development tools such as React, TypeScript, MobX State Tree and D3. The goal of version 3 is that while the underlying software is completely new, the application features and user interface are largely unchanged so that users' transition to version 3 is as seamless as possible.
What CODAP looks like will depend strongly on the context. But below is a screen shot of CODAP in use with an InquirySpace investigation. The Terminal Velocity component is a simulation that is streaming data to CODAP. Note the hierarchical structure of the data in which there are five runs, each containing a time series. Note also the linked selection in which the fourth run and its time series are selected.
![CODAP as it appears in InquirySpace]
CODAP software is provided here under an open-source MIT license. For details on this license, please see the LICENSE file included with this repository or The MIT License (MIT). CODAP was initially released under the Apache 2.0 license, and so you may see references to that license in the sources as well.
CODAP v3 is being developed alongside CODAP v2 in the same codap repository. During this period of active development on both versions, master continues to be the master/main branch for v2 development while main is the master/main branch for v3 development.
- Clone this repo and
cdinto itsv3directory - Checkout the
mainbranch - Run
npm installto install dependencies - Run
npm startto runwebpack-dev-serverin development mode with hot module replacement
Additional steps are required to run using HTTPS.
- install mkcert :
brew install mkcert(install using Scoop or Chocolatey on Windows) - Create and install the trusted CA in keychain if it doesn't already exist:
mkcert -install - Ensure you have a
.localhost-sslcertificate directory in your home directory (create if needed, typicallyC:\Users\UserNameon Windows) and cd into that directory - Make the cert files:
mkcert -cert-file localhost.pem -key-file localhost.key localhost 127.0.0.1 ::1 - Run
npm run start:secureto runwebpack-dev-serverin development mode with hot module replacement
Alternately, you can run secure without certificates in Chrome:
- Enter
chrome://flags/#allow-insecure-localhostin Chrome URL bar - Change flag from disabled to enabled
- Run
npm run start:secure:no-certsto runwebpack-dev-serverin development mode with hot module replacement
If you want to build a local version run npm run build, it will create the files in the dist folder.
You do not need to build to deploy the code, that is automatic. See more info in the Deployment section below.
To run just the TypeScript compiler for a quick type check without a full webpack build, run npm run build:tsc.
- Make sure if you are using Visual Studio Code that you use the workspace version of TypeScript.
To ensure that you are open a TypeScript file in VSC and then click on the
{}button next toTypeScript JSXin the status bar and selectUse Workspace Versionin the popup menu.
V3 pull requests should target the main branch and should apply the v3 label. V2 pull requests should target the master branch and apply the v2 label.
Production releases to S3 are based on the contents of the /dist folder and are built automatically by GitHub Actions for each branch pushed to GitHub and each merge into the main branch.
Production releases are deployed to the root at http://codap3.concord.org.
Other branches are deployed to https://codap3.concord.org/branch/{branch-name}/, e.g. https://codap3.concord.org/branch/main/ for the main branch. Note that the trailing slash is required. For arcane reasons leaving off the slash results in a redirect to an invalid url. ¯\(ツ)/¯
To deploy a new release:
The codap-v3-build skill can be invoked to initiate an interactive walkthrough of the process of building a release of CODAP v3. The process has 6 phases:
- Prepare the Release - Set up Jira version and gather context
- Prepare Release Notes - Interactive walkthrough to create CHANGELOG entry
- Update Version Files - Update package.json, versions.md, CHANGELOG.md
- Create Release PR - Build, capture asset sizes, create PR
- Tag and Release - After PR merge, create git tag and GitHub release
- Deploy - Stage, QA, deploy to production
The prior manual steps for building a release are listed below for posterity:
- Create a new release version in Jira using the
Manage Releasestab of the CODAPv3 Jira board. (The new version number is the number found in the top right corner of v3, incremented by one.) The status of the release can remainUnreleasedfor now. - Run
git log --reverse <last-version>...HEADand/or use the GitHub UI to see a list of PRs merged since the last release and identify their corresponding Jira stories. Tag the Jira stories based on this list as3.0.0-pre.<new-version>in theFix versionsfield. - Update the version number in
package.jsonandpackage-lock.json.npm version --no-git-tag-version 3.0.0-pre.<new-version>ornpm version --no-git-tag-version 3.0.0-beta.<new-version>
- Create a new entry in
versions.mdwith the new version and release date. - Create a new entry in
CHANGELOG.mdwith a description of the new version. - Create
v3-release-<version>branch and stageversions.md,package.jsonandpackage-lock.json. - Run
npm run release-notes 3.0.0-pre.<new-version>in thedev-templates/scriptsrepo. - Run
npm run build. - Copy asset size markdown table from previous release and change sizes to match new sizes in
dist. In the Terminal from thev3folder, the command isls -la dist/assets. - Stage
CHANGELOG.md, commit changes, push to GitHub, and create PR for the release. Addv3andrun regressionlabels so cypress tests are run. Merge PR once tests complete. - Checkout
mainand pull. - Make a new version tag using your local git client with the version number in the description (e.g.
git tag -a 3.0.0-pre.<new-version> -m "version 3.0.0-pre.<new-version>") and push the tag to the remote origin (e.g.,git push origin 3.0.0-pre.<new-version>). - Create a new GitHub release at https://github.com/concord-consortium/codap/releases corresponding to the new tag.
- Watch the GitHub actions build to see that the S3 Deploy step finished and then QA this version using the versioned URL (e.g.,
https://codap3.concord.org/version/3.0.0-pre.<new-version>/) or alternatively QA the staged release in the next step. - Stage the release by running the Release v3 Staging Workflow and entering the version tag you just pushed.
- Test the staged release at https://codap3.concord.org/index-staging.html.
- Update production by running the Release v3 Production Workflow and entering the release version tag.
- In the
Manage Releasestab of the CODAPv3 project in Jira, mark the new release asReleased. Clicking on the release shows a list of all stories tagged as fixed in this version.
Here is a link to the various versions of CODAP along with their release dates.
- run
npm run lintto lint the source files - run
npm run lint:fixto lint the source files and fix correctable issues - run
npm run testto run the jest tests - run
npm run test -- a-particular.testto run a particular test - run
npm run test:coverageto run the jest tests and print out coverage statistics for the tested files - run
npm run test:coverage -- a-particular.testto run a particular test and print out coverage statistics just for the specified tests - run
npm run test:watchto run the jest tests in watch mode, re-running when files change - run
npm startin one terminal andnpm run test:cypressto run the cypress tests locally against a headless browser - run
npm startin one terminal andnpm run test:cypress -- --spec cypress/e2e/a-particular.spec.tsto run a particular cypress test locally - run
npm startin one terminal andnpm run test:cypress:opento run the cypress tests against an actual browser with the ability to debug, etc.
Inside of your package.json file:
--browser browser-name: define browser for running tests--group group-name: assign a group name for tests running--spec: define the spec files to run--headed: show cypress test runner GUI while running test (will exit by default when done)--no-exit: keep cypress test runner GUI open when done running--record: decide whether or not tests will have video recordings--key: specify your secret record key--reporter: specify a mocha reporter
cypress run --browser chromewill run cypress in a chrome browsercypress run --headed --no-exitwill open cypress test runner when tests begin to run, and it will remain open when tests are finished running.cypress run --spec 'cypress/integration/examples/smoke-test.js'will point to a smoke-test file rather than running all of the test files for a project.
Various developer features can be enabled by adding a debug local storage key with one or more of the following flags separated by spaces. Local storage is specific to the domain that CODAP is running on. In Chrome local storage can be edited by opening the developer tools and going to the "Application" tab. Then find "Storage/Local storage" and the domain that CODAP is running on.
caseIdsdisplays the id of each case in the index column of the case tablecfmEventsconsole log all events received from the CFMcfmLocalStorageenable the CFM local storage provider so documents can be saved and loaded from the browser's local storagecfmNoAutoSavedisable CFM auto-save for any document loaded by the CFMdocumentthis will add the active document aswindow.currentDocument, you can usecurrentDocument.toJSON()to views the current documents content. You can also usecurrentDocument.treeManagerAPI.document.toJSON()to inspect the history of the document.eventModificationprint warnings with stack traces when code is modifying default browser event behavior. Seedebug-event-modification.tsfor the list of methods that are monitored.formulasprint info about recalculating formulashistorythis will: print some info to the console as the history system records changes, print the full history as JSON each time it is loaded from Firestore, and provide awindow.historyDocumentso you can inspect the document while navigating the history.loggerconsole log all messages sent to the logging servicemapprint info about interactions with the map componentpixiPointsthis adds a map of tileId keys to PixiPoint instances aswindow.pixiPointsMap. This is also always available in Cypress.pluginsenable some extra plugins in the plugin menu and print information about interactions with plugins.saveAsV2this will cause the app to save documents in V2 format.undothis will print information about each action that is added to the undo stack.
To debug React rendering problems, the why-did-you-render utility is available. To use it:
- uncomment the
import "../why-did-you-render.ts"line inindex.tsx - by default, all "pure" components are tracked
- this can be configured in the local
why-did-you-render.tsfile - individual components can be tracked by setting
MyComponent.whyDidYouRender = true
Remember not to commit any of these debug-only changes to the repository.
CODAP is Copyright 2025 (c) by the Concord Consortium and is distributed under the MIT license.
See license.md for the complete license text.