Template talk:COVID-19 pandemic death rates by country

Page contents not supported in other languages.
Source: Wikipedia, the free encyclopedia.
WikiProject iconCOVID-19 Template‑class
WikiProject iconThis template is within the scope of WikiProject COVID-19, a project to coordinate efforts to improve all COVID-19-related articles. If you would like to help, you are invited to join and to participate in project discussions.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.

Change to template format

I have suggested adding this template to COVID-19 pandemic by country and territory, but this would require changing the format of the template to be a box with scrolling, the same as Template:COVID-19 pandemic data. See the discussion at Talk:COVID-19 pandemic by country and territory#Add new template?. Do other editors agree to this change and if so does anyone know how to do it? Dudley Miles (talk) 11:46, 27 August 2020 (UTC)[reply]

That would be a bad idea. It would make the page here a lot less useful. Plus it is unnecessary. I believe they could include this template as is. In other words, this template could be put inside a separate scrolling template. Or inside a vertically scrolling div. See:
https://www.google.com/search?q=vertically+scrolling+divs
A vertically scrolling div or table can also have expand/collapse links. Some expanding divs or tables are set up with only a "expand" link. I prefer that they also have the "collapse" link that shows up too. Some people want to get past long lists quickly when done with them, and go back to scrolling through the prose. That is not easy if a table stays open after expansion, and can't be closed back to its original size.
But all that can be done in the other article. Nothing has to be changed with this template. See:
Help:Table#Scrolling
Help:Table#Collapsible tables
Help:Collapsing
mw:Manual:Collapsible_elements
--Timeshifter (talk) 18:31, 27 August 2020 (UTC)[reply]
Mfb. Can you please advise what to do? This is way beyond my technical knowledge. I agree with Timeshifter that it is best to keep this template as it is and do the conversion in the article. Dudley Miles (talk) 18:35, 27 August 2020 (UTC)[reply]
In the end they may end up just copying the data from the source like we do. Some very complex CSS and tables are used for their existing data table:
Template:COVID-19 pandemic data
--Timeshifter (talk) 18:51, 27 August 2020 (UTC)[reply]
It's much more difficult to get that in a nice format if the table has no idea that it will be included in such a div. The other template has the expansion/scrolling elements included for a good reason. Maybe I'll play around with it a bit at some point, let's see, but making the display nice for every browser and screen resolution could be a mess. --mfb (talk) 19:00, 27 August 2020 (UTC)[reply]

(Unindent). The simplest thing may be just to put the template in a fully collapsed table in the other article:

