WikiProject Medicine | (Rated Template-class) | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
To Do list
- Implement wrapper to automatically pass repetitive parameters to
{{Medical cases chart/Row}}
; Done here - Implement automatic
divisor
calculation; Done here - Revamp (month) toggles with JavaSript to decrease intersections of sets mess; Not done
- Implement automatic
numwidth
allocation; Not done - Implement automatic absolute or relative change calculation; Not done
- Implement custom bar ordering and display; Not done
- Implement smart bar divisor/"zoom in" based on the active time period toggles and visible bars; Not done
- Add support for numbered parameters inside the
data
string. Not done
Mobile view
@Alexiscoutinho: There seems to be a problem with the mobile view of this template. —hueman1 (talk • contributions) 10:43, 13 March 2020 (UTC)
- Sorry, it turns out that this template {{2019–20 coronavirus pandemic data/Philippines medical cases chart}} has the problem. —hueman1 (talk • contributions) 12:06, 13 March 2020 (UTC)
I'm seeing issues with mobile view too. e.g. {{2019–20 coronavirus pandemic data/New Zealand medical cases chart}}. Should we be setting a smaller "barwidth" so that it renders properly on mobile? Something else?OceanKiwi (talk) 03:42, 5 April 2020 (UTC)
Column Order
I would like to propose that the column order of this chart be changed. For evaluation of the outbreak dynamic the base of existing cases is the most important thing to visualize. Deaths are important but the growth of deaths does not influence the outbreak dynamic, which is the most important thing to study. So I propose that the column order be changed to
- existing cases
- recoveries
- deaths
or if you want
- existing cases
- deaths
- recoveries
But anyway be able to see those existing cases, and how the slope is developing.
I realize that this change would impact people enter the data and it would be a huge effort to make everyone change the column order. So I propose some way of making this template smarter so that the template would just render the column order differently. Or perhaps it could even be switchable by each user at time of viewing (JavaScript).
Where are these templates actually coded? Gschadow (talk) 21:50, 13 March 2020 (UTC)
- Click 'Edit source' on the template pages. If there are only two alternating orders, then I don't think JavaScript is needed. However, the same JavaScript I plan on using or coding to fully implement the month buttons could be used to switch between order schemes. If more than one order are to be available, then changing all country charts won't be necessary. How would you propose to order the 4th and 5th classifications? Finally, consensus would only need to be reached on the default order, which would be the only one available on mobile as it doesn't support collapsing. Alexiscoutinho (talk) 23:22, 13 March 2020 (UTC)
- Thank you! I still can't find 'Edit source' on the Template:Medical_cases_chart page. As to your question about the other categories: (4) estimated, (5) both, I haven't seen those in action. I am assuming "Estimated" should really be "Estimated in addition to confirmed" and a "Both" category seems to be a very bad idea in the first place. If anything in addition I would put a collapsible "Suspected" category instead of that "Both" thing. Then the order must be:
- Confirmed ongoing cases
- Estimated additional ongoing cases (collapsible)
- Suspected cases (collapsible, collapsed by default)
- Deaths
- Recoveries
- You can switch Deaths and Recoveries if you want, but it won't matter much. Looking at deaths as a curve is always going to be drowned out by the huge number of ongoing cases and recoveries, even if the death rate was 10% or, God forbid, 30%. So the alignment of deaths on a straight line isn't really so important. IMO sandwiching deaths before recoveries makes sense from a time line perspective: you will see deaths before you see recoveries. Gschadow (talk) 15:54, 14 March 2020 (UTC)
- And thinking a bit more about the order, another thing that would make sense is to go strictly in the order in which the process would flow, and adding additional categories that might make sense:
- Suspected cases (collapsible, collapsed by default)
- Suspected, tested, ruled out (collapsible, collapsed by default)
- Estimated, actual cases, minus the confirmed ones (collapsible, collapsed by default)
- Confirmed, ongoing cases, not known to be relapses
- Confirmed, ongoing cases, relapse, they should be subtracted from the recoveries.
- Recoveries, without known relapses.
- Deaths
- Now that I'm thinking of relapses, it makes sense to push Deaths over to the end of the bar. That way a relapse category could be nicely shown between existing cases and recoveries so the reader can think of them either way as they wish. Gschadow (talk) 16:22, 14 March 2020 (UTC)
- And thinking a bit more about the order, another thing that would make sense is to go strictly in the order in which the process would flow, and adding additional categories that might make sense:
- Thank you! I still can't find 'Edit source' on the Template:Medical_cases_chart page. As to your question about the other categories: (4) estimated, (5) both, I haven't seen those in action. I am assuming "Estimated" should really be "Estimated in addition to confirmed" and a "Both" category seems to be a very bad idea in the first place. If anything in addition I would put a collapsible "Suspected" category instead of that "Both" thing. Then the order must be:
- Firstly, bruh... ; check Help:Template for information on templates. So anyways, what I meant by 4th and 5th classification was more generic than what you thought. That example I made was just a random thing to show the syntax. A proper example that uses those two classifications is the Chinese chart which is now embedded in the documentation. Check February and tell me what order you propose. I like the idea of collapsing individual categories though. It could be used to show zoomed in versions of a classification. For example, if the user choses just deaths, he could view just them, but with a different, bigger scale. Alexiscoutinho (talk) 02:35, 15 March 2020 (UTC)
Better explanation of numwidth?
My guess for t
is that t=thin, m=medium, w=wide, but n=narrow? meaning narrower than t? and d = dreadfully-wide? And are these widths of bars or of text numbers? Are they minimum, default or maximum widths?
Clarifications/answers would be best edited directly into the template description... Boud (talk) 23:19, 14 March 2020 (UTC)
- I explain that in the paragraph below the Rows syntax. But I can write a note pointing readers to that paragraph for more explanation. Alexiscoutinho (talk) 02:19, 15 March 2020 (UTC)
- Is this:
numwidth is a sequence of the initials of none, thin, medium, wide and default and it determines the width of each number in the data columns.
the explanation? Suppose we have two columns for total counts and percentage increase, which is what most of the SARS-CoV-2 charts are doing. My guess is that we want xx in this common case. Switching between 'nn' and 'ww' to me seems to affect not the numerals and percentage symbol, but rather the widths of the bar and the empty space to the right of the bars. So is the space after the widest bar considered to be "column 1" or "column 2"? Obviously, we have access to the code to see what's coded :), but I'm not the only one who's confused or lacks the time to sort this out... Boud (talk) 03:42, 16 March 2020 (UTC)
- Is this:
- I think examples will clear out this confusion. Alexiscoutinho (talk) 12:56, 16 March 2020 (UTC)
Line break in row
Any fix for this? Line break in Australian data for 15 March Fanx (talk) 19:51, 15 March 2020 (UTC)
- The graph was missing a factor property to adjust the size of the bars, which is now added (it also needs to be updated as the number of cases grows). Ideally the width should be managed automatically but it'll take some more advanced scripting to do so. I'll try to fix it later if I can. CheeseBuffet (talk) 23:09, 15 March 2020 (UTC)
- @CheeseBuffet: It's implemented now. The Chinese chart already has it. Alexiscoutinho (talk) 20:21, 26 March 2020 (UTC)
Possible rename of parameter 'factor'
Either factor should be renamed to divisor, or the script should be converted to make factor into a factor rather than a divisor, because using the inverse word to what is meant is confusing. :)
However, because this affects many pages, so it would have to be quickly edited in all the pages using it, or there would have to be a transitionary period during which factor is deprecated.
In the long term, this would be worth it to reduce confusion. There are still many SARS-CoV-2 country pages using stacked bar or no medical cases chart at all, so fixing it now might be better than later. Boud (talk) 03:58, 16 March 2020 (UTC)
(BTW, excellent initiative and congratulations to whoever started this generic epidemic medical cases template. A few bugs don't invalidate the work. :)) Boud (talk) 03:58, 16 March 2020 (UTC)
- Thanks! I'll create an alternate parameter
divisor
, update the charts usingfactor
and then remove it altogether. Alexiscoutinho (talk) 13:10, 16 March 2020 (UTC)
Alignment
Is it possible to customize the alignment of this template @Alexiscoutinho:? See 2020 coronavirus pandemic in South Korea and 2020 coronavirus pandemic in the Philippines where there is an awkward out of place whitespace left of the template. This issue could be fixed if the table could be made centered align.Hariboneagle927 (talk) 04:16, 16 March 2020 (UTC)
- It is already centered. If you are talking about the whitespace left of the dates, then it could be altered in {{Bar stacked}}. I haven't touched more there because I wanted to raise a consensus across all bar templates in Template_talk:Bar_box#Consensus_about_paddings_and_alignments, but nobody saw it. However, while consensus is not reached, we can do whatever we want with {{Bar stacked}}. Do you prefer padding scheme C, which removes all double paddings? Alexiscoutinho (talk) 12:45, 16 March 2020 (UTC)
- In my Browser I see a similar problem in the site about coronavirus in Italy. The number of deaths in round brackets (I suppose the 10. argument in Template:Medical cases chart/Row) appears in two rows. It's therefore difficult to read the numbers (they digits of ONE number are shown in TWO rows). The whole structure of the templates is too complicate for me, to try to find a solution :-) Yomomo (talk) 11:43, 18 March 2020 (UTC)
- It's because they put two numbers in the slot of one and, even with the "xxxw" (wide) numwidth, it doesn't fit and wraps into two rows. When I have the opportunity, I'll tell them to pick only one change for deaths. Alexiscoutinho (talk) 08:21, 19 March 2020 (UTC)
Hover to show numbers
Can anyone make it such that if you hover over the bars, it shows their width? If it were done, it would mean that actual numbers would be visible as well as just graphical data, which is useful for large epidemics, etc., where very large figures are involved. I do not know how to do it myself, but hope that it might be possible and thought the idea worth airing. WT79 The Engineer (talk) 21:26, 18 March 2020 (UTC)
- That's a great idea and it can be easily done with the
title
attribute! Alexiscoutinho (talk) 08:39, 19 March 2020 (UTC)
- @WT79 The Engineer: DONE. Is this what you expected? Alexiscoutinho (talk) 04:08, 21 March 2020 (UTC)
- @Alexiscountinho: Can't see any difference. WT79 The Engineer (talk) 10:37, 21 March 2020 (UTC)
- @WT79 The Engineer: Are you sure? Hover over the bars of the Applied examples' charts in the doc. Alexiscoutinho (talk) 21:42, 21 March 2020 (UTC)
- @Alexiscountinho: Thanks – working now. Yes, that was what I was thinking of – thank you. WT79 The Engineer (talk) 22:39, 21 March 2020 (UTC)
- One further thought – would it be possible to have it such that it gave a descriptor as well as just a raw number? For example, it could be that 143 people have died, so hovering over the 'deaths' bar would show you '143 deaths' not just '143'. Would this be possible? WT79 The Engineer (talk) 23:20, 27 March 2020 (UTC)
- But it would clunky for classifications with long names, like "12289 clinically diagnosed (C.D.)". Alexiscoutinho (talk) 13:29, 28 March 2020 (UTC)
Support for DMY dates
Is there any chance of adding support for the most common date format rather than just YMD & MDY? Fanx (talk) 00:46, 22 March 2020 (UTC)
- The date "can be in any format accepted by PHP's strtotime() function". But don't make it too big, though, as it has to fit in a limited space allocated to the first column. Alexiscoutinho (talk) 17:35, 22 March 2020 (UTC)
- The date should be able to be in any format, depending on which country the epidemic is in. WT79 The Engineer (talk) 17:53, 22 March 2020 (UTC)
By the way, DMY is already supported, not MDY:Alexiscoutinho (talk) 19:52, 22 March 2020 (UTC){{#time:M|03-04-2020}}
returns Apr.
- This is simply not true, and to use an example date earlier than 13/M/Y is rather pointless. DMY dates are normally formatted as 29/02/2020 - not as 29-02-2020 ... dashed dates work, slashed dates don't - except in the case of MDY dates (they are supported, in spite of your claim) which render as 02/29/2020 but not as 02-29-2020. Also, MDY dates work with dropped zeroes (2/29/2020) but DMY dates (29/2/2020 or 29-2-2020) don't work. Instead of claiming dates are supported, please try testing for them first. BTW; demonstrating that the 3rd of April is indeed in April is less than useful. Fanx (talk) 00:51, 23 March 2020 (UTC)
- If you know so much, then you should have asked for the
{{#time:}}
function to support these date formats or to drop its use entirely. I don't think dropping the usage of{{#time:}}
in favor of "looks" is good enough. Firstly, because automatic month and time interval detection (for collapsing, which will eventualy be fully developed) won't work if only one parameter (this custom date) is given. Secondly, this template is in the English Wikipedia which is the most international, thus allowing for local date formatting would break the consistency I'm trying to achieve with this template and might confuse international readers who might not be aware of the local date formatting. Remember that the chart will be in English, thus the date should be English compatible. If you know how to make{{#time:}}
work with DMY without losing functionality I'll gladly listen. Alexiscoutinho (talk) 21:10, 24 March 2020 (UTC)
- If you know so much, then you should have asked for the
Column width
Is it possible to increase column width in order to be able to show the absolute difference in the number of cases/deaths AND the percentual increase next to the cases/death total numbers? At this time, when trying to show both of them the text wraps around and it messes up the look of the chart (especially for countries with large numbers, as Italy). Robotrandom (talk) 17:03, 22 March 2020 (UTC)
- I think it is inadequate to show 2 numbers inside the brackets. Remember: this is a chart, not a spreadsheet and we don't want to bloat it. Choose either absolute or relative change for each column. Also note that the chart now features "tooltips" on the bars so the user can hover over the death bars to see the number. Alexiscoutinho (talk) 17:28, 22 March 2020 (UTC)
I fixed the noinclude section for the documentation page /doc. It doesn't quite have the style of standard template documentation pages, so someone might want to find out what's missing.
But at least the documentation is easy to find now.
Chances are this documentation is out-of-date. Lots of pages are using it, so feel free to update it...
Boud (talk) 14:36, 25 March 2020 (UTC)
- The problem was with the include size. By turning the Applied examples' transclusions into links, the post expansion size drastically reduced. Alexiscoutinho (talk) 14:59, 26 March 2020 (UTC)
- It would have had to change someday anyways. However, we can probably get away with only one large template transclusion. But, it would have to use all features of the template, which I think none do right now. Alexiscoutinho (talk) 15:24, 26 March 2020 (UTC)
How do you figure out the percentage?
I was having trouble figure how you get pere net age of the number of deaths and cases added on the chart, can you give me and equation for it please? Rider0101 (talk) 20:16, 26 March 2020 (UTC)
- For increases I presume? Take new daily number & divide by yesterday's daily number then subtract 1 and multiply by 100. So if today's number is 1,178 and yesterday's was 950 then the percentage increase is 1178/950 = 1.24 ... 1.24-1.0 = 0.24 .... 100*0.24 = 24% Fanx (talk) 01:04, 1 April 2020 (UTC)
Problems with data= v. rows=
I'd like to switch to using data= for several reasons, but two problems remain unresolved: I can't place a non-breaking space, as the semicolon at the end of the html-escape will be interpreted as data field delimiter. And also using the notes template inside data= breaks. Any suggestions? -- Käptn Weltall (talk) 08:37, 31 March 2020 (UTC)
- What about {{nbsp}}? But, why would you need nbsp anyways? If it's to fit two numbers in the space of one, then I highly oppose it. I'm even thinking about removing this specific freedom in the future. On the other hand, about the notes template, which one are you having trouble with? The Italian chart has notes and they work fine... Alexiscoutinho (talk) 22:35, 1 April 2020 (UTC)
Is it possible to have a button saying "All"
Is it possible to have a button saying "All" (showing all data)? Christian75 (talk) 18:00, 4 April 2020 (UTC)
Anyone know why Template:Val breaks this template?
vs