Template talk:COVID-19 pandemic death rates by country

Latest comment: 2 years ago by Jroberson108 in topic Date of last update. Location

Change to template format

edit

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 August 10, 2024.
COVID-19 pandemic cases and mortality by country[1]
Country Deaths / million Deaths Cases
World[a] 867 7,056,095 775,829,432
Peru 6,452 220,975 4,526,977
Bulgaria 5,729 38,700 1,329,731
North Macedonia 5,475 9,978 350,808
Bosnia and Herzegovina 5,183 16,392 403,666
Hungary 5,071 49,053 2,230,657
Croatia 4,841 18,752 1,317,144
Slovenia 4,756 10,078 1,356,433
Georgia 4,504 17,150 1,863,615
Montenegro 4,159 2,654 251,280
Czech Republic 4,056 43,508 4,761,348
Moldova 4,037 12,243 636,777
Latvia 3,996 7,475 977,765
Greece 3,905 39,215 5,667,848
Slovakia 3,856 21,226 1,877,940
San Marino 3,749 126 25,292
Romania 3,620 68,819 3,536,986
United States 3,450 1,192,328 103,436,829
Lithuania 3,433 9,810 1,368,548
United Kingdom 3,355 232,112 24,971,207
Italy 3,325 197,301 26,774,728
Brazil 3,310 702,116 37,511,921
Martinique 3,218 1,104 230,354
Chile 3,172 62,730 5,401,026
Poland 3,134 120,722 6,668,336
Armenia 2,952 8,777 452,273
Belgium 2,924 34,339 4,871,551
Trinidad and Tobago 2,911 4,390 191,496
Ukraine 2,896 109,920 5,532,606
Gibraltar 2,867 113 20,550
Paraguay 2,866 19,880 735,759
Argentina 2,859 130,686 10,113,717
European Union[b] 2,805 1,262,824 185,801,974
Russia 2,785 403,178 24,260,951
Portugal 2,758 28,759 5,663,071
Guadeloupe 2,722 1,021 203,235
Aruba 2,701 292 44,224
Colombia 2,696 142,727 6,390,900
Serbia 2,681 18,057 2,583,470
France 2,603 168,091 38,997,490
Sweden 2,579 27,370 2,754,551
Mexico 2,554 334,537 7,618,633
Bermuda 2,552 165 18,860
Spain 2,543 121,852 13,980,340
Guam 2,495 419 52,287
Austria 2,470 22,534 6,082,429
Tunisia 2,395 29,423 1,153,361
French Polynesia 2,306 650 79,340
Saint Lucia 2,280 410 30,271
Uruguay 2,268 7,682 1,041,329
Liechtenstein 2,229 89 21,587
Suriname 2,214 1,406 82,501
Estonia 2,205 2,998 610,471
Sint Maarten 2,119 92 11,051
Bahamas 2,115 849 39,127
Barbados 2,099 593 108,525
Germany 2,070 174,979 38,437,756
Finland 2,041 11,466 1,499,712
Grenada 2,030 238 19,693
Ecuador 1,986 36,050 1,077,288
Andorra 1,938 159 48,015
Panama 1,935 8,748 1,044,821
Kosovo 1,907 3,212 274,279
Lebanon 1,884 10,947 1,239,904
Republic of Ireland 1,849 9,726 1,749,357
Puerto Rico 1,831 5,938 1,252,713
Costa Rica 1,826 9,372 1,234,701
Montserrat 1,813 8 1,403
Bolivia 1,801 22,387 1,212,145
Hong Kong 1,798 13,466 2,876,106
Collectivity of Saint Martin 1,764 46 12,324
Monaco 1,734 67 17,181
Malta 1,705 921 122,716
Belize 1,647 688 71,414
Curaçao 1,644 305 45,883
Denmark 1,621 9,693 3,435,679
British Virgin Islands 1,619 64 7,557
Iran 1,602 146,837 7,627,863
South Africa 1,601 102,595 4,072,763
Switzerland 1,587 14,170 4,457,441
Guyana 1,565 1,302 74,439
Antigua and Barbuda 1,556 146 9,106
United States Virgin Islands 1,555 132 25,389
Jersey 1,550 161 66,391
Luxembourg 1,484 1,000 393,352
Canada 1,390 55,282 4,819,017
Isle of Man 1,378 116 38,008
Namibia 1,353 4,108 172,532
Israel 1,352 12,707 4,841,558
French Guiana 1,336 413 98,041
Caribbean Netherlands 1,333 41 11,922
Seychelles 1,316 172 51,790
Albania 1,291 3,605 335,047
Jamaica 1,271 3,611 157,165
Netherlands 1,260 22,986 8,639,625
Saint Vincent and the Grenadines 1,232 124 9,674
Jordan 1,222 14,122 1,746,997
Turkey 1,159 101,419 17,004,718
Eswatini 1,147 1,427 75,356
Dominica 1,117 74 16,047
Botswana 1,109 2,801 330,696
Guatemala 1,096 20,203 1,250,370
New Caledonia 1,072 314 80,163
Cyprus 1,067 1,451 696,410
Malaysia 1,049 37,351 5,306,834
Réunion 1,047 921 494,595
Guernsey 1,041 67 35,326
Palestine 1,037 5,708 703,228
Norway 1,027 5,732 1,511,902
Honduras 1,025 11,114 472,893
Azerbaijan 1,001 10,353 835,694
Saint Kitts and Nevis 981 46 6,607
Bahrain 954 1,536 696,614
Fiji 952 885 69,047
Australia 944 25,236 11,861,161
Northern Mariana Islands 926 41 14,881
Kazakhstan 925 19,072 1,504,370
Oman 873 4,628 399,449
Libya 871 6,437 507,269
Turks and Caicos Islands 858 40 6,805
Mauritius 844 1,073 328,167
Anguilla 820 12 3,904
New Zealand 818 4,268 2,637,318
Wallis and Futuna 796 9 3,760
Cabo Verde 794 417 64,474
Belarus 786 7,118 994,037
Cuba 777 8,530 1,113,662
Taiwan 739 17,672 9,970,937
Sri Lanka 731 16,907 672,797
American Samoa 727 34 8,359
South Korea 694 35,934 34,571,873
El Salvador 667 4,230 201,916
Mongolia 614 2,136 1,011,489
Japan 603 74,694 33,803,572
Maldives 598 316 186,694
Philippines 576 66,864 4,140,383
Federated States of Micronesia 574 65 26,460
Mayotte 571 187 42,027
Indonesia 571 162,059 6,829,353
Palau 564 10 6,372
Iraq 550 25,375 2,465,545
Kuwait 520 2,570 667,290
Faroe Islands 504 28 34,658
Cayman Islands 496 37 31,472
Thailand 484 34,714 4,798,620
Iceland 472 186 210,347
Marshall Islands 453 17 16,252
Saint Barthélemy 442 5 5,507
Morocco 427 16,305 1,279,115
Vietnam 427 43,206 11,624,000
Nepal 405 12,031 1,003,450
Brunei 384 178 347,435
Dominican Republic 383 4,384 661,103
Greenland 375 21 11,971
India 367 533,623 45,041,435
Myanmar 357 19,494 642,859
Saint Pierre and Miquelon 354 2 3,426
Singapore 346 2,024 3,006,155
Zimbabwe 344 5,740 266,386
Sao Tome and Principe 339 80 6,771
Lesotho 303 709 36,138
Saudi Arabia 283 9,646 841,469
Solomon Islands 242 199 25,954
Qatar 225 690 514,524
Egypt 212 24,830 516,023
United Arab Emirates 212 2,349 1,067,030
Venezuela 206 5,856 552,695
Mauritania 192 997 63,872
Zambia 190 4,077 349,769
Afghanistan 187 7,998 235,214
Comoros 184 160 9,109
Kiribati 178 24 5,085
Macau 174 121 3,514
Cambodia 173 3,056 139,313
Bangladesh 169 29,499 2,051,308
Djibouti 161 189 15,690
Algeria 146 6,881 272,115
Cook Islands 145 2 7,344
Kyrgyzstan 142 1,024 88,953
Samoa 142 31 17,057
Gambia 134 372 12,627
Syria 127 3,163 57,423
Malawi 123 2,686 89,168
Pakistan 121 30,656 1,580,631
Gabon 120 307 49,051
Tonga 115 12 16,976
Senegal 106 1,971 89,457
Tuvalu 103 1 2,943
Rwanda 102 1,468 133,264
Kenya 100 5,689 344,105
Sudan 99 5,046 63,993
Timor-Leste 98 138 23,460
Equatorial Guinea 96 183 17,130
Laos 86 671 219,060
China[c] 86 122,289 99,371,132
Nauru 83 1 5,393
Guinea-Bissau 80 177 9,614
Haiti 72 860 34,298
Uganda 72 3,632 172,154
Somalia 71 1,361 27,334
Cameroon 67 1,974 125,242
Mozambique 64 2,252 233,842
Papua New Guinea 63 670 46,864
Republic of the Congo 61 389 25,227
Ethiopia 57 7,574 501,193
Yemen 53 2,159 11,945
Liberia 52 294 7,930
Angola 51 1,937 107,481
Madagascar 44 1,428 68,566
Vanuatu 42 14 12,019
Ghana 42 1,462 172,061
Nicaragua 35 245 16,183
Guinea 31 468 38,572
Togo 30 290 39,530
Mali 30 743 33,166
Eritrea 29 103 10,189
Uzbekistan 27 1,016 175,081
Bhutan 26 21 62,697
Ivory Coast 26 835 88,434
Central African Republic 21 113 15,441
Burkina Faso 16 400 22,139
Sierra Leone 14 125 7,979
Nigeria 13 3,155 267,188
Democratic Republic of the Congo 13 1,474 100,973
Tanzania 12 846 43,230
South Sudan 12 147 18,823
Tajikistan 11 125 17,786
Niger 11 315 9,518
Benin 11 163 28,036
Chad 9 194 7,702
Burundi 1 15 54,569
North Korea 0 6 1
Pitcairn Islands 4
Falkland Islands 1,923
Saint Helena, Ascension and Tristan da Cunha 2,166
Niue 1,074
Turkmenistan 0 0
Vatican City 0 26
Tokelau 0 80
  1. ^ Countries which do not report data for a column are not included in that column's world total.
  2. ^ Data on 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-08-10.

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

edit

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
edit

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

edit

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
edit

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

edit

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

edit

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

edit

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

edit

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

edit

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

edit

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