Difference between revisions of "Module:Medical cases data/doc"
blackwiki>WOSlinker m (change source to syntaxhighlight) |
blackwiki>Mxn |
||
| Line 20: | Line 20: | ||
== Configuration == | == Configuration == | ||
| + | [https://w.wiki/Z7E Run this Wikidata Query Service query] to obtain a list of localized outbreaks to add to the <code>regions</code> property in the table. | ||
| + | |||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
return { | return { | ||
| Line 27: | Line 29: | ||
regionNamePattern = "(.+) County", -- Naming pattern for regions, applied to each region's item's label to display a short name in first column; see [[mw:Extension:Scribunto/Lua reference manual#Patterns]] | regionNamePattern = "(.+) County", -- Naming pattern for regions, applied to each region's item's label to display a short name in first column; see [[mw:Extension:Scribunto/Lua reference manual#Patterns]] | ||
populationDate = "2020-01-01", -- Date of the population figures used to calculate per-capita infection rates | populationDate = "2020-01-01", -- Date of the population figures used to calculate per-capita infection rates | ||
| − | + | regions = { | |
| − | -- | + | -- Add a table for each region's outbreak |
| − | + | { | |
| − | + | -- QID of the outbreak | |
| − | + | entity = "Q94259368", | |
| − | + | -- If there is tabular data for the outbreak, specify any column names that differ from the defaults | |
| − | + | columns = {cases = "AC_CumulCases", deaths = "AC_CumulDeaths"}, | |
| + | -- Optional footnote for the region as wikitext | ||
| + | note = "Including cases in the City of Berkeley, which are reported by the Berkeley Public Health Division.", | ||
}, | }, | ||
| − | |||
| − | |||
| − | |||
| − | |||
}, | }, | ||
columnNotes = { | columnNotes = { | ||
Revision as of 18:24, 9 August 2020
| 26x26px | This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome. |
This module inserts charts and maps of medical cases related to a pandemic, broken down by subregions.
caseTable
Inserts a table of cases and deaths by region.
Usage: {{#invoke:Medical cases data|caseTable|config=Configuration}}
Lua error in Module:Medical_cases_data at line 64: attempt to index field 'wikibase' (a nil value).
map
Inserts an interactive map of cases and deaths by region.
Usage: {{#invoke:Medical cases data|map|config=Configuration|frameWidth=Frame width in pixels|frameHeight=Frame height in pixels|caption=Caption as wikitext}}
Lua error in Module:Medical_cases_data at line 64: attempt to index field 'wikibase' (a nil value).
Configuration
Run this Wikidata Query Service query to obtain a list of localized outbreaks to add to the regions property in the table.
return {
caption = "Cases by county", -- Table or map caption as wikitext
outbreakItem = "Q94050008", -- QID of the Wikidata item representing the
regionTerm = "Counties", -- Term for each region, used as the first column's header
regionNamePattern = "(.+) County", -- Naming pattern for regions, applied to each region's item's label to display a short name in first column; see [[mw:Extension:Scribunto/Lua reference manual#Patterns]]
populationDate = "2020-01-01", -- Date of the population figures used to calculate per-capita infection rates
regions = {
-- Add a table for each region's outbreak
{
-- QID of the outbreak
entity = "Q94259368",
-- If there is tabular data for the outbreak, specify any column names that differ from the defaults
columns = {cases = "AC_CumulCases", deaths = "AC_CumulDeaths"},
-- Optional footnote for the region as wikitext
note = "Including cases in the City of Berkeley, which are reported by the Berkeley Public Health Division.",
},
},
columnNotes = {
cases = "Cumulative cases reported by each county's health department.", -- (Optional) Footnote for the "Cases" column as wikitext
recoveries = "Counties differ in what they consider to be a recovery.", -- (Optional) Footnote for the "Recoveries" column as wikitext
deaths = "Includes suspected cases.", -- (Optional) Footnote for the "Deaths" column as wikitext
}
}
Available configurations