Giter Club home page Giter Club logo

covid-19-hub-vizualization's People

Contributors

aaronger avatar bsweger avatar elray1 avatar matthewcornell avatar micokoch avatar nickreich avatar vrushti-mody avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

covid-19-hub-vizualization's Issues

reduce code duplication for plot layers related to point predictions and intervals

There is some duplicated code for calculating data for plot layers representing 50% and 95% intervals and point forecasts here. Let's reduce duplication by extracting the relevant code into two functions we can call -- one that calculates and returns layers representing point forecasts and one that calculates and returns a layer representing interval forecasts.

Misc cosmetic issues when viewing on small-ish laptop screen

Screenshot below from full-screen image on MacBook Pro 13 inch.

  • change "Target variable" to "Outcome"
  • layout of truth data both on same line doesn't seem to be working. Reduce size and keep on separate lines?
  • make font size of labels of drop-downs and and drop-down menu text smaller
  • spacing of disclaimer text is weird - only one word on third line. Can we make the horizontal space for the text larger? reduce font-size?

Last two of these I see as "nice-to-have" but first two I think need to be updated before publicizing.

image

Add disclaimer text to right of options menu and above plot

“Most forecasts have failed to reliably predict rapid changes in the trends of reported cases and hospitalizations. Due to this limitation, they should not be relied upon for decisions about the possibility or timing of rapid changes in trends.”

Artifacts in polygons

Should Truth data be a radio button perhaps?

Example (reproduce by unselecting truth data and using right/left cursor keys to navigate to the date):
image

remove points layer for hospitalization forecasts

Ensemble hospitalization forecasts with only 14 days ahead show points. The forecasts with 28 days show just a line. For consistency, I think the ensemble forecast should be just the line. If there is an adjustable threshold for how many "steps ahead" to show before not showing points, I think it should be set at 7.

shuffle colors per model rather than per (model index mod 10)

currently, every 10th model will be assigned the same color. A use case for the shuffle colors button will be a situation where two models are assigned the same color, and we want to disambiguate them. To support this, let's more directly associate a color with each model, and shuffle those assignments across all models when shuffling colors.

updates to shown hospitalization truth data as_of

Because the truth data ends on Saturday, there is a few day period where daily observations that were available to models are not shown. Could this be adjusted so that the last ground truth observation for each hospitalization "as of" date is from Monday?

update default loaded current data and forecasts based on current date

we have hard coded the initial data that are loaded in at

import current_truth from '~/static/data/truth/case_US_2021-09-04.json';
import forecasts from '~/static/data/forecasts/case_US_2021-09-04.json';

Instead, could we load it from whatever the latest available file is, maybe using something like the below?

import current_truth from '~/static/data/truth/case_US_' +
    available_as_ofs.case[available_as_ofs.case.length - 1] + '.json';
import forecasts from '~/static/data/forecasts/case_US_' +
    available_as_ofs.case[available_as_ofs.case.length - 1] + '.json';

Update behavior for select models button

  • currently initialized to "selected", though not all models are selected initially. Suggest changing so that initially it is not selected
  • if we select all models while viewing a particular outcome variable (e.g. deaths), only models with forecasts for that variable are selected. this results in unselected models when viewing other variables. Suggest either changing so that "select all" selects all models, regardless of whether or not they provided forecasts for the current target, or updating its status to unselected (without changing model selections) if the outcome variable is changed and this results in available models that are not selected.

streamline outcome variable naming, pass as json rather than calculating in javascript

There are two goals here:

  1. track text for plot labels in json rather than calculating it on the fly in javascript. This will make the code more transferrable to other projects, and simplify adding cumulative deaths to this project later.
  2. reduce the number of different ways we are referring to the same quantity

We currently refer to the names of the outcome variables in three different ways:

  1. the variable names in the drop down menu for "Target Variable". This comes from this json file, and is one of "Cases", "Deaths", or "Hospitalizations"
  2. the description used in the plot title. This is calculated in the javascript here, and is one of "weekly COVID-19 cases", "daily COVID-19 hospitalizations", or "weekly COVID-19 deaths"
  3. the description used for the vertical axis label in the plot. This is calculated in the javascript here, and is one of "Incident weekly cases", "Incident daily hospitalizations", "Incident weekly deaths"