COVID-19 pandemic death rates by country.
Updated April 26, 2024.
COVID-19 pandemic cases and mortality by country[1]
Country Deaths / million Deaths Cases
World[a] 883 7,044,637 775,293,616
Peru 6,485 220,831 4,524,748
Bulgaria 5,706 38,700 1,329,171
Bosnia and Herzegovina 5,068 16,388 403,631
Hungary 4,921 49,051 2,230,312
North Macedonia 4,765 9,977 350,580
Slovenia 4,741 10,051 1,355,857
Croatia 4,652 18,751 1,316,817
Georgia 4,575 17,132 1,862,669
Montenegro 4,232 2,654 251,280
Czech Republic
4,145 43,503 4,759,041
Latvia 4,033 7,465 977,701
Slovakia 3,760 21,225 1,877,706
Greece 3,754 38,991 5,629,524
San Marino 3,739 126 25,292
Moldova 3,737 12,233 635,459
Lithuania 3,564 9,802 1,365,905
United States
3,502 1,184,883 103,436,829
Romania 3,495 68,710 3,526,592
Gibraltar 3,458 113 20,550
United Kingdom
3,438 232,112 24,917,163
Italy 3,335 196,910 26,719,139
Brazil 3,260 702,116 37,519,960
Chile 3,193 62,611 5,398,653
Armenia 3,156 8,777 451,831
Poland 3,028 120,707 6,662,190
Martinique 3,003 1,104 230,354
Belgium 2,946 34,339 4,861,157
Paraguay 2,931 19,880 735,759
Argentina 2,875 130,847 10,130,485
Trinidad and Tobago 2,867 4,390 191,496
European Union[b]
2,801 1,261,013 185,623,282
Russia 2,781 402,589 24,098,232
Ukraine 2,768 109,920 5,533,069
Colombia 2,751 142,727 6,384,735
Aruba 2,742 292 44,224
Portugal 2,739 28,132 5,643,184
Serbia 2,627 18,057 2,583,470
Mexico 2,627 335,011 7,709,747
France 2,600 168,091 38,997,490
Sweden 2,584 27,265 2,751,512
Guadeloupe 2,579 1,021 203,235
Bermuda 2,569 165 18,860
Spain 2,562 121,852 13,980,340
Austria 2,520 22,534 6,082,341
Guam 2,439 419 52,287
Tunisia 2,381 29,423 1,153,361
Saint Lucia 2,279 410 30,252
Suriname 2,273 1,405 82,496
Liechtenstein 2,261 89 21,575
Estonia 2,260 2,998 610,320
Uruguay 2,227 7,625 1,037,893
French Polynesia 2,122 650 79,301
Barbados 2,105 593 110,587
Germany 2,098 174,979 38,437,756
Sint Maarten 2,081 92 11,051
Finland 2,069 11,466 1,499,712
Bahamas
2,058 844 38,084
British Virgin Islands
2,042 64 7,392
Ecuador 2,002 36,048 1,075,864
Lebanon 1,994 10,947 1,239,904
Andorra 1,991 159 48,015
Panama 1,974 8,703 1,044,310
Republic of Ireland
1,907 9,580 1,735,294
Grenada 1,897 238 19,693
Monaco 1,836 67 17,181
Bolivia 1,831 22,387 1,212,131
Puerto Rico 1,825 5,938 1,252,713
Montserrat 1,812 8 1,403
Costa Rica 1,808 9,368 1,230,653
Kosovo 1,802 3,212 274,279
Hong Kong 1,798 13,466 2,876,106
South Africa 1,712 102,595 4,072,652
Belize 1,697 688 71,409
Malta 1,697 905 121,410
Iran 1,657 146,811 7,627,186
Denmark 1,641 9,653 3,434,777
Switzerland 1,623 14,188 4,453,293
Guyana 1,608 1,301 74,099
Seychelles 1,605 172 51,679
Namibia 1,599 4,106 172,399
Curaçao 1,595 305 45,883
Antigua and Barbuda 1,556 146 9,106
Luxembourg 1,544 1,000 391,281
Cyprus 1,525 1,367 690,791
Caribbean Netherlands
1,515 41 11,922
Jersey 1,453 161 66,391
Collectivity of Saint Martin
1,445 46 12,324
Canada 1,411 54,262 4,788,109
Isle of Man 1,372 116 38,008
French Guiana 1,356 413 98,041
Israel 1,344 12,707 4,841,558
United States Virgin Islands
1,326 132 25,389
Netherlands
1,308 22,986 8,635,962
Jamaica 1,272 3,597 156,806
Albania 1,268 3,605 334,863
Jordan 1,251 14,122 1,746,997
Saint Vincent and the Grenadines 1,192 124 9,674
Turkey 1,188 101,419 17,004,714
Eswatini 1,187 1,427 75,191
Guatemala 1,132 20,202 1,250,338
Malaysia 1,100 37,348 5,278,406
Palestine
1,087 5,708 703,228
New Caledonia 1,082 314 80,064
Honduras 1,065 11,114 472,785
Botswana 1,064 2,801 330,643
Guernsey 1,057 67 35,326
Norway 1,054 5,732 1,507,269
Bahrain 1,043 1,536 696,614
Dominica 1,017 74 16,047
Oman 1,011 4,628 399,449
Azerbaijan 999 10,353 835,318
Kazakhstan 983 19,072 1,503,687
Saint Kitts and Nevis 964 46 6,607
Australia 956 25,035 11,826,879
Fiji 951 885 69,047
Réunion 945 921 494,595
Libya 944 6,437 507,269
Turks and Caicos Islands
874 40 6,754
Northern Mariana Islands
827 41 14,594
Mauritius 823 1,070 327,305
Wallis and Futuna 776 9 3,760
Sri Lanka 774 16,899 672,754
American Samoa 767 34 8,359
Cuba 760 8,530 1,115,043
New Zealand 756 3,923 2,577,157
Anguilla 755 12 3,904
Belarus 746 7,118 994,037
Taiwan 739 17,672 9,970,937
Cabo Verde
703 417 64,474
South Korea 693 35,934 34,571,873
Mongolia 672 2,284 1,011,526
El Salvador 667 4,230 201,864
Maldives 603 316 186,694
Japan 602 74,694 33,803,572
Kuwait 602 2,570 667,193
Indonesia 588 162,056 6,828,957
Philippines
578 66,864 4,140,383
Mayotte 573 187 42,027
Iraq 570 25,375 2,465,545
Federated States of Micronesia
569 65 26,547
Palau 552 10 6,290
Cayman Islands
538 37 31,472
Faroe Islands
527 28 34,658
Iceland 498 186 209,915
Thailand 482 34,586 4,770,779
Saint Barthélemy 454 5 5,507
Vietnam 440 43,206 11,624,000
Morocco 435 16,304 1,279,028
Marshall Islands
408 17 16,178
Brunei 396 178 343,790
Nepal 393 12,031 1,003,450
Dominican Republic
390 4,384 661,181
India 376 533,565 45,035,055
Greenland 371 21 11,971
Myanmar 359 19,494 641,990
Singapore 359 2,024 3,006,155
Sao Tome and Principe
351 80 6,749
Zimbabwe 351 5,740 266,359
Saint Pierre and Miquelon 339 2 3,426
Lesotho 307 709 36,138
Solomon Islands
274 199 25,954
Saudi Arabia 264 9,646 841,469
Qatar 256 690 514,524
United Arab Emirates
248 2,349 1,067,030
Egypt 223 24,830 516,023
Mauritania 210 997 63,848
Venezuela 206 5,856 552,695
Zambia 203 4,069 349,589
Afghanistan 194 7,985 233,326
Comoros
191 160 9,109
Kiribati 182 24 5,085
Cambodia 182 3,056 139,102
Macau 174 121 3,514
Bangladesh 172 29,493 2,049,645
Djibouti 168 189 15,690
Kyrgyzstan 154 1,024 88,953
Algeria 153 6,881 272,017
Syria 142 3,163 57,423
Samoa 139 31 17,057
Gambia
137 372 12,626
Malawi 131 2,686 89,168
Pakistan 129 30,656 1,580,631
Gabon 128 307 49,051
Cook Islands
117 2 7,324
Senegal 113 1,971 89,067
Tonga 112 12 16,958
Equatorial Guinea 109 183 17,130
Sudan 107 5,046 63,993
Rwanda 106 1,468 133,221
Kenya 105 5,689 344,101
Timor-Leste
102 138 23,460
Laos 89 671 218,967
Tuvalu 88 1 2,943
China[c] 85 122,121 99,348,816
Guinea-Bissau 84 177 9,614
Nauru 78 1 5,393
Somalia 77 1,361 27,334
Uganda 76 3,632 172,149
Haiti 74 860 34,298
Cameroon 70 1,974 125,146
Mozambique 68 2,252 233,772
Papua New Guinea 66 670 46,864
Republic of the Congo
65 389 25,217
Yemen 64 2,159 11,945
Ethiopia 61 7,574 501,158
Liberia 55 294 7,930
Angola 54 1,937 107,365
Madagascar 48 1,426 68,493
Ghana 43 1,462 171,907
Vanuatu 42 14 12,019
Nicaragua 35 245 16,138
Guinea 33 468 38,572
Mali 32 743 33,164
Togo 32 290 39,529
Ivory Coast 29 835 88,408
Uzbekistan 29 1,016 175,081
Eritrea 27 103 10,189
Bhutan 26 21 62,697
Central African Republic
20 113 15,440
Burkina Faso 17 400 22,120
Democratic Republic of the Congo
14 1,468 99,338
Sierra Leone 14 125 7,794
Nigeria 14 3,155 267,188
South Sudan 13 147 18,823
Tanzania 12 846 43,225
Tajikistan 12 125 17,786
Benin 12 163 28,036
Niger 12 315 9,515
Chad 10 194 7,702
Burundi 1 15 54,569
North Korea 0 6 1
Pitcairn Islands
4
Falkland Islands
1,923
Niue 1,059
Turkmenistan 0 0
Vatican City 0 26
Tokelau 0 80
Saint Helena, Ascension and Tristan da Cunha 2,166
  1. ^ Countries which do not report data for a column are not included in that column's world total.
  2. member states of the European Union
    are individually listed, but are also summed here for convenience. They are not double-counted in world totals.
  3. ^ Does not include special administrative regions (Hong Kong and Macau) or Taiwan.
{| class="wikitable mw-collapsible mw-collapsed"
![[COVID-19 pandemic death rates by country]]. 
|-
|{{Template:COVID-19 pandemic death rates by country}}
|}

