Skip to content

Commit 3d4f744

Browse files
committed
Nov. Updates
1 parent d426f3e commit 3d4f744

File tree

27 files changed

+138697
-127371
lines changed

27 files changed

+138697
-127371
lines changed

_updates/2020-10-29.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: More Derivative Charts
3+
date: 2020-10-30
4+
visualization: 1
5+
img: 2020-10-30.png
6+
img_url: /pages/covid-visualization/?chart=countries&highlight=United%20States&show=25&y=both&scale=linear&data=cases-daily-7-dx-7&data-source=jhu&xaxis=right&extra=European%20Union#countries
7+
---
8+
9+
I received a number of questions (and a lot of interest) on the derivative charts that were recently added -- the charts helped show the overall trends, but the day-of-week swings in the underlying data made the chart less useful beyond that. To help provide more context around the derivative charts, I've added derivative charts of the "One-Week Rolling Averages" to answer the question: *What is the daily change in the 1-week rolling average?* Additionally, this new derivative can also be viewed, itself, as a one-week average.
10+
11+
- Add four more derivative charts, all of the one-week rolling average values
12+
- Fixed a typo in the mouseover tooltip on the derivative charts.
13+

_updates/2020-10-30.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Illinois Chart Improvements
3+
date: 2020-10-29
4+
visualization: 5
5+
---
6+
7+
- Added the 11 Illinois Regions as meta-selection options under "Show" to show all counties in a region.
8+
- Fixed a bug preventing the normalized chart from being linked.
9+

_updates/2020-10-30.png

47.7 KB
Loading

_updates/2020-11-02.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Improving the Y-Axis on Log Scaling
3+
date: 2020-11-02
4+
visualization: 1
5+
---
6+
7+
With the introduction of derivative charts, the new code for log scaling on some graphs (particularly those with large values, like a graph of cumulative deaths) left a lot of whitespace at the bottom of the graph due to x-intercept of the y-axis was "fixed" at starting at 0.001.
8+
9+
Log scales are tricky as they are undefined at 0, so you are unable to start the y-axis labeling as 0 and visualizations are forced to choose a non-zero value. (This differs from a linear scale, where best practices dictate that -- unless it's both obvious to the reader and for a clear reason -- an honest visualization will always start with the y-axis at zero.) With today's update, I've implemented new code to calculate the starting value (x-intercept) for the log scales.
10+
11+
In general, the scale for all log graphs will start at the 10<sup><code>x</code></sup> power such that 10<sup><code>x</code></sup> is lower than the lowest positive data point, with two exceptions:
12+
- The lowest value for `x` is -3 (or 0.001), even if data values are smaller than 0.001 (ex: less than 0.001 cases /100k). These points, will be displayed as a data point below the x-axis (slightly outside of the graph region).
13+
- If the graph spans over 5 orders of magnitude, `x` is increased (up to a maximum of `x=0` or 1) to attempt to show 5 orders of magnitude. Since `x` is capped at `x=0`, graphs with large values may still show many more orders of magnitude.

_updates/2020-11-03.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Fixed Daylight Savings Display Bug
3+
date: 2020-11-03
4+
---
5+
6+
In all of the 91-DIVOC visualizations, I assumed a day had 24 hours -- which wasn't the case this past weekend for most of the United States. For users where a day was 25 hours due to daylight savings time, a visual jump appeared in the chart going from "0 days ago" to "2 days ago". This is now fixed. :)
7+
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
Province_State,Confirmed,Deaths,Recovered,Active,People_Tested,Date,dWeek_Confirmed,dWeek_Deaths,dWeek_Recovered,dWeek_Active,dWeek_People_Tested,dWeek_Date,Population
2-
Alabama,186437,2892,74439,109106,1312887,10-27-2020,11909,87,201,11621,47312,10-20-2020,4903185
3-
Alaska,14798,70,7016,7712,577429,10-27-2020,3407,3,335,3069,30904,10-20-2020,731545
4-
American Samoa,0,0,0,0,1616,10-27-2020,0,0,0,0,0,10-20-2020,55641
5-
Arizona,240122,5891,40169,194062,1724647,10-27-2020,7185,54,1464,5667,77302,10-20-2020,7278717
6-
Arkansas,107679,1857,96322,9500,1303236,10-27-2020,7238,129,6039,1070,71584,10-20-2020,3017825
7-
California,914888,17460,0,897428,18127049,10-27-2020,31142,405,0,30737,937979,10-20-2020,39512223
8-
Colorado,98710,2236,7628,88846,1874101,10-27-2020,11151,54,403,10694,165651,10-20-2020,5758736
9-
Connecticut,68637,4595,9800,54242,2221034,10-27-2020,4182,36,149,3997,166772,10-20-2020,3565287
10-
Delaware,24249,686,12846,10717,343141,10-27-2020,924,18,601,305,12415,10-20-2020,973764
11-
District of Columbia,16906,644,13215,3047,502538,10-27-2020,461,2,331,128,28731,10-20-2020,705749
12-
Florida,786311,16505,0,769806,9703491,10-27-2020,25922,400,0,25522,3935544,10-20-2020,21477737
13-
Georgia,353372,7844,0,345528,3474891,10-27-2020,10934,170,0,10764,147055,10-20-2020,10617423
14-
Guam,4418,75,2611,1732,65045,10-27-2020,532,9,257,266,4539,10-20-2020,165718
15-
Hawaii,14773,215,11444,3114,508490,10-27-2020,617,26,366,225,29189,10-20-2020,1415872
16-
Idaho,60923,585,28309,32029,373337,10-27-2020,6260,50,2071,4139,17955,10-20-2020,1792065
17-
Illinois,387687,9838,0,377849,7393003,10-27-2020,33230,301,0,32929,506102,10-20-2020,12671821
18-
Indiana,166564,4194,116834,45536,2754311,10-27-2020,15900,186,7159,8555,202905,10-20-2020,6732219
19-
Iowa,118563,1680,89490,27393,869020,10-27-2020,9361,104,5972,3285,31302,10-20-2020,3155070
20-
Kansas,77887,983,2549,74355,625931,10-27-2020,5708,88,134,5486,27537,10-20-2020,2913314
21-
Kentucky,99637,1428,18045,80164,1821228,10-27-2020,10093,86,643,9364,114331,10-20-2020,4467673
22-
Louisiana,180991,5872,165282,9837,2723277,10-27-2020,4310,100,3490,720,106820,10-20-2020,4648794
23-
Maine,6309,146,5399,764,595786,10-27-2020,322,0,193,129,41692,10-20-2020,1344212
24-
Maryland,141741,4108,8099,129534,3311143,10-27-2020,4997,58,173,4766,189344,10-20-2020,6045680
25-
Massachusetts,153037,9888,122856,20293,5781231,10-27-2020,7573,130,3964,3479,475190,10-20-2020,6949503
26-
Michigan,182344,7585,114939,59820,4693470,10-27-2020,16350,202,5400,10748,307679,10-20-2020,9986857
27-
Minnesota,137536,2421,122100,13015,2698113,10-27-2020,12005,122,10466,1417,175114,10-20-2020,5639632
28-
Mississippi,116617,3283,101385,11949,846161,10-27-2020,5295,81,3710,1504,5295,10-20-2020,2976149
29-
Missouri,175130,2855,0,172275,2438579,10-27-2020,13281,230,0,13051,141905,10-20-2020,6137428
30-
Montana,29346,305,18981,10060,481322,10-27-2020,5253,53,4139,1061,36301,10-20-2020,1068778
31-
Nebraska,65376,620,42245,22511,572760,10-27-2020,5967,55,2932,2980,26091,10-20-2020,1934408
32-
Nevada,96908,1752,2385,92771,794921,10-27-2020,5409,25,49,5335,43318,10-20-2020,3080156
33-
New Hampshire,10530,475,8989,1066,590364,10-27-2020,702,7,731,-36,46802,10-20-2020,1359711
34-
New Jersey,231331,16306,36609,178416,4484813,10-27-2020,9138,79,604,8455,249513,10-20-2020,8882190
35-
New Mexico,43169,980,20910,21279,1124922,10-27-2020,5273,38,909,4326,63654,10-20-2020,2096829
36-
New York,498646,33433,79230,385983,13945858,10-27-2020,12166,67,700,11399,873143,10-20-2020,19453561
37-
North Carolina,263883,4211,231611,28061,3890764,10-27-2020,15133,219,13070,1844,218971,10-20-2020,10488084
38-
North Dakota,39130,476,32339,6315,796514,10-27-2020,5464,64,5117,283,50150,10-20-2020,762062
39-
Northern Mariana Islands,92,2,29,61,16085,10-27-2020,4,0,0,4,274,10-20-2020,55194
40-
Ohio,202740,5239,161704,35797,4282604,10-27-2020,17101,156,9244,7701,303190,10-20-2020,11689100
41-
Oklahoma,118409,1273,101656,15480,1564476,10-27-2020,8861,82,7958,821,97466,10-20-2020,3956971
42-
Oregon,42808,664,5870,36274,836995,10-27-2020,2672,31,0,2641,41678,10-20-2020,4217737
43-
Pennsylvania,203520,8683,152803,42034,2452969,10-27-2020,13550,167,6755,6628,112458,10-20-2020,12801989
44-
Puerto Rico,63497,808,27607,35082,369469,10-27-2020,4854,39,1660,3155,4854,10-20-2020,3193694
45-
Rhode Island,31445,1188,2672,27585,1077670,10-27-2020,2796,24,114,2658,92350,10-20-2020,1059361
46-
South Carolina,172579,3842,87892,80845,1745026,10-27-2020,7086,146,4531,2409,125104,10-20-2020,5148714
47-
South Dakota,40730,375,29167,11188,249165,10-27-2020,6273,45,3481,2747,14439,10-20-2020,884659
48-
Tennessee,251774,3207,222348,26219,3586241,10-27-2020,18205,255,14166,3784,189505,10-20-2020,6833174
49-
Texas,904769,18061,763108,123600,7883440,10-27-2020,42492,503,29350,12639,439114,10-20-2020,28995881
50-
Utah,107228,578,78946,27704,1044695,10-27-2020,10585,27,7253,3305,58271,10-20-2020,3205958
51-
Vermont,2113,58,1766,289,186291,10-27-2020,157,0,65,92,6578,10-20-2020,623989
52-
Virgin Islands,1351,21,1308,22,23659,10-27-2020,14,0,12,2,807,10-20-2020,104914
53-
Virginia,174786,3595,19702,151489,2543515,10-27-2020,7516,113,532,6871,131575,10-20-2020,8535519
54-
Washington,104027,2337,0,101690,2372596,10-27-2020,4877,55,0,4822,128260,10-20-2020,7614893
55-
West Virginia,22710,434,17846,4430,743737,10-27-2020,2190,23,2858,-691,51928,10-20-2020,1787145
56-
Wisconsin,206311,1852,161260,43199,2006587,10-27-2020,27829,219,21805,5805,105876,10-20-2020,5822434
57-
Wyoming,11806,77,7906,3823,125492,10-27-2020,2280,16,962,1302,7212,10-20-2020,578759
58-
United States,8777280,226688,3487666,5062926,138457135,10-27-2020,504136,5639,192518,305979,11517030,10-20-2020,329488021
2+
Alabama,203687,3084,84471,116132,1402691,11-08-2020,9702,111,3466,6125,50111,11-01-2020,4903185
3+
Alaska,19826,84,7161,12581,781301,11-08-2020,3121,1,57,3063,177094,11-01-2020,731545
4+
American Samoa,0,0,0,0,1768,11-08-2020,0,0,0,0,152,11-01-2020,55641
5+
Arizona,259264,6164,43232,209868,1872660,11-08-2020,11791,185,1834,9772,86893,11-01-2020,7278717
6+
Arkansas,121866,2085,107287,12494,1427871,11-08-2020,8809,127,7220,1462,80899,11-01-2020,3017825
7+
California,972713,17973,0,954740,19565151,11-08-2020,36835,302,0,36533,821836,11-01-2020,39512223
8+
Colorado,130984,2394,8562,120028,2214788,11-08-2020,21074,106,599,20392,210066,11-01-2020,5758736
9+
Connecticut,78125,4671,9800,63654,2434474,11-08-2020,6918,55,0,6863,145890,11-01-2020,3565287
10+
Delaware,26603,718,14019,11866,587562,11-08-2020,1477,8,728,741,26295,11-01-2020,973764
11+
District of Columbia,18001,654,13843,3504,555449,11-08-2020,632,8,494,130,30203,11-01-2020,705749
12+
Florida,843897,17121,0,826776,10555504,11-08-2020,36485,332,0,36153,468606,11-01-2020,21477737
13+
Georgia,373078,8194,0,364884,3733960,11-08-2020,11096,213,0,10883,149849,11-01-2020,10617423
14+
Guam,5077,88,3402,1587,71996,11-08-2020,449,9,736,-296,4433,11-01-2020,165718
15+
Hawaii,15947,221,11958,3768,562270,11-08-2020,793,2,182,609,32006,11-01-2020,1415872
16+
Idaho,72961,686,32330,39945,405569,11-08-2020,7873,56,2463,5354,19587,11-01-2020,1792065
17+
Illinois,487987,10538,0,477449,8404304,11-08-2020,64460,463,0,63997,589742,11-01-2020,12671821
18+
Indiana,210374,4629,131979,73766,3210666,11-08-2020,28266,265,9533,18468,269629,11-01-2020,6732219
19+
Iowa,154778,1845,100747,52186,935839,11-08-2020,23804,112,7225,16467,38664,11-01-2020,3155070
20+
Kansas,95586,1099,2808,91679,676320,11-08-2020,12388,74,149,12165,33538,11-01-2020,2913314
21+
Kentucky,120838,1565,21513,97760,2046964,11-08-2020,12196,76,3045,9075,151311,11-01-2020,4467673
22+
Louisiana,187961,6036,172210,9715,2892957,11-08-2020,4620,110,3576,934,109839,11-01-2020,4648794
23+
Maine,7693,152,5935,1606,676314,11-08-2020,982,5,381,596,52756,11-01-2020,1344212
24+
Maryland,153996,4212,8291,141493,3654459,11-08-2020,7851,60,92,7699,202043,11-01-2020,6045680
25+
Massachusetts,171399,10149,131646,29604,6720526,11-08-2020,11692,136,4592,6964,554902,11-01-2020,6949503
26+
Michigan,229073,7945,128981,92147,5213961,11-08-2020,31667,246,7888,23533,302369,11-01-2020,9986857
27+
Minnesota,180862,2710,146311,31841,3077966,11-08-2020,30190,181,16648,13361,241739,11-01-2020,5639632
28+
Mississippi,126689,3443,105839,17407,963897,11-08-2020,6189,95,4454,1640,39133,11-01-2020,2976149
29+
Missouri,212869,3165,0,209704,2654691,11-08-2020,24544,127,0,24417,119509,11-01-2020,6137428
30+
Montana,39679,456,23793,15430,526591,11-08-2020,6184,80,2395,3709,24887,11-01-2020,1068778
31+
Nebraska,83969,703,47793,35473,1032275,11-08-2020,12303,49,3546,8708,87097,11-01-2020,1934408
32+
Nevada,110022,1851,2525,105646,1335632,11-08-2020,8545,70,116,8355,72449,11-01-2020,3080156
33+
New Hampshire,12488,489,10096,1903,663080,11-08-2020,1274,6,717,551,46486,11-01-2020,1359711
34+
New Jersey,254595,16429,38016,200150,4965643,11-08-2020,14966,75,785,14106,307794,11-01-2020,8882190
35+
New Mexico,54881,1118,23088,30675,1250724,11-08-2020,7649,92,1518,6039,78004,11-01-2020,2096829
36+
New York,529036,33694,80646,414696,15664814,11-08-2020,19301,159,815,18327,988161,11-01-2020,19453561
37+
North Carolina,293339,4607,246318,42414,4365061,11-08-2020,16647,224,14707,1716,269696,11-01-2020,10488084
38+
North Dakota,54305,639,43103,10563,900448,11-08-2020,9262,108,6961,2193,59399,11-01-2020,762062
39+
Northern Mariana Islands,100,2,29,69,16091,11-08-2020,4,0,0,4,2,11-01-2020,55194
40+
Ohio,250268,5517,184556,60195,4868460,11-08-2020,31268,214,14297,16757,343702,11-01-2020,11689100
41+
Oklahoma,136258,1438,115030,19790,1707579,11-08-2020,12147,93,7948,4106,88836,11-01-2020,3956971
42+
Oregon,50448,730,5870,43848,909301,11-08-2020,5019,39,0,4980,41509,11-01-2020,4217737
43+
Pennsylvania,235014,9005,168708,57301,2672529,11-08-2020,20598,202,10608,9788,134783,11-01-2020,12801989
44+
Puerto Rico,72166,872,33315,37979,344072,11-08-2020,5505,40,3412,2053,-28561,11-01-2020,3193694
45+
Rhode Island,36380,1224,2891,32265,1217916,11-08-2020,3506,23,128,3355,93609,11-01-2020,1059361
46+
South Carolina,185688,4036,96422,85230,1959102,11-08-2020,7665,100,4956,2609,131750,11-01-2020,5148714
47+
South Dakota,55404,536,39118,15750,277035,11-08-2020,8080,99,5369,2612,14870,11-01-2020,884659
48+
Tennessee,281851,3595,250818,27438,3873139,11-08-2020,20425,242,17643,2540,189966,11-01-2020,6833174
49+
Texas,990930,19184,820215,151531,8734857,11-08-2020,54114,682,38209,15223,576365,11-01-2020,28995881
50+
Utah,132621,659,93763,38199,1492793,11-08-2020,16111,45,8464,7602,94438,11-01-2020,3205958
51+
Vermont,2392,59,1923,410,438828,11-08-2020,196,1,107,88,26081,11-01-2020,623989
52+
Virgin Islands,1405,23,1345,37,25417,11-08-2020,29,2,25,2,987,11-01-2020,104914
53+
Virginia,192175,3707,21494,166974,2787106,11-08-2020,9783,52,1450,8281,139447,11-01-2020,8535519
54+
Washington,117331,2439,0,114892,2592766,11-08-2020,9016,73,0,8943,142644,11-01-2020,7614893
55+
West Virginia,28404,504,21032,6868,849461,11-08-2020,3521,44,2021,1456,61875,11-01-2020,1787145
56+
Wisconsin,267410,2312,206944,58154,3564737,11-08-2020,38548,265,27714,10569,254381,11-01-2020,5822434
57+
Wyoming,17310,114,10315,6881,141079,11-08-2020,3587,27,1639,1921,10094,11-01-2020,578759
58+
United States,9968003,237567,3881491,5848945,156478414,11-08-2020,761157,6571,250912,503693,9259845,11-01-2020,329488021

pages/coronavirus-contribution-by-state/04.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ var prep_data = function(chart) {
395395
var calculateDaysAgo = function(date) {
396396
let dateParts = date.split("-");
397397
let dateObj = new Date(parseInt(dateParts[0]), parseInt(dateParts[1]) - 1, parseInt(dateParts[2]));
398-
let daysAgo = (_dateObj_today_time - dateObj.getTime()) / (1000 * 3600 * 24);
398+
let daysAgo = (_dateObj_today_time - dateObj.getTime() + 3.7e6) / (1000 * 3600 * 24);
399399
// TODO:
400-
return Math.ceil(daysAgo);
400+
return Math.round(daysAgo);
401401
};
402402

403403
var process_data = function(data, chart, isSubdata = false, noPrepData = false) {
@@ -498,9 +498,9 @@ var process_data = function(data, chart, isSubdata = false, noPrepData = false)
498498

499499
let dateParts = date.split("-");
500500
let dateObj = new Date(parseInt(dateParts[0]), parseInt(dateParts[1]) - 1, parseInt(dateParts[2]));
501-
let daysAgo = (_dateObj_today_time - dateObj.getTime()) / (1000 * 3600 * 24);
501+
let daysAgo = (_dateObj_today_time - dateObj.getTime() + 3.7e6) / (1000 * 3600 * 24);
502502
// TODO:
503-
daysAgo = Math.ceil(daysAgo);
503+
daysAgo = Math.round(daysAgo);
504504

505505
let cases = fetchCasesValue(country, date);
506506
var rawCaseValue = fetchRawCasesValue(country, date);
@@ -2161,7 +2161,7 @@ var doRender = function(chart) {
21612161
relDate < endDate;
21622162
relDate = new Date(relDate.setMonth(relDate.getMonth()+1)))
21632163
{
2164-
let daysAgo = (_dateObj_today_time - relDate.getTime()) / (1000 * 3600 * 24);
2164+
let daysAgo = Math.round((_dateObj_today_time - relDate.getTime() + 3.7e6) / (1000 * 3600 * 24));
21652165
if (daysAgo > maxDayRendered) { continue; }
21662166

21672167
dateLines.push({

0 commit comments

Comments
 (0)