DEV Community

Cover image for I made coronavirus spread timeline
David B.
David B.

Posted on

I made coronavirus spread timeline

coronavirus.davidb.dev

I am not sure where to share it, for the world to see, I personally think it's very useful since you can check current and past stats

Top comments (21)

Collapse
 
ovchinnikovdev profile image
Konstantin

CORS politics prevent map rendering(

Collapse
 
dbumbeishvili profile image
David B.

It renders on my computer perfectly, can you screenshot the error? I am not sure which resources aren't loading

Collapse
 
ovchinnikovdev profile image
Konstantin • Edited

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at geolocation-db.com/json/. (Reason: CORS request did not succeed).

In FF only) Works fine in Chrome, Opera

Thread Thread
 
dbumbeishvili profile image
David B.

Thank you for reporting it, it should be fixed now on FF as well

Thread Thread
 
ovchinnikovdev profile image
Konstantin

yeah, works great!

Thread Thread
 
dbumbeishvili profile image
David B.

That's great (Y)

Thread Thread
 
camillerkt profile image
Camille Rakotoarisoa

Hello, please how did you fix it ?

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

This is insane

Collapse
 
dbumbeishvili profile image
David B.

Thank you, SHARAD, do you have some improvement ideas?

I plan to make transitions more smooth and I also want to add trend lines

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him) • Edited

I think you should add that stat stuff to the map image parts as it will be better unlike the use of original map for showing the stats or opening a new page .... I'll also suggest using service worker and cache to fetch the data in the background as it will help in smoothening of the transitions because data will be already present.

Thread Thread
 
dbumbeishvili profile image
David B.

I think you should add that stat stuff to the map image parts as it will be better unlike the use of the original map for showing the stats or opening a new page

I am not sure what you are referring

I'll also suggest using service worker and cache to fetch the data in the background as it will help in smoothening of the transitions because data will be already present.

Once the transition is started, data is already presented, it's not heavy operation. I am not sure if you are familiar with observablehq runtime which I am using. I will need to tackle it to make the animation smoother

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

Well I should open it on PC for better understanding

Thread Thread
 
dbumbeishvili profile image
David B.

Basically it's Jupiter notebook for javascript. Dependent cells are executed automatically. So, every tick means new cell -> code snippet execution, so basically the whole map redraws. Instead, I want to retrieve map reference, add smooth redraw function and invoke it on each animation tick

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀

This is really great any chance to share the code ?

Collapse
 
dbumbeishvili profile image
David B.

Thank you @Giorgos

This is Github repo, Its content is mostly responsible for the styling.

Actual analysis happens in this JS Notebook. It consists of code blocks, which you can expand by clicking on the left side

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀

Thanks for sharing, your dataset seems to be the most accurate so far I know for Greece the new cases were actually announced no more than 2 hours ago and your data seem reflect those cases. Well done !!!

Thread Thread
 
dbumbeishvili profile image
David B.

Thank you, actually, credit here goes to worldometers.info/coronavirus/.
Live data in my website, comes from that source, through my proxy server

Collapse
 
codenamejason profile image
Jaxcoder

Super awesome job! What did you use for your visualizations?

Collapse
 
dbumbeishvili profile image
David B.

Thank you :)

I used d3.js for visualization (Main bundle and d3.contour) and I also used Observablehq runtime for efficient filtering

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Well, I live in Iran. This is scary for me. LOL

Collapse
 
dbumbeishvili profile image
David B.

Yes, I would be scared too, I personally have an impression that your country's authorities do not publish full data since death rate seems to be much higher compared to other countries and also a large number of high ranking officials were infected