Let's:

  • decide on a single naming scheme for use in the plot labels -- I prefer the second format, e.g. "Incident weekly cases"
  • Add the selected text as entries in the json file for target variables in a new field, e.g. "plot_text"
  • Use this text in both parts of the plot label

select all model checkbox logic update

Here is an unexpected behavior with the "select all" button.

  • I load the page. select and deselect a given model. then click select all. This selects all models EXCEPT the single model that I have deselected. It's as though my manual "deselection" has turned it off for good.

add link to viz GitHub repo

currently, the GitHub button at the top links to the main forecast hub repo, which is consistent with main header, so this should stay. But somewhere else on the page we should have a link to the "source code for visualization". Maybe small text, bottom left of page? small text bottom of legend column?

deploy staging to live site

  • add statcounter code #6
  • fix issue #36
  • push latest changes
  • get app up and running on subdomain viz.covid19forecasthub.org
  • change links in menu (in main bootstrap theme and in custom header in viz itself, and link on main page and other places)

add linter/clean up whitespace

there are currently some blank lines and inconsistencies in the use of spaces and tabs in the javascript. Let's add a linter to help standardize.

add process for incorporating late models

e.g. The JHUAPL-SLPHospEns model is submitted every week to the hub, but they often miss the 8am deadline on Tuesday morning for submissions of ensembles to be included in the visualization build. It appears that then those forecasts are not added in subsequent weeks. Is there a simple fix to ensure that forecasts like this, that are validly submitted after we update the viz, are included in future weeks?

remove plotted point from the end of the truth data line and so it doesn't show up in tooltip

Note that the point that we have added to manufacture the full polygon that originates from the last observed datapoint should not be present in the tooltip when hovering on that point, as it isn't part of the forecast. Ideal behavior would be:

  • there should be a line from the end of the truth data to the end of the prediction points, going through each point. This line already exists in the viz
  • There should only be actual points at the "point" prediction values, but there should not be a colored point at the "manufactured" point at the last truth value.
  • The tooltip should show the point estimates for all values of the truth data (it does this already), and for the forecasted points that are shown (it does this already), but not for the initial ghost point of the models (this would need to be changed).

image

refactor specification of nuxt-forecast-viz module options

We should add a function to the store/index.js file in this repository that returns the config parameters object for the nuxt module. After loading relevant json files currently at the top of the nuxt.config.js file (i.e., we need to move to loading of those json files over from nuxt.config.js to store/index.js), basically just returns what's currently specified for module options:

  async forecastViz_options(_) {
    return {
        target_variables: target_variables,
        init_target_var: 'death',
        locations: locations,
        init_location: 'US',
        intervals: ['0%', '50%', '95%'],
        init_interval: '95%',
        available_as_ofs: available_as_ofs,
        init_as_of_date: available_as_ofs.death[available_as_ofs.death.length - 1],
        current_date: available_as_ofs.death[available_as_ofs.death.length - 1],
        models: models,
        default_models: ['COVIDhub-ensemble'],
        all_models: false,
        disclaimer: 'Most forecasts have failed to reliably predict rapid changes in the trends of reported cases and hospitalizations. Due to this limitation, they should not be relied upon for decisions about the possibility or timing of rapid changes in trends.'
      }
  }

Then, remove those module option specifications from nuxt.config.js.

consider refactoring main functionality into a separate module and/or plugin

The goal is to extract the main functionality for the plot and UI selection into a separate place that can then be pulled into other projects, e.g. a flu viz or a Zoltar viz. I'm not totally sure, but I think the best way to achieve this is to create a module and/or plugin that contains the plot, options selector, and interactions with the data store. These could then be imported into the current project and other projects as needed. More information at these links:

refactor navigation menu

I think it might help us to generalize the functionality (e.g. support Zoltar or other vis efforts) if we:

  • extract the navigation menu into its own component
  • add it to the page by using a layout

reorder list of outcomes and set Deaths to default

Rather than having the outcome menu be
Cases
Deaths
Hospitalizations

Let's change the order to be
Deaths
Cases
Hospitalizations

With Deaths as the default choice that displays when the page first loads.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.