unicef/carrotjuice2

Name: carrotjuice2

Owner: unicef

Description: Front end to resources repo. Defaults to Brazil but will eventually be virus and country agnostic.

Created: 2016-02-21 03:08:24.0

Updated: 2017-12-04 21:51:38.0

Pushed: 2017-12-04 21:54:59.0

Homepage: null

Size: 460

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

CarrotJuice

Dependencies
Setup
Running tests

Mocha frontend tests use Mocha (to organize test suites and such) within the browser, to test components as they modify the DOM. You can either run these by simply going to localhost:8080/test.html, or running make phantomjs-tests (which uses Docker, suitable for running tests automatically via the command line).

New code path notes (React)

The new code path uses React, and P.js-based models (simple object-oriented classes). The relationship between views and models is like,

model

The design principles here are:

Developer API
Dictionary
Routes

Called from function: fetch_matrix_then_draw

Fetches diagonal of the mobility matrix. i.e. the number of people who've made two calls from the same tower. We think this is a measure of population density. It's a dynamic estimate. It changes from day.

Currently fetches matrix for one single day

The max value of the Diagonal of matrix is used to normalize all diagonal values. These values are used in the opacity of polygon colors to represent population density.

Called from function: fetch_geojson_for_divisions

Fetches geojson for either admin 2 polygons or voranoi cells to be displayed on map.

TODO(mikefab): Change 'division' to 'geojson'

Notes

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.