covid19_scenarios icon indicating copy to clipboard operation
covid19_scenarios copied to clipboard

Split app data per region and load on demand

Open ivan-aksamentov opened this issue 4 years ago • 0 comments

🙋 Feature Request

🔦 Context

Currently the data for all countries is being statically bundled and loaded on startup https://github.com/neherlab/covid19_scenarios/tree/master/src/assets/data

This is redundant as users most likely are interested in one region or maybe a handful. This also makes the app startup slow, as the JSON are loaded along with the rest of the JS bundle and are then validated.

😯 Describe the feature

We want to split the data into chunks per region.

Decisions tomake:

  • What loading mechanism to use, e.g. webpack's dynamic import (import(chunk) => Promise<> ), plain HTTP requests from a public S3 bucket (https://github.com/neherlab/covid19_scenarios/issues/744)
  • Whether to merge all 4 pieces (cases, population, severity and scenario) into one file for that particular region, similar to how Shareable schema works for scenario uploads and URL sharing, or to keep 4 pieces separate (the consideration is that currently in the UI the case counts and age distribution can be changed independently from scenario params)
  • How to not break schemas too much and to maximize backwards compatibility across different I/O types

💻 Examples

💁 Possible Solution

Related

  • https://github.com/neherlab/covid19_scenarios/issues/645
  • https://github.com/neherlab/covid19_scenarios/issues/744

ivan-aksamentov avatar Jun 15 '20 22:06 ivan-aksamentov