References

  1. ^ Ritchie, Hannah; Mathieu, Edouard; Rodés-Guirao, Lucas; Appel, Cameron; Giattino, Charlie; Ortiz-Ospina, Esteban; Hasell, Joe; Macdonald, Bobbie; Beltekian, Diana; Dattani, Saloni; Roser, Max (2020–2022). "Coronavirus Pandemic (COVID-19)". Our World in Data. Retrieved 2024-04-26.

The reference will show up in the article references. I used {{

talk refs
}} here to place the references in this talk section.
--Timeshifter (talk) 19:28, 27 August 2020 (UTC)[reply]

Timeshifter and Mfb I would strongly oppose adding the template collapsed. I think it is very important to add the death rates table to the article as total figures without taking into account population size are misleading, and the more informative comparison in this template should not be collapsed. Altering the view I gave above, I think that the change should be made in this template. It is not a problem if there is a 'show all' option. It is the article that matters, as it has more than 40,000 page views a day, not this template which has under 50. Dudley Miles (talk) 19:43, 27 August 2020 (UTC)[reply]
This template has over 2000 page views per day in its current article: See page views banner at the top of Talk:COVID-19 pandemic death rates by country.
Mfb and Dudley Miles. I asked for help here:
Help talk:Table#Partially collapsed table with vertical scrolling and show/hide links?
--Timeshifter (talk) 19:51, 27 August 2020 (UTC)[reply]
The template has minimal page views but I see that the article which uses it has 2000 per day. COVID-19 pandemic by country and territory has 49,000 per day. I do not see the problem with having the template partially collapsed with a show all option. Dudley Miles (talk) 20:14, 27 August 2020 (UTC)[reply]
For one thing it is against
MOS:SCROLL. Exceptions are made for most rules on Wikipedia. But in list articles I rarely see partially collapsed tables. There is an obvious need for an exception at COVID-19 pandemic by country and territory
for the existing table.
Plus I don't understand your objection to a fully collapsed table being used at COVID-19 pandemic by country and territory. You mentioned "taking into account population size". Are you talking about adding a column for population by country? That would be difficult since the table is not in alphabetical order.
And I don't see the need. The death rates are based on deaths per population. I don't need to know the population to understand death rates. The John Hopkins University source already took care of those calculations. If you want populations we can link to a population by country article.
But let's wait for replies at the Help:Table request for help.
In the end I would rather create 2 templates if necessary. One for this article, and one for the other article. You can update the new template, and I can keep updating the template here daily. Same amount of work for you, just in the other article.
--Timeshifter (talk) 20:30, 27 August 2020 (UTC)[reply]
Duplicating data is the worst option I think. Before we do that I would make a template that grabs the information from here and puts it in a different table structure. Still a bit awkward but better than having two tables with the same numbers. --mfb (talk) 21:14, 27 August 2020 (UTC)[reply]
Mfb Does User:Dudley Miles/sandbox do what you are suggesting? It copies across the instructions for updating, which should not be in any of the articles which use the template. Would it be best to move them to this talk page? Dudley Miles (talk) 12:46, 28 August 2020 (UTC)[reply]
@Dudley Miles: I would have thought that the obvious place to put the update instructions is in Template:COVID-19 pandemic death rates by country/doc, the documentation page for the template. You could always leave a link to it from a hidden html comment inside the template itself (like the <!-- Update table from here onwards --> message), so that every page that transcludes the template will know where to go to update it. At present, anybody using a screen reader hears that huge caption every time they call up a list of tables for the article. We should be kinder to the visually impaired. --RexxS (talk) 13:30, 28 August 2020 (UTC)[reply]
Well you live and learn. I did not know that templates have a documentation page. I have done as you suggested, but I am not sure whether I have put in the link to the documentation page correctly. Please correct it if not. Dudley Miles (talk) 13:52, 28 August 2020 (UTC)[reply]
@Dudley Miles: What you did was fine. I've moved it to its own line to give it a bit more prominence in case it gets lost in the clutter of the caption and reference. I've also shortened the caption because I don't think we need to attribute uncontested information and the reader will see the source if they check the reference anyway. If you think the longer caption is preferable for whatever reason, by all means add the JHU stuff back. --RexxS (talk) 14:11, 28 August 2020 (UTC)[reply]

