Jump to content

Template talk:Medical cases chart

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


Chart type

[edit]

@Ahecht and Alexiscoutinho: Any chance this can be changed to a line graph, like Google does it? Seems better to visualise this data. ProcrastinatingReader (talk) 11:06, 17 July 2021 (UTC)[reply]

@ProcrastinatingReader: No. {{Graph:Chart}} already does it. This template/module is intended to be a hybrid between a bar chart and a table. There are some planned future upgrades which will improve the visualization though, like being able to toggle between cumulative and new counts. Alexiscoutinho (talk) 16:57, 17 July 2021 (UTC)[reply]

Dual selection leads to hiding of selected dates

[edit]

Selection by last 15 days and another selector (selection of same dates by two selectors) leads to hiding these lines. As I understood it, this should be targeted at some time. Is there some work in progress? Otherwise I might take a look myself. If so, a few hints where to find implementation (I think somewhere in js) might help. -- Kohraa Mondel (talk) 17:52, 16 August 2021 (UTC)[reply]

@Kohraa Mondel: I halted my work on #7 of the #To Do list to rewrite this module as an object-oriented one. However, before that, I wanted to create some basic Lua types and a proper Table class for Module:Bar box and consequently this module. Unfortunately, creating extensive test cases became quite exhausting so I've paused for a while now. Fortunately all this stuff is not necessary to fix the issue you mentioned. That linked Phabricator task has the latest development. After writing it, I think I even thought that a third toggle class would be ideal, but I can't quite remember what I wanted right now. Unfortunately the task is pretty dead. I thought about contacting matmarex after I made my final changes. If our attempt fails there, I think it would be good if we try to implement these toggles here at Wikipedia to test and make their use widespread. This would be done via a snippet. My JS sandbox has the required 'unmaker' function to implement these new toggles here at Wikipedia. Alexiscoutinho (talk) 03:43, 18 August 2021 (UTC)[reply]

Division by zero

[edit]

the line

local divisor = (total[1] + total[2] + total[3] + total[4] + total[5]) / (args.barwidth - 5) --should be -3 if borders didn't go inward

can produce the value 0. eg Template:COVID-19_pandemic_data/Kiribati_medical_cases_chart

and later on this 'divisor' (as the name implies) is used in _customBarStacked

Is a 'nan' or 'inf' appropriate? A possible change is to add

if divisor == 0 then divisor = 1 end

Desb42 (talk) 11:09, 11 December 2021 (UTC)[reply]

@Desb42: It's not division by 0, it's the numerator that can be 0 if data is input incorrectly (the last date has ;0;0;0 which is wrong as these numbers are cumulative). The proper fix would be to raise an error in such cases. Alexiscoutinho (talk) 20:04, 11 December 2021 (UTC)[reply]
@Alexiscoutinho: I am confused. A division takes place on line 225
barargs[i+2] = args[i+1] / args.divisor
args.divisor is clearly a denominator (and in the example quoted is zero); hence a division by zero
@Desb42: I get what you mean now, but the solution is still the same: not letting the sum of the total[i]s be 0 or, even better, enforce that data monotonically increases. However, when inputting daily new data (not cumulative) is supported, this condition/requirement will need to be dropped. Alexiscoutinho (talk) 17:10, 13 December 2021 (UTC)[reply]

Sticking numbers

[edit]
Resolved

Hello. The numbers have reached over tens of millions for the German chart and therefore they appear very sticky to the bracketed numbers.

  • The very sticky German chart right now: [1]
    • With a monospaced typeface appear on top of each other: [2]
  • The American chart as a comparison. Notice the breathing room between numbers: [3]
    • With a monospaced typeface, still well spaced: [4]

I tried using the phrase |numwidth= as indicated in the usage, but that failed to make a difference. --Mahmudmasri (talk) 11:02, 11 February 2022 (UTC)[reply]

See Germany medical cases chart#Sticking numbers. Alexiscoutinho (talk) 15:13, 13 February 2022 (UTC)[reply]

Aggregation options to help manage WP:PEIS

[edit]

Articles with COVID-19 cases charts are starting to exceed PEIS limits from sheer volume of data. There are other ways to reduce PEIS (I just did so for a couple articles) but as more data keeps getting added, the problem will ultimately have to be addressed here (or by another template), otherwise editors may have to resort to manually replacing their daily data with weekly or monthly aggregates. To avoid having to discard existing fine-grained daily data, perhaps this template could provide an option to aggregate data for display by month or epidemiological week, |aggregate=month or |aggregate=epiweek, with lastest entry being partial month/week-to-date. duration would indicate the number of most recent month/week entries initially displayed.

An added benefit of such approach is to allow a single country's {{COVID-19 pandemic data}} template to support displaying an aggregated version of the chart on the main "COVID-19 in <Country>" articles while full daily numbers are shown on another page such as "COVID-19 statistics for <Country>" ——2406:3003:2077:1E60:D59D:E6EC:AEA9:4652 (talk) 19:51, 17 June 2022 (UTC)[reply]