Documentation icon คู่มือการใช้งานแม่แบบ[ดู] [แก้] [ประวัติ] [ล้างแคช]

คำอธิบาย แก้

This template should be used for all outbreak, epidemic and pandemic medical cases charts based on {{Bar box}} to maintain consistency. It displays horizontal bars for up to 5 different classifications of cases for each valid date or interval. It offers two columns to make numbers explicit and to show relative or absolute changes. It also uses a sophisticated toggling system to control the visualization of data rows across many months or years. It is designed to be flexible, but still standardizes some parts of the chart. This template should be transcluded in other templates, NOT in article pages. Suggest features in the talk page or code them if they're neither controversial nor incompatibility prone.

การใช้งาน แก้

{{Medical cases chart
|float      = side of the page where the chart will be located (left|center|right|none) [optional, defaults to: right]

|barwidth   = width of the stacked bars area (thin|medium|wide|auto)                    [optional, defaults to: medium]
|numwidth   = max width of the numbers in the right columns (AA or AAAA)←(n|t|m|w|x|d)  [suggested, defaults to: mm; see info below]
|rowheight  = height of each bar in multiples of the text height                        [optional, defaults to: 1.6]

|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 the links of the {{navbar}}                 [see info below]

|recoveries = whether to display recoveries in the legend (yesno)                       [optional, defaults to: yes]
|reclbl     = alternate label for the 2nd cases classification                          [optional, defaults to: Recoveries]
|altlbl1    = alternate label for the 3rd cases classification (hide)                   [optional, defaults to: Active cases]
|altlbl2    = alternate label for the 4th cases classification                          [optional]
|altlbl3    = alternate label for the 5th cases classification                          [optional]

|collapsible= whether rows are collapsible (forced no if days span <= duration) (yesno) [optional, defaults to: 'auto']
|duration   = span of last days to initially display to control default chart height    [optional, defaults to: 15]
|nooverlap  = whether to prevent the last month's toggle from overlapping, in days,     [optional, defaults to: no; see info below]
              with the "Last XX days" toggle (yesno)
|right1     = heading of the 1st data column                                            [optional, defaults to: # of cases]
|right1data = cases classification of the 1st column for auto filling (1-5|alttot1-2)   [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 = cases classification of the 2nd column for auto filling (1-5|alttot1-2)   [optional, defaults to: 1, if right2 is "# of deaths"]
|changetype2= calculate percent change (%), absolute change (#) or onlypercent (p|a|o)  [optional, defaults to: percent]
|changetype = applies to both 1st and 2nd change columns                                [optional]

|datapage   = tabular data page from Commons to scrape cases data from                  [optional; see its talk section and module]
|data       = data lines for each valid date or interval                                [suggested; see Data's syntax]

|caption    = caption under the chart                                                   [suggested]
}}

It may be desirable to make a specific outbreak chart have different widths depending on the page it is displayed. The barwidth parameter can be used to achieve this. For example, |barwidth={{{barwidth|wide}}} will display the chart wide in the template page itself, but will allow different widths when the outbreak template is transcluded with this parameter in article pages.

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, |numwidth=mw sets the right1 value column to medium and the right1 change column to wide. |numwidth=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.

The {{navbar}} links are contructed like this: outbreak data/[[location3/]location2/]*location medical cases chart. outbreak may be more descriptive than disease to avoid page name collisions. So, for example, COVID-19 charts have |outbreak=COVID-19 pandemic. location has "the " internally removed and is capitalized to become *location.

By default, the "Last X days" button toggles days which intersect with those of the last months. This happens regardless of the state (activated or not) of the month buttons. In fact, due to limitations of custom collapsing, toggles are stateless (a workaround is used to simulate two 'states'). All in all, this can lead to situations where clicking one button causes unintuitive toggling like creating date gaps. nooverlap works around this issue by forcing the buttons of the last months to not overlap with the "Last X days" button. The result is usually a partial last month button, "Mon XX-XX", where XX are the first and last days of the month that the button affects. Extra info in the main bug discussion.

To display absolute change in the first column and percent change in the second column, set the following (AA represents any two allowed characters, # represents the classification number being shown, which should be the same for right1data and right2data):

|numwidth=AAnw
|right1data=#
|changetype1=a
|right2data=#
|changetype2=o

ข้อมูล แก้

The data parameter should be populated by a sequence of lines containing a different set of parameters separated by semicolons, ;.

|data=
แม่แบบ:Colored list
แม่แบบ:Colored list
...

All values are optional, and empty values can be represented by sequential semicolons (e.g. ;;). Omitting the date will treat the row as a date interval, unless the date can be automatically interpolated (for 1 day intervals). This is mostly done when no new cases are reported. Omitting a classification value makes a 0 width stacked bar and ommiting all values or the line itself is recommended to depict dates where no data is reported.

The expression for total in the 3rd cases classification has deaths and recoveries automatically subtracted from it. If a manual calculation of the number in that classification (generally active cases) is wanted, use alttot1. The same applies to the expression for total in the 5th cases 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 |right1=# of cases, and the 2nd column values will be automatically calculated if |right2=# 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 wanted for 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 the examples.

alttot1    = alternate expression for active cases (3rd cases classification)
alttot2    = alternate expression for number in the 5th cases classification
firstright1= whether a change in the first column is not applicable (n.a.) (yesno)
firstright2= whether a change in the second column is not applicable (n.a.) (yesno)
enddate    = end date of interval if automatic one causes incorrect toggling behavior [required if chart ends with interval]
note0      = note text post-fixed to the date, that should create a minimum space consuming object, like a note link, to avoid wrapping
note1      = like note0, only post-fixed to column 1
note2      = like note1, only post-fixed to column 2

ตัวอย่าง แก้

{{Medical cases chart
|float=center
|numwidth=mw

|disease=Green Flu
|location=Savannah|location2=Georgia|location3=United States
|outbreak=2009 Green Flu outbreak

|recoveries=n

|data=
2009-04-13;;;42;;;42;firstright1=y
2009-04-14;;;356;;;356;+748%
2009-04-15;;;1503;;;1,503;+322%
2009-04-16;57;;5915;;;5,915;+294%
2009-04-17;2000;;9500;;;~9,500;+60.6%
}}
ผู้ป่วย Green Flu ใน Savannah, Georgia, United States  ()
     เสียชีวิต        ่ป่วยกำลังรักษา
วันที่
# ผู้ป่วย
2009-04-13
42(n.a.)
2009-04-14
356(+748%)
2009-04-15
1,503(+322%)
2009-04-16
5,915(+294%)
2009-04-17
~9,500(+60.6%)
{{Medical cases chart
|barwidth=wide
|numwidth=mwwd
|rowheight=1.8

|pretitle=Approximate
|disease=Spanish Flu
|location=the World
|posttitle=(excluding Oceania)
|outbreak=1918-20 Spanish Flu pandemic

|altlbl1=Active confirmed
|altlbl2=Suspected
|altlbl3=Estimated

|collapsible=n

|right1=Confirmed cases
|right2=Including suspected and estimated cases

|data=
1918-03-10;2060-300;3000-800;6000;;;6000;firstright1=y
1918-07;12600;20000;40000;12000;;alttot2=(34000-15000-8700+40);40000;+500%;10500;firstright2=y
;12600;20000;40000;12000;;alttot2=(34000-15000-8700+40);40000;;10500
1919;100000;250000;;;1000000;;;1mi;+500k
}}
Approximate ผู้ป่วย Spanish Flu ใน the World (excluding Oceania)  ()
     เสียชีวิต        รักษาหาย        Active confirmed        Suspected        Estimated
วันที่
Confirmed cases
Including suspected and estimated cases
1918-03-10
6000(n.a.)
1918-07
40000(+500%) 10500(n.a.)
40000(=) 10500(=)
1919
1mi(+500k)
{{Medical cases chart
|numwidth=tttt

|disease=Ebola
|location=Guinea-Bissau
|outbreak=2014 EVD epidemic

|altlbl1=hide
|altlbl2=Moderate cases
|altlbl3=Severe cases (hospitalized)

|duration=5
|nooverlap=y

|right1=# of severe cases
|right1data=alttot2
|right2=# of deaths
|changetype=a

|data=
2014-01-01;;;;;;alttot2=1;;+1
2014-01-15;1;;;;;alttot2=1;;=;;+1
<!-- no data reported -->
2014-01-20;2;;;1;;alttot2=1;;=;;+1
<!-- no data reported -->note0={{efn|On Jan 21<sup>st</sup>, there was a national blackout that forced the data to be reported on the next day.}}
2014-01-22;2;;;2;;alttot2=2;;+1;;=
;2;;;2;;alttot2=2
;2;1;;1;;alttot2=2
2014-02-05;3;1;;1;;alttot2=1
;3;2;;;;alttot2=1;enddate=2014-03-01
;3;2;;1;;alttot2=1
2014-03-30;3;4;;;;alttot2=0;note1={{efn|On Mar 30<sup>th</sup>, new cases were reported just before the press conference, thus they weren't included in the official count.}}
2014-03-31;3;4;;2;;alttot2=1;;+1
2014-04-01;3;5;;4;;alttot2=2
2014-04-02;5;6;;5;;alttot2=3;note2={{efn|The death of a foreigner at a border crossing medical tent is under dispute if it should be included in Guinea-Bissau's count.}}
;5;8;;3;;alttot2=3;enddate=2014-04-04

|caption={{notelist}}
}}
ผู้ป่วย Ebola ใน Guinea-Bissau  ()
     เสียชีวิต        รักษาหาย        Moderate cases        Severe cases (hospitalized)
ม.ค.ม.ค.ก.พ.ก.พ.มี.ค. 1–30มี.ค. 1–30
5 วันล่าสุด5 วันล่าสุด
วันที่
# of severe cases
# of deaths
2014-01-01
1(+1)
2014-01-15
1(=) (+1)
2014-01-20
1(=) (+1)
2014-01-21[a]
2014-01-22
2(+1) (=)
2(=)
2(=)
2014-02-05
1(-1)
1(=)
1(=)
2014-03-30
0(-1)[b]
2014-03-31
1(+1)
2014-04-01
2(+1)
2014-04-02
3(+1) [c]
3(=)
  1. On Jan 21st, there was a national blackout that forced the data to be reported on the next day.
  2. On Mar 30th, new cases were reported just before the press conference, thus they weren't included in the official count.
  3. The death of a foreigner at a border crossing medical tent is under dispute if it should be included in Guinea-Bissau's count.

ตัวอย่างการประยุกต์ แก้

{{COVID-19 pandemic data/Mainland China medical cases chart}}

{{Medical cases chart
|numwidth=mmmw

|disease=COVID-19
|location=Mainland China
|outbreak=COVID-19 pandemic

|altlbl1=Tested
|altlbl2=Clinically diagnosed (C.D.)
|altlbl3=Tested or C.D.

|right1=Number of cases<br />(excluding C.D.)
|right2=Number of cases<br />(including C.D.)

|data=
...

|caption=
<div class="center" style="width:90%; margin-left:auto; margin-right:auto;"><small>...</small></div>
...
}}

ข้อมูลแม่แบบ แก้

Produces charts based on {{Bar box}} for outbreak, epidemic and pandemic medical cases.

พารามิเตอร์แม่แบบ[แก้ไขข้อมูลแม่แบบ]

แม่แบบนี้มีการจัดรูปแบบที่กำหนดเอง

พารามิเตอร์คำอธิบายชนิดสถานะ
Floatfloat

side of the page where the chart will be located (left|center|right|none)

ค่าปริยาย
right
สตริงเลือกได้
Bar widthbarwidth

width of the stacked bars area (thin|medium|wide|auto)

ค่าปริยาย
medium
สตริงเลือกได้
Number widthnumwidth

maximum width of the numbers in the right columns (AA or AAAA)←(n|t|m|w|x|d)

ค่าปริยาย
mm
ตัวอย่าง
mwnt
สตริงแนะนำ
Row heightrowheight

height of each bar in multiples of the text height

ค่าปริยาย
1.6
จำนวนเลือกได้
Pretitlepretitle

text at the beginning of the title

สตริงเลือกได้
Diseasedisease

name of the disease

ตัวอย่าง
COVID-19
สตริงจำเป็น
Locationlocation

location of the outbreak the chart is showing

ตัวอย่าง
the United States
สตริงจำเป็น
Location 2location2

broader location such as state/province or country

ตัวอย่าง
Maharashtra
สตริงเลือกได้
Location 3location3

broadest location such as country

ตัวอย่าง
India
สตริงเลือกได้
Post-titleposttitle

text at the end of the title

ตัวอย่าง
(including Greenland and the Faroe Islands)
สตริงเลือกได้
Outbreakoutbreak

name of the main outbreak for the links of the {{navbar}}

ตัวอย่าง
COVID-19 pandemic
สตริงจำเป็น
Recoveriesrecoveries

whether to display recoveries in the legend (yesno)

ค่าปริยาย
yes
ค่าอัตโนมัติ
n
ไม่ทราบชนิดเลือกได้
Recoveries labelreclbl

alternate label for the recoveries classification

ค่าปริยาย
Recoveries
สตริงเลือกได้
Alternate label 1altlbl1

alternate label for the third cases classification (hide)

ค่าปริยาย
Active cases
ตัวอย่าง
hide
สตริงเลือกได้
Alternate label 2altlbl2

alternate label for the fourth cases classification

ตัวอย่าง
Clinically diagnosed (C.D.)
สตริงเลือกได้
Alternate label 3altlbl3

alternate label for the fifth cases classification

ตัวอย่าง
Tested or C.D.
สตริงเลือกได้
Collapsiblecollapsible

whether the rows are collapsible (forced "no" if the days span <= Duration) (yesno)

ค่าปริยาย
internally determined
ค่าอัตโนมัติ
n
ไม่ทราบชนิดเลือกได้
Durationduration

span of last days to initially display to control the default chart height

ค่าปริยาย
15
จำนวนเลือกได้
No overlapnooverlap

whether to prevent the last month's toggle from overlapping, in days, with the "Last XX days" toggle (yesno)

ค่าปริยาย
no
ค่าอัตโนมัติ
y
ไม่ทราบชนิดเลือกได้
Right 1right1

heading of the first data column

ค่าปริยาย
# of cases
สตริงเลือกได้
Right 1 dataright1data

cases classification of the first column for auto filling (1-5|alttot1-2)

ค่าปริยาย
3 (if Right 1 is "# of cases")
ตัวอย่าง
alttot1
ไม่ทราบชนิดเลือกได้
Change type 1changetype1

whether to calculate percent change (%) or absolute change (#) (p|a)

ค่าปริยาย
percent
ค่าอัตโนมัติ
a
สตริงเลือกได้
Right 2right2

heading of the second data column

ค่าอัตโนมัติ
# of deaths
สตริงเลือกได้
Right 2 dataright2data

cases classification of the second column for auto filling (1-5|alttot1-2)

ค่าปริยาย
1 (if Right 2 is "# of deaths")
ตัวอย่าง
alttot2
ไม่ทราบชนิดเลือกได้
Change type 2changetype2

whether to calculate percent change (%), absolute change (#) or onlypercent (p|a|o)

ค่าปริยาย
percent
สตริงเลือกได้
Change typechangetype

applies to both first and second change columns

ค่าอัตโนมัติ
a
สตริงเลือกได้
Data pagedatapage

tabular data page from Commons to scrape cases data from

ตัวอย่าง
COVID-19 cases in Santa Clara County, California.tab
ไม่ทราบชนิดเลือกได้
Datadata

data lines for each valid date or interval (see Data's syntax)

ตัวอย่าง
2009-04-13;;;42;;;42;firstright1=y

2009-04-14;;;356;;;356;+748%

2009-04-15;;;1503;;;1,503;+322%
เนื้อหาแนะนำ
Captioncaption

caption under the chart

ตัวอย่าง
'''Sources:''' ...
เนื้อหาแนะนำ