Mall:Medical cases chart
- Selle malli dokumentatsioon on liidetud lehelt Mall:Medical cases chart/doc (redigeeri | ajalugu).
Malli tuleb tõlkida ja kohandada! |
Kasutus
[muuda lähteteksti]{{Medical cases chart |barwidth = width of the stacked bars area (thin|medium|wide) [optional, defaults to: medium] |numwidth = max width of the numbers in the right columns (AA or AAAA)<-(n|t|m|w|x|d)[optional, defaults to: mm, see below and examples] |rowheight = height of each bar, in multiples of the text height [optional, defaults to: 1.6] |float = on what side of the page should the chart be located (left|right|none) [optional, defaults to: right] |pretitle = text at the beginning of the title [optional] |disease = name of the disease |location = location of the outbreak the chart is showing |location2 = broader location such as state/province or country [optional] |location3 = broadest location such as country [optional] |posttitle = text at the end of the title [optional] |outbreak = name of the main outbreak (for link of the {{navbar}}) |recoveries = display recoveries in the legend (no|n|0) [optional, defaults to: yes] |reclbl = alternate label for the 2nd case classification [optional, defaults to: Recoveries] |altlbl1 = alternate label for the 3rd case classification [optional, defaults to: Cases] |altlbl2 = alternate label for the 4th case classification [optional] |altlbl3 = alternate label for the 5th case classification [optional] |togglesbar = HTML of the toggles bar to show/hide rows (use [optional] {WIP} {{Medical cases chart/Month toggle button}}) |right1 = heading of the 1st data column [optional, defaults to: # of cases] |right1data = case classification for the 1st column [optional, defaults to: 3 (if right1 is "# of cases")] |changetype1= calculate percent change (%) or absolute change (#) (p|a) [optional, defaults to: percent] |right2 = heading of the 2nd data column [optional] |right2data = case classification for the 2nd column [optional, defaults to: 1 (if right2 is "# of deaths")] |changetype2= calculate percent change (%), absolute change (#), or onlypercent (p|a|o)[optional, defaults to: percent] |divisor = manual override of the scaling divisor of the bars [optional, defaults to: auto] |collapsible= whether the rows are collapsible (yes|y|1) [optional, defaults to: no] {WIP} |data = data lines for each valid date (see Data's and Rows' syntax) |caption = caption under the chart [optional] }}
numwidth
is a sequence of the initials of none, thin, medium, wide, extra wide and default, and it determines the maximum width of each number in the data columns. Therefore, one should be chosen that minimizes the total width, but which doesn't make the numbers break/wrap on mobile view. Using 2 or 4 characters allocates one or two data columns, respectively. For example, mw
sets the right1 value column to medium and the right1 change column to wide. mwnt
sets the right1 value column to medium, the right1 change column to wide, the right2 value column to none, and the right2 change column to thin.
To display absolute change in the first column and percent change in the second column, set the following (AA represents any two characters, # represents the classification number you are showing, which should be the same for right1data
and right2data
):
|numwidth = AAnw |right1data = # |changetype1 = a |right2data = # |changetype2 = o
Data
[muuda lähteteksti]The |data=
parameter should be populated by a sequence of lines with a format similar to the rows'. The difference is that the parameter separator is the semicolon, ;
, and that repetitive parameters, like |divisor=
, |numwidth=
, and |collapsible=
, may be written only once in the body of {{Medical cases chart}}
. Using |data=
also allows the divisor to be calculated automatically if the parameter is omitted.
|data=date;deaths;2nd classification (recoveries);3rd classification (total or altlbl1);4th classification #;5th classification #;1st column #;1st column change;2nd column #;2nd column change;other parameters=values
date;deaths;2nd classification (recoveries);3rd classification (total or altlbl1);4th classification #;5th classification #;1st column #;1st column change;2nd column #;2nd column change;other parameters=values
...
All values are optional, and empty values can be represented by sequential semicolons (e.g. ;;
). Omitting the valid date will treat the row as a date jump, in which no new cases are reported.
The expression for total in the 3rd classification cases has deaths and recoveries automatically subtracted from it. If you want to manually calculate the number in that classification (generally active cases), use alttot1
. The same applies to the expression for total in 5th classification and alttot2
.
The 1st column #
, 1st column change
, 2nd column #
, and 2nd column change
values can be automatically calculated if omitted. The 1st column values will be automatically calculated if |right1=
is omitted or set to # of cases
, and the 2nd column values will be automatically calculated if |right2=
is set to # of deaths
. If |right1=
or |right2=
are set to other values, the columns can still be automatically calculated by setting |right1data=
and |right2data=
to the classification number you want to display in columns 1 and 2, respectively (e.g. 1
for deaths, 2
for recoveries, 3
for total, etc.). The changes in the first and second columns are automatically wrapped in parentheses.
The other parameters=values
can be any number of the parameters below and their values, separated by semicolons. See examples.
;alttot1 = ''alternate expression for active cases (3rd classification)'' ;alttot2 = ''alternate expression for number in 5th classification'' ;firstright1= ''whether a change in the first column is not applicable (n.a.)'' (yes|y|1) ;firstright2= ''whether a change in the second column is not applicable (n.a.)'' (yes|y|1) ;collapsed = ''manual override of the initial row state'' (yes|y|1) {WIP} ;id = ''manual override of the row id'' {WIP}
To convert from the old format, remove {{Medical cases chart/Row|
from the beginning and }}
from the end of the line, replace all pipes (|) with semicolons (;), and remove any |divisor=
, |numwidth=
, and |collapsible=
parameters from the end (and make sure they are listed in the main template at least once). For example:
{{Medical cases chart/Row|2020-04-15|1921||28059|||28,059|+1058||+4%|divisor=100|numwidth-mmnm}}
becomes
2020-04-15;1921;;28059;;;28,059;+1058;;+4%
/.../
[[Kategooria:]]