Date style

I plan to add this table to COVID-19 pandemic by country and territory and that article uses British style dates. Is it OK if I change the date style in this template in order to avoid inconsistent styles in the article? Dudley Miles (talk) 10:58, 29 August 2020 (UTC)[reply]

OK. --Timeshifter (talk) 14:30, 29 August 2020 (UTC)[reply]

Link to scrollable sandbox version and Help:Table discussion about it

See:

Dudley Miles. I suggest using numbered sandboxes. You and others can then keep working on this. From Help:Table:

Sandboxes help a lot. For example; your user page: Special:MyPage. Create and bookmark some personal sandboxes too. Visual Editor will load very fast in empty sandboxes: Special:MyPage/Sandbox, Special:MyPage/Sandbox2, Special:MyPage/Sandbox3. As many as you want. Share the link when asking for help. To find all your sandboxes: Special:PrefixIndex/User: – click link, add user name to the spot labeled "Display pages with prefix:".

--Timeshifter (talk) 06:37, 30 August 2020 (UTC)[reply]

The latest version is at Template:COVID-19 pandemic death rates. Please advise any improvements needed to this. There is extra space between V.T.E. and the heading which I cannot delete. Dudley Miles (talk) 09:39, 30 August 2020 (UTC)[reply]
The "show all" button needs to toggle to a "collapse" button and vice versa. It should collapse back to the scrollable chart. --Timeshifter (talk) 10:00, 30 August 2020 (UTC)[reply]
I do not know how to do this. Can you advise? On my computer I can toggle by clicking the back arrow. Dudley Miles (talk) 10:11, 30 August 2020 (UTC)[reply]
That is not toggling.
The experts are involved with this template: Template:COVID-19 pandemic data. See talk:
Template talk:COVID-19 pandemic data#Need a link to collapse it back to its original scroll box size
I think it needs to be done in the CSS:
Template:COVID-19 pandemic data/styles.css
I don't know how. I asked here too:
Template talk:COVID-19 pandemic data/styles.css#Collapse link needed to collapse back to the original scroll box
--Timeshifter (talk) 10:31, 30 August 2020 (UTC)[reply]

Made table narrower

I made the table narrower by putting breaks in the headers, and removing width: 6em; from the CSS:

  • Template:COVID-19 pandemic death rates by country/styles.css

See diff. On my monitor at the default font size the table went from 9 7/8 inches wide to 8 1/4 inches wide. --Timeshifter (talk) 11:53, 30 August 2020 (UTC)[reply]

The problem with that is that anybody using a screen reader would be liable to hear line breaks every time the column header is spoken. If they are navigating around in table mode, that's every cell. We should not be sacrificing the experience for some users just to trim a couple of inches off a table width. Who benefits from that? --RexxS (talk) 12:40, 30 August 2020 (UTC)[reply]

Country links

Adding country links is an improvement but how do we stop them being overwritten each time the table is updated? Dudley Miles (talk) 13:24, 30 August 2020 (UTC)[reply]

Timeshifter and RexxS It would be best to link to the article on the COVID-19 outbreak in each country, as Template:COVID-19 pandemic data does. This could be achieved by converting each country name from eg San Marino to {{flag+link|COVID-19 pandemic in|San Marino}}, but is there a way of automating this so that it can be done after each update? Dudley Miles (talk) 13:39, 30 August 2020 (UTC)[reply]

Dudley Miles. The country links and flags are created each time you update. See instructions in the template documentation. It is instant.
I don't know how to do the links you want. I suggest looking at {{flaglist}} documentation. Template docs usually list all the other related templates. One of them might have a linking option.
Also, you might then contact User:PrimeHunter if necessary to find another regular expression to change all the links at once.
Or you might find a way with simple global find-and-replace in the wikitext. As a first or second step in combination with the existing regular expression I used from PrimeHunter.
See also: Template:Flag/doc and Wikipedia:WikiProject Flag Template#List.
{{flag+link}} exists. I thought you were making it up as a desired template. Next time, please link more. Play with find-and-replace. --Timeshifter (talk) 15:51, 30 August 2020 (UTC)[reply]
Dudley Miles. I see you succeeded. That's great! Please explain in the template documentation what additional steps you took. So others can apply this here and elsewhere. --Timeshifter (talk) 16:45, 30 August 2020 (UTC)[reply]

Need JHU source in caption for template in COVID-19 pandemic by country and territory

See: COVID-19 pandemic by country and territory. 2 scrolling tables are in the same section.

In list articles with separate tables from different sources it is common to put the source either in the section header or the table caption. See examples:

If the 2 scrolling tables in COVID-19 pandemic by country and territory were put in different sections, then the JHU source could be put in the section header. Then it could be removed again from the template caption.

In COVID-19 pandemic death rates by country the JHU source is mentioned in the lead. So it is not really necessary to repeat the source in the table caption. Because the table is in the section that immediately follows the lead. --Timeshifter (talk) 11:29, 2 September 2020 (UTC)[reply]

I think it is fine as it is. Having the tables side by side in COVID-19 pandemic by country and territory allows readers to easily compare the positions of countries with absolute and proportional figures, while having the source in the caption helps to explain why the figures for each country are slightly different in the two tables. The JHU source could be deleted from the lead in COVID-19 pandemic death rates by country to avoid repetition. Dudley Miles (talk) 11:37, 2 September 2020 (UTC)[reply]
Dudley Miles. I agree with you that having JHU in the caption is fine. Especially if you want to keep the 2 tables side by side, and you want readers, including blind readers, to be able to understand the differences between the 2 tables better right away. I am talking about in COVID-19 pandemic by country and territory. The tables are in the same section, and are either side-by-side, or they follow one another. It depends on the the screen width.
RexxS apparently gave you permission to return JHU to the caption previously. See diff. And it is fine by me if you remove the JHU mention from the lead of COVID-19 pandemic death rates by country. That way blind readers will not have to hear that twice in a short time. --Timeshifter (talk) 14:33, 2 September 2020 (UTC)[reply]
The table caption is used by screen readers to identify the table when calling up a list of tables in an article. We should not force them to listen to an unnecessarily long caption each time they do that. Brevity is the soul of accessibility. --RexxS (talk) 13:36, 2 September 2020 (UTC)[reply]
I am not clear where the discussion has got to. I think that the two tables should be side be side in COVID-19 pandemic by country and territory so that readers can easily compare them. I am neutral on other issues. Dudley Miles (talk) 14:40, 2 September 2020 (UTC)[reply]
Dudley Miles. Chris55 replied again recently here:
Talk:COVID-19 pandemic by country and territory#Add new template?
He apparently wants some explanation about the differences between the 2 tables.
I leave the location of that explanation to you.
I don't see why a blind reader would not want that explanation any less than other readers. As long as the explanation is not duplicated. --Timeshifter (talk) 14:50, 2 September 2020 (UTC)[reply]
A blind visitor using a screen reader will hear the explanation of the source in the reference. The template caption is used by them to identify the table when they call up a list of tables in article. Do you see any reason why they need to be told the data comes from JHU every time they hear the list? --RexxS (talk) 16:02, 2 September 2020 (UTC)[reply]

Comment. Please see previous replies. Why subject a blind reader to having to go to a reference in order to find out the difference in 2 tables at COVID-19 pandemic by country and territory? And see diff. I will be removing this template, its talk page, and COVID-19 pandemic death rates by country from my watchlist. I can find much more productive uses of my time. --Timeshifter (talk) 16:53, 2 September 2020 (UTC)[reply]

Reply Please see my previous replies. Why subject a blind visitor to hearing that the data comes from JHU every time they call up a list of tables in the article. The purpose of a caption is to give a brief description of the subject of the table, which can be used to identify it. The purpose of a reference is to provide the source used for the information. They are two different things and should not be confused with each other. --RexxS (talk) 16:59, 2 September 2020 (UTC)[reply]

Python Helper

If anyone passing by feels like wanting to update this page, it is possible to do it in seconds by using the python script below (written by me, released here as public domain). Please only run if you are able to read it and conclude it is safe by yourself, wikimedia can't take any responsibility for scripts written by contributors. Also note that it works as of 2021-04-16, JHU can change their page formatting, and it would eventually break the script, so use your good judgment to conclude the data being generated is safe. If anything seems not correct please message brunoff asking for a fix or fix the script by yourself. Brunoff (talk) 01:30, 3 January 2021 (UTC)[reply]

from requests import get as reqget
from json import loads as jsonloads
from pyperclip import copy as clipcp

t = reqget('https://coronavirus.jhu.edu/data/mortality').text
i = t.find('/static/js/main')
t = reqget('https://coronavirus.jhu.edu'+t[i:t.find('.chunk.js"',i)+9]).text
i = t.find('{"Country":{')
t = t[i:t.find('}}\'',i)+2].replace('\\xf4','ô').replace('\\','').replace('"nan"','"-"')
d = jsonloads(t)
clipcp('|-\n'.join([f"|{{{{flag+link|COVID-19 pandemic in|{d['Country'][i]}}}}}||{d['Confirmed'][i]}||{d['Deaths'][i]}||{d['Case-Fatality'][i]}||{d['Deaths/100k pop.'][i]}\n" for i in d['Country'].keys()]))

Note: the pyperclip copy is optional. It copies the table contents to the clipboard, all needed after running the script is pasting the clipboard in the template source on its correct location.

Automation of updates

Hello! I'm Tol, and I've been working on automating updating of COVID-19 data templates using Module:COVID-19 data. I've discussed this with Timeshifter on my talk (permalink), and I'd like to see what the general opinion is. This would probably entail replacing deaths per hundred thousand with deaths per million, and may also include removing the case–fatality ratio (I could write some custom code to calculate it, but I'd prefer not to, and Timeshifter has brought up problems with it depending on testing rates). Please discuss at Template talk:COVID-19 pandemic death rates#Automation of updates to avoid a discussion fork. Thank you! Tol (talk | contribs) @ 17:49, 23 September 2021 (UTC)[reply]

Row numbers

Jroberson108. See diff. I noticed that row numbers were removed recently: {{Static row numbers}}.

I would like them returned. This is an expanded table, and many people like row numbers for ranking of any column. Row numbers are on many tables.

Keep {{Import-blanktable}} for the row highlighting and white background. And so class=srn-white-background does not need to be returned.

Keep the plainrowheaders if they are used with a white background for the row headers. Keep the scopes. --Timeshifter (talk) 21:59, 15 January 2022 (UTC)[reply]

Country rank column

Not sure if it's my imagination, but I'm pretty sure until recently "World" didn't have a number against it in the left-hand column (which I assume is a simple ranking). This would make sense, since "World" is always at the top. The rank is one of the most impactful and quotable columns (country **** is the ****th worse for xxx), but is now compromised (e.g. at the time of writing, it appears that Romania has the 10th worst rate of deaths, rather than the 9th).
If this has been a glitch of some sort and someone is looking at changing it back, it would be useful to exclude the rank number for the European Union as well - it's interesting to see the grouping but (especially as it moves up the table) misleading. I understand this might be a different issue, since the EU number is sorted with the rest of the data rather than remaining distinct at the top. — Preceding unsigned comment added by 2A00:23C6:7787:7601:542A:D95F:E851:B897 (talk) 11:00, 10 December 2021 (UTC)[reply]

Tol. Thought you might be interested in this. --Timeshifter (talk) 12:52, 10 December 2021 (UTC)[reply]
Thanks, @Timeshifter. It looks like this was a problem in Template:COVID-19 pandemic death rates by country. I've reverted the Module:COVID-19 data change that broke this. I don't think I can make the EU row not have a number. Tol (talk | contribs) @ 19:25, 10 December 2021 (UTC)[reply]

Tol. Would putting the EU row at the top like this be possible in your system?:

|- class="sorttop static-row-header"
| style=text-align:left |European Union||

--Timeshifter (talk) 02:10, 11 December 2021 (UTC)[reply]

@Timeshifter: Not really — the whole thing is sorted by deaths per million. "World" has a special case carved out for it so that it's always on top, but adding that for the EU would require significant changes to either
  • fork main() (the main table-generating function), which I don't really want to do — vac(), a main() fork for Template:COVID-19 vaccination data (which has a unique data fallback system) is already getting out of date, or
  • implement this as a custom option to be called in the template, like by specifying |eu_top=yes in the template, which would also be very tricky.
Tol (talk | contribs) @ 03:52, 11 December 2021 (UTC)[reply]


The Country Rank number has disappeared completely. Any chance it could be restored, since it's really useful? — Preceding unsigned comment added by 2A02:C7F:8D60:9000:54D3:21E2:8795:E996 (talk) 12:22, 16 January 2022 (UTC)[reply]

Jroberson108 and Tol. See above comment. I would like the row number column back too, if not too much trouble. {{static row numbers}}. --Timeshifter (talk) 19:57, 16 January 2022 (UTC)[reply]
This is an issue with Template:COVID-19 pandemic death rates by country. I am moving the discussion there. Tol (talk | contribs) @ 20:01, 16 January 2022 (UTC)[reply]
Moved. Tol (talk | contribs) @ 20:02, 16 January 2022 (UTC)[reply]
@Timeshifter: Alright. It looks like @Jroberson108's recent edit removed the static row numbers. Tol (talk | contribs) @ 20:06, 16 January 2022 (UTC)[reply]
The rank doesn't sort with the data, so it is a bit useless and misleading after a sort except to tell you how many rows there are. Jroberson108 (talk) 20:26, 16 January 2022 (UTC)[reply]
After a little more thought, I realized you aren't using it as a "Deaths Ranking" column, but a general rank regardless of sort. I'll add it back. Jroberson108 (talk) 20:36, 16 January 2022 (UTC)[reply]
Thanks, @Jroberson108! Tol (talk | contribs) @ 21:51, 16 January 2022 (UTC)[reply]

Date of last update. Location

Jroberson108. See diff. Edit summary: "Revert, table's note outside accessibility, as we already discussed."

You left the sort month above the scrolling table after our last discussion. For these templates:

So I thought you understood my point of view. You are making the date inaccessible to the vast majority of readers by burying it in the scrolling table (after one scrolls deep into the table).

So I moved the date of the last update above the scrolling table. To get to the date it is a lot easier to scroll the whole page a couple inches, versus scrolling a couple feet if already deep inside the scrolling table. That is the only way to get back to the date of the last update. --Timeshifter (talk) 14:27, 3 February 2022 (UTC)[reply]

@Timeshifter: Regarding the topic of our discussion, it was about you moving the table's note on one of those tables and creating accessibility issues. The solution was fix it right or ask for help. You can look at how the note was moved on one of those tables and do the same here or ask for help. Jroberson108 (talk) 14:37, 3 February 2022 (UTC)[reply]
I thought I did do it right this time. The date can be placed anywhere on a page. I believe I have placed it above the scrolling table on other pages before you got involved, and no one complained. So I was bold, and did the same this time. Please fix it. Why didn't you fix it, rather than revert it? --Timeshifter (talk) 14:52, 3 February 2022 (UTC)[reply]
@Timeshifter: Now that I'm available again and have some time, I can respond. If you read the other discussion again, then you will see the issue was you moving the table's notes (content required to explain the table) outside the "aria-label", "role", and "tabindex" attributes, creating an accessibility issue for screen readers that might tab to the content, which would completely skip the table's note. If you view the source of those other tables, you will see that I also moved those attributes so the note remains contained in those attributes. I also provided links to pages that explain those attributes so that you can learn more about them.
You seem to have some additional misunderstandings, so I will try to clear those up. The table doesn't scroll and never did. What scrolls is the class="covid19-wrapper" div element that wraps/contains content, which it currently contains the VTE links, expand/collapse links, table's note, and table in that order. The table note isn't "inaccessible" as you claim and you are misusing the term, probably confusing it with "usability" (read accessibility). If the table note were inaccessible, then everything else in the scrolling div would also be inaccessible. If you recall, you asked a visually impaired user to access the content in the scrolling div with their screen reader and I also tested it with Windows Narrator, which we both could access the content without issue.
In regards to "usability", I didn't give my opinion on the other discussion, which was about the accessibility issue you created. Since you asked what I understand, then I will state it here. I don't feel moving the table's note above the scrollable div helps that much since currently a "wide" table with a "long" note are both fully readable with the same task of scrolling/swiping. A "small" note, which is what is presently there, as well as the VTE links and expand/collapse links are all fully readable before any scrolling/swiping occurs. If the table isn't "wide" and fits the width of a small device, then a "long" note would wrap to the table's width and is fully readable without scrolling/swiping. The table's note uses minimal text so it is easier to read, and it is treated the same as the table's caption, which both are "general" descriptions/explanations/clarifications about the table's "general" content with nothing too specific about any one piece of data. The column and row headers are used to distinguish the differences in the grouping of data, which is why those are sticky and not the general caption and note that don't always need to be visible when scrolling. A user choosing not to read any of it is their own choice, and quite frankly irrelevant especially since the table's note uses minimal text for easier readability and all elements are displayed in a direction English readers are accustomed to (left-to-right, top-to-bottom). Leaving the table's note in the scrollable div has the added benefit of reducing the height of the entire template. Moving the note outside the scrollable div contributes to the original problem of displaying really tall tables (219 rows in this table) and related elements on a page without the scrollable div, which takes up several pages on a desktop browser.
I understand your preference is different, and please feel free to not restate or re-explain any opinions you have already explained since I have already read it both on this discussion and the other one. I don't care for long discussions that take too much time. I don't feel strongly about the placement of the table's note since moving it only adds one line to the template's height, which is why I moved it on those other tables to your preference. Now that I have some time, I can do the same on the other tables that use the new styles. Jroberson108 (talk) 03:34, 4 February 2022 (UTC)[reply]
@Timeshifter: If the usability issue is accidental scrolling, then the only thing I can think of to fix it with styles is to add a light gray border around the scrollable div to indicate where to start swipping. Otherwise, I would recommend adding a paragraph above the scrollable div inside those attributes as a summary or analysis of the table's content and leave the explanatory note inside the scrollable div. I would also recommend moving the VTE links above the paragraph as a visual indicator of where the template starts. Jroberson108 (talk) 12:35, 4 February 2022 (UTC)[reply]
@Timeshifter: I adjusted the markup so the attributes are on the parent element. This will make it easier for you or others to move/add content inside those attributes and above the scrollable div. Try to maintain the same indenting on the HTML tags/elements (two spaces) so visually it is easier to identify issues. More on indenting HTML. Jroberson108 (talk) 13:41, 4 February 2022 (UTC)[reply]

Jroberson108. Am I correct in assuming that the accessibility problem has been solved with this template, even though the note is above the scrolling part?:

And the reason it works is because the note is below the aria div and above the covid19-wrapper div? If so, I assume I can move the note up in this template since it now has the same order after this diff?:

--Timeshifter (talk) 15:25, 4 February 2022 (UTC)[reply]

@Timeshifter: Correct. That is what I explained in my previous post. Jroberson108 (talk) 15:33, 4 February 2022 (UTC)[reply]
A general note since this is related and recent. To accommodate this
request to relocate the expand/collapse links outside/above the scrollable div, the styles and markup have been restructured. In summary, the "covid19-wrapper" class was renamed to "covid19-container" and moved with "id" to contain all content, and a new "scroll-container" class was added to contain the scrollable content. More details found on that request. Jroberson108 (talk) 00:57, 5 February 2022 (UTC)[reply
]