Giter Club home page Giter Club logo

covidtrends's Introduction

What is this?

All Contributors

This is an interactive graph / animation that charts the trajectory of global COVID-19 cases.

The graph plots the number of new confirmed cases in the past week, versus the total number of confirmed cases.

When plotted in this way, exponential growth is displayed as a straight line.

Notice that most countries follow a similar straight line path, indicating that the growth rate is similar across countries. We're all in this together.

Tips: Press Space (or the play button) to Play/Pause. Press +/- keys (or the slider) to see daily changes. Hover over the graph for more info. Drag cursor to zoom into graph, double-click to zoom back out. Use dropdown menus to switch between Confirmed Cases ↔ Deaths, between regions, or between a logarithmic ↔ linear scale. And don't forget to wash your hands!

Credits

This interactive pulls data on COVID-19 provided by Johns Hopkins CSSE and NYTimes. Huge thanks to them for making this invaluable data source publicly available.

Created by Aatish Bhatia in collaboration with Henry Reich.

Created using Plotly.js and Vue.js

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Aatish Bhatia

💻 🚧

Mustafa "Moose" Paksoy

🚧

Henry Reich

🤔

Patrick Plenefisch

💻

Ed S

💻 🔧

exclipy

💻

S Aufrecht

📖

Nick Young

💻

Thea Lanherne

🐛

Arjo Chakravarty

💻

Lucy Xu

💬

Ben Darfler

💻

Waldir Pimenta

👀

Nikita Kniazev

🎨

Henry

🖋

Ralf Koller

💻 👀 ️️️️♿️

Joachim Neumann

🐛

Arkarup Banerjee

🤔

Ann Bybee-Finley

🤔

Connie Sun

🎨

Upasana Roy

🤔 🎨

archiewood

🤔

Reagan Chandramohan

🐛

CharsiBabu

💻

Ricardo Gonçalves

💻

Berkeley Churchill

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Special thanks to Ritwick Ghosh, Nicky Case, Shekhar Bhatia, and Igor Kholopov for their very helpful feedback & suggestions!

Participate and Contribute

If you would like to participate or contribute, please read our Contributor's Guide and Code of Conduct.

License

Code in this repository which is not otherwise licensed is licensed under the MIT License; see LICENSE.txt for complete text.

This repository pulls data from 2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository by Johns Hopkins CSSE and New York Times Coronavirus (Covid-19) Data in the United States. Please consult these repositories for terms of use on the data.

covidtrends's People

Contributors

aatishb avatar allcontributors[bot] avatar mrspiffyclean avatar mustpax avatar rpkoller avatar edg2s avatar exclipy avatar saufrecht avatar arjo129 avatar charsibabu avatar thisisthefoxe avatar kant avatar kojoley avatar

covidtrends's Issues

Hiding the reference line/label raises errors

It works, but I wouldn't want a hanging error in the finished build.

TypeError: "this.$refs.graph.querySelector(...).querySelector(...).querySelector(...) is null"
    calculateAngle http://localhost:8000/covidtrends-hide-doubling-time_v1/vue-definitions.js?7:85
    handler http://localhost:8000/covidtrends-hide-doubling-time_v1/vue-definitions.js?7:133
    VueJS 4

New URL format

As of now, the code only does the World, as I haven't yet done the work for the subregions and JHU doesn't supply the ISO codes for them.

There seems to be a (rare) issue in load, which is that the program thinks there are no countries to load, which I think is because of a race condition between what file processes first. Investigating async locks could solve this.

I need to understand and reorganize the rename logic, as the URL creation and its recognition by the engine is getting entangled a bit.

Facebook sharing and other stuff

Searching in google (https://www.google.com/search?q=facebook+link+truncating) lead me to some results suggesting lack of encoding as the reason. Here are the first results:

RFC 39... something something is the reference for URL parsing / encoding, using + isn't good, as that is usually encoded as a space, a comma should work, though I don't remember a lot of sites using it.
Need to know what sorts of addresses break Facebook, such that we can understand the root cause.

Aside scroll fix

steps to fix.

  1. encapsulate top of countries (i.e. search bar, buttons) in a div
  2. give position sticky and top to said div
  3. check for issues
  4. optional, give return to start labels to parameters and countries title

Notes on possible future optimization

Loading a new Region also makes a call to pullData, which means a call to external resources, which might make stuff slower to respond. Storing the CSV once and then using it might be better performance wise. I don't know if there is caching being used, but it would be easy to check using the Network Analyzer. The csvs' are I assume cached (as well as everything else).

Zoom with text only doesn't zoom graph text

Steps to reproduce (Firefox):

  1. Press Alt, then View, Zoom, Apply to text only.
  2. Zoom in/out

The Graph text remains unchanged, while everything else changes. The Graph also doesn't scale to the overall new position.
The Tooltips when hovering the graph however are changed, being huge.

Improvements

After some review, the only 'object' that doesn't trigger a recount/relist of all selected countries is the 'Select Region' selectbox. This is because whenever it changes, it reverts to the 'default' selection (i.e. notable countries/locations, the 10 with most cases).
With this being said, then the whole naming scheme I had in the start of the branch becomes mute, as both select and checkboxes trigger the relist.

The idea is then as follows:

  • Rename createURLFromSelect to createURLFromRegion, and have the region selectbox the only one calling this.
  • Everything else calls a... createURLFromChange (renaming the previous createURLFromCheckbox)
  • checkbox function parameter changed to change. The biggest issue here is communicating what exactly change is, because changing a region is also change of sorts... For the time being, I don't see a good name.

To-do list

Basic to-do list, in order to document remaining changes.

  • Change changeURL in order to detect whether defaults have been set
  • Deal with Select All / Deselect All buttons (first idea is having just a new URL parameter with select=all/none)
  • Investigate weird performance issue (seems slower now than just calling changeURL without arguments) with how I'm now calling changeURL

2020-05-07

  • Changing Region after selecting all doesn't update correctly the URL (the url still thinks everything is selected, even though it is not)
  • Making Vue.js recognize the new select parameter

Odd behavior with select button

Steps to reproduce:

  1. Select Canada
  2. Select Reported Deaths
  3. Press Select All
  4. Select Confirmed Cases

What should be the result:

  • URL bar should only say ?region=Canada, and the countries should be all of them (as there are only 9, so they autoselect)

What happens:

  • URL bar stays at ?region=Canada&select=all but the countries are just the 4 that have reported deaths.

Label button not changing URL

Not sure if this is intended or not, but pressing the Show Label button doesn't change the URL. Now, there wasn't anything before I started working on the code that suggested that it would do anything to the URL, and the Vue.js app initialization doesn't seem to have anything related to it.

I can see how it is good that Labels are always on at start, because that can reduce confusion and it would be harder to mislead someone. It is something to point out on the pull request.

Doubling time button not working properly

The URL bar only updates if I decheck and recheck the button for showing the line.
This is due to how the if clause is written on createURL.
I might need to check the app initialization, as the code seems similar.

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.