Difference between revisions of "Template:Historical populations/doc"
(→Usage) |
imported>Frietjes (→Two columns: add example) |
||
| (43 intermediate revisions by 26 users not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
| − | <!-- PLEASE ADD | + | {{lua|Module:Historical populations}} |
| + | <!-- PLEASE ADD CATEGORY LINKS AT THE END OF THIS PAGE --> | ||
| − | '''Template:Historical populations''' is used as an information box on pages, showing each census year with a population, and a percent gain/loss comparison. It is intended to combine the functionalities of two existing templates, [[Template: | + | '''Template:Historical populations''' is used as an information box on pages, showing each census year with a population, and a percent gain/loss comparison. It is intended to combine the functionalities of two existing templates, [[Template:US Census population]] and [[Template:Histpop]], the former of which is specialized for the United States, and the latter of which lacks many features of the former. |
| − | + | ==Usage== | |
| − | This template takes a series of parameters in the form <code>|date |population</code>. This template does not require any more than that. This template will take between 0 and | + | This template takes a series of parameters in the form <code>|date |population</code>. This template does not require any more than that. This template will take between 0 and 50 entries; any more will be ignored. |
| − | + | ===Complete template=== | |
<pre> | <pre> | ||
{{Historical populations | {{Historical populations | ||
| Line 13: | Line 14: | ||
|type = | |type = | ||
|align = | |align = | ||
| + | |direction = | ||
|width = | |width = | ||
|state = | |state = | ||
|shading = | |shading = | ||
| + | |pop_name = | ||
|percentages = | |percentages = | ||
|footnote = | |footnote = | ||
| + | |source = | ||
|date |population | |date |population | ||
|date |population | |date |population | ||
| Line 28: | Line 32: | ||
</pre> | </pre> | ||
| − | + | ===Parameters=== | |
{|class="wikitable" | {|class="wikitable" | ||
| − | !Parameter | + | |+Template parameters for Template:Historical populations |
| − | !Description | + | !scope="col"|Parameter |
| + | !scope="col"|Description | ||
|- | |- | ||
| − | |date | + | !scope="row"|date{{sub|''n''}} |
|Ideally, a four-digit year, but can be anything. Usually a multiple of 10, but does not have to be. | |Ideally, a four-digit year, but can be anything. Usually a multiple of 10, but does not have to be. | ||
|- | |- | ||
| − | |population | + | !scope="row"|population{{sub|''n''}} |
|The population of row ''n''. Must be a plain number with no formatting (commas, etc.). | |The population of row ''n''. Must be a plain number with no formatting (commas, etc.). | ||
|- | |- | ||
| − | |title | + | !scope="row"|title |
|''Optional.'' The title of the table. | |''Optional.'' The title of the table. | ||
| − | * | + | * {{code|Historical population}} ('''Default''') |
|- | |- | ||
| − | |type | + | !scope="row"|type |
| − | |''Optional.'' This is designed to add functionality specific to different regions or types of information. Currently the only value that does anything is | + | |''Optional.'' This is designed to add functionality specific to different regions or types of information. Currently the only value that does anything is {{code|US}} (or the obsolescent {{code|USA}}). |
| − | * | + | * {{code|none}} ('''Default''') |
| − | * | + | * {{code|US}} Will link each year to the relevant [[United States Census]] entry. Years that do not have entries will be left alone. |
Please think of more ideas for this feature. | Please think of more ideas for this feature. | ||
|- | |- | ||
| − | |align | + | !scope="row"|align |
|''Optional.'' The alignment of the table on the page. | |''Optional.'' The alignment of the table on the page. | ||
| − | * | + | * {{code|right}} ('''Default''') |
| − | * | + | * {{code|left}} |
| + | * {{code|center}} | ||
| + | * {{code|none}} | ||
|- | |- | ||
| − | | | + | !scope="row"|direction |
| − | |''Optional.'' | + | |''Optional.'' How the box is arranged on the page. |
| − | * | + | * {{code|vertical}} ('''Default''') |
| + | * {{code|horizontal}} | ||
|- | |- | ||
| − | | | + | !scope="row"|clear |
| − | |''Optional.'' | + | |''Optional.'' Use to clear any left or right floating elements nearby. |
| − | * | + | * {{code|right}} ('''Default''' if align = right) |
| − | * | + | * {{code|left}} ('''Default''' if align = left) |
| + | * {{code|none}} ('''Default''' if align = none) | ||
| + | * {{code|both}} | ||
|- | |- | ||
| − | |shading | + | !scope="row"|width |
| + | |''Optional.'' The width of the table (or of each block of columns). Can be any valid CSS {{code|width}} value. | ||
| + | * {{code|15em}} ('''Default''') | ||
| + | |- | ||
| + | !scope="row"|state | ||
| + | |''Optional.'' The collapsed state of the table. Set it to {{code|collapsed}} to collapse the table by default. | ||
| + | * {{code|none}} ('''Default''') | ||
| + | * {{code|collapsed}} | ||
| + | |- | ||
| + | !scope="row"|shading | ||
|''Optional.'' Whether to mark off every five entries with a line, to facilitate reading. This works best with large, linear lists (such as the US Census, which has been taken every 10 years for over 200 years), but should probably be turned off for small or irregular lists (e.g., less than 10 entries), where it could be confusing. | |''Optional.'' Whether to mark off every five entries with a line, to facilitate reading. This works best with large, linear lists (such as the US Census, which has been taken every 10 years for over 200 years), but should probably be turned off for small or irregular lists (e.g., less than 10 entries), where it could be confusing. | ||
| − | * < | + | * {{code|on}} ('''Default''') |
| − | * | + | * {{code|off}} |
| + | |- | ||
| + | !scope="row"|pop_name | ||
| + | |''Optional.'' The text in the column header of the population data. | ||
| + | * {{code|<nowiki>{{abbr|Pop.|Population}}</nowiki>}} ('''Default''', displays as {{abbr|Pop.|Population}}) | ||
| + | |- | ||
| + | !scope="row"|percentages | ||
| + | |''Optional.'' Whether to include an automatically generated column of percent differences. This works best with linear lists (1900, 1910, 1920, etc.). Alternately, you can specify "'''pagr'''" to display annual growth rates ('''per annum growth rate''') using the formula from [[Population growth]]. | ||
| + | * {{code|on}} ('''Default''') | ||
| + | * {{code|pagr}} | ||
| + | * {{code|off}} | ||
|- | |- | ||
| − | | | + | !scope="row"|cols |
| − | |''Optional.'' | + | |''Optional.'' Total number of columns of data (default is {{code|1}}). This is useful for very long tables, or when {{para|align|none}}. |
| − | + | |- | |
| − | + | !scope="row"|source | |
| + | |''Optional.'' Displayed as a footnote under the table with the text "Source:" inserted automatically. '''Every table should indicate the source of the data.''' | ||
| + | |- | ||
| + | !scope="row"|footnote | ||
| + | |''Optional.'' Free-form footnote. Can be used as a variant to, or in addition to, the ''source'' parameter. | ||
| + | |- | ||
| + | !scope="row"|graph-pos | ||
| + | |''Optional.'' Adds an automatically generated graph at the top (with {{para|graph-pos|top}}) or bottom (with {{para|graph-pos|bottom}}) | ||
| + | |- | ||
| + | !scope="row"|graph-height | ||
| + | |''Optional.'' Overrides the default height of the graph. Should not be necessary in most cases. | ||
| + | |- | ||
| + | !scope="row"|graph-width | ||
| + | |''Optional.'' Overrides the default width of the graph. Should not be necessary in most cases. | ||
|- | |- | ||
| − | |||
| − | |||
|} | |} | ||
| − | + | ==Examples== | |
| − | + | ===United States=== | |
{{Historical populations | {{Historical populations | ||
| − | |type = | + | |type = US |
| − | | | + | |source = {{cite web|url=http://factfinder.census.gov|publisher=[[United States Census Bureau]]|title=American FactFinder}} |
|1890 |1046964 | |1890 |1046964 | ||
|1900 |1293697 | |1900 |1293697 | ||
| Line 96: | Line 136: | ||
|1990 |1585577 | |1990 |1585577 | ||
|2000 |1517550 | |2000 |1517550 | ||
| − | |2006 ( | + | |2006 (est.) |
|1448394 | |1448394 | ||
}} | }} | ||
| + | |||
The following code will yield the table on the right. | The following code will yield the table on the right. | ||
<pre style="width: 40em;">{{Historical populations | <pre style="width: 40em;">{{Historical populations | ||
| − | |type = | + | |type = US |
| − | | | + | |source = {{subst:Historical populations/USCensusRef}} |
|1890 |1046964 | |1890 |1046964 | ||
|1900 |1293697 | |1900 |1293697 | ||
| Line 116: | Line 157: | ||
|1990 |1585577 | |1990 |1585577 | ||
|2000 |1517550 | |2000 |1517550 | ||
| − | |2006 ( | + | |2006 (est.) |
|1448394 | |1448394 | ||
}}</pre> | }}</pre> | ||
{{clear}} | {{clear}} | ||
| − | + | ===Smaller areas=== | |
{{Historical populations | {{Historical populations | ||
|width = 10em | |width = 10em | ||
| Line 133: | Line 174: | ||
|1990|35888 | |1990|35888 | ||
|2000|39317 | |2000|39317 | ||
| − | |footnote=Note: Sandefjord and [[Sandar]] were merged in 1970. | + | |footnote = Note: Sandefjord and [[Sandar, Norway|Sandar]] were merged in 1970. |
| − | + | |source = [http://www.ssb.no SSB] | |
| − | }}The following code will yield the table on the right. | + | }} |
| + | |||
| + | The following code will yield the table on the right. | ||
<pre style="width: 40em;">{{Historical populations | <pre style="width: 40em;">{{Historical populations | ||
| Line 148: | Line 191: | ||
|1990 |35888 | |1990 |35888 | ||
|2000 |39317 | |2000 |39317 | ||
| − | |footnote=Note: Sandefjord and [[Sandar]] were merged in 1970. | + | |footnote=Note: Sandefjord and [[Sandar, Norway|Sandar]] were merged in 1970. |
| − | + | |source = [http://www.ssb.no SSB] | |
| + | }}</pre> | ||
| + | |||
| + | ===Non-regular date ranges=== | ||
| + | {{Historical populations | ||
| + | | title= Population census | ||
| + | | percentages = pagr | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }} | ||
| + | |||
| + | For non-regular date ranges, use <code>percentages=pagr</code> to show annual growth rate percentages. | ||
| + | |||
| + | <pre style="width: 40em;">{{Historical populations | ||
| + | | title= Population census | ||
| + | | percentages = pagr | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }}</pre> | ||
| + | |||
| + | ===Two columns=== | ||
| + | For a multicolumn non-floating table use <code>align=none</code> and <code>cols=2</code> | ||
| + | |||
| + | <pre style="width: 40em;">{{Historical populations | ||
| + | | title= Population census | ||
| + | | percentages = pagr | ||
| + | | align = none | ||
| + | | cols = 2 | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
}}</pre> | }}</pre> | ||
| − | === See also | + | {{Historical populations |
| − | * [[Template: | + | | title= Population census |
| − | * [[Template: | + | | percentages = pagr |
| + | | align = none | ||
| + | | cols = 2 | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }} | ||
| + | ===Two columns with graph=== | ||
| + | For a multicolumn non-floating table with a bottom graph use <code>align=none</code> and <code>cols=2</code> and <code>graph-pos=bottom</code> | ||
| + | |||
| + | <pre style="width: 40em;">{{Historical populations | ||
| + | | title= Population census | ||
| + | | percentages = pagr | ||
| + | | align = none | ||
| + | | cols = 2 | ||
| + | | graph-pos = bottom | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }}</pre> | ||
| + | |||
| + | {{Historical populations | ||
| + | | title= Population census | ||
| + | | percentages = pagr | ||
| + | | align = none | ||
| + | | cols = 2 | ||
| + | | graph-pos = bottom | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }} | ||
| + | |||
| + | ===Horizontal direction=== | ||
| + | For a horizontally arranged table use <code>direction=horizontal</code> | ||
| + | |||
| + | <pre style="width: 40em;">{{Historical populations | ||
| + | | title= Population census | ||
| + | | align = none | ||
| + | | direction = horizontal | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }}</pre> | ||
| + | |||
| + | {{Historical populations | ||
| + | | title= Population census | ||
| + | | align = none | ||
| + | | direction = horizontal | ||
| + | | 1903 |219928 | ||
| + | | 1960 |1138611 | ||
| + | | 1970 |1330788 | ||
| + | | 1975 |1479116 | ||
| + | | 1980 |1630485 | ||
| + | | 1990 |1601234 | ||
| + | | 1995 |1654761 | ||
| + | | 2000 |1581082 | ||
| + | | 2007 |1660714 | ||
| + | | 2010 |1652171 | ||
| + | }} | ||
| + | |||
| + | ==See also== | ||
| + | * [[Template:US Census population]] | ||
| + | * [[Template:Demography]] – for horizontal tables | ||
| + | |||
| + | |||
| + | <includeonly>{{Sandbox other|| | ||
| − | + | <!-- CATEGORY LINKS HERE, THANKS --> | |
| − | <!-- | + | [[Category:History and events templates]] |
| − | [[Category:History and events templates | ||
| − | + | }}</includeonly> | |
| − | |||
| − | |||
| − | </includeonly> | ||
Latest revision as of 19:27, 19 January 2021
| This is a documentation subpage for Template:Historical populations. It contains usage information, categories and other content that is not part of the original template page. |
| This template uses Lua: |
Template:Historical populations is used as an information box on pages, showing each census year with a population, and a percent gain/loss comparison. It is intended to combine the functionalities of two existing templates, Template:US Census population and Template:Histpop, the former of which is specialized for the United States, and the latter of which lacks many features of the former.
Contents
Usage
This template takes a series of parameters in the form |date |population. This template does not require any more than that. This template will take between 0 and 50 entries; any more will be ignored.
Complete template
{{Historical populations
|title =
|type =
|align =
|direction =
|width =
|state =
|shading =
|pop_name =
|percentages =
|footnote =
|source =
|date |population
|date |population
|date |population
|date |population
|date |population
|date |population
|date |population
}}
Parameters
| Parameter | Description |
|---|---|
| daten | Ideally, a four-digit year, but can be anything. Usually a multiple of 10, but does not have to be. |
| populationn | The population of row n. Must be a plain number with no formatting (commas, etc.). |
| title | Optional. The title of the table.
|
| type | Optional. This is designed to add functionality specific to different regions or types of information. Currently the only value that does anything is US (or the obsolescent USA).
Please think of more ideas for this feature. |
| align | Optional. The alignment of the table on the page.
|
| direction | Optional. How the box is arranged on the page.
|
| clear | Optional. Use to clear any left or right floating elements nearby.
|
| width | Optional. The width of the table (or of each block of columns). Can be any valid CSS width value.
|
| state | Optional. The collapsed state of the table. Set it to collapsed to collapse the table by default.
|
| shading | Optional. Whether to mark off every five entries with a line, to facilitate reading. This works best with large, linear lists (such as the US Census, which has been taken every 10 years for over 200 years), but should probably be turned off for small or irregular lists (e.g., less than 10 entries), where it could be confusing.
|
| pop_name | Optional. The text in the column header of the population data.
|
| percentages | Optional. Whether to include an automatically generated column of percent differences. This works best with linear lists (1900, 1910, 1920, etc.). Alternately, you can specify "pagr" to display annual growth rates (per annum growth rate) using the formula from Population growth.
|
| cols | Optional. Total number of columns of data (default is 1). This is useful for very long tables, or when |align=none.
|
| source | Optional. Displayed as a footnote under the table with the text "Source:" inserted automatically. Every table should indicate the source of the data. |
| footnote | Optional. Free-form footnote. Can be used as a variant to, or in addition to, the source parameter. |
| graph-pos | Optional. Adds an automatically generated graph at the top (with |graph-pos=top) or bottom (with |graph-pos=bottom)
|
| graph-height | Optional. Overrides the default height of the graph. Should not be necessary in most cases. |
| graph-width | Optional. Overrides the default width of the graph. Should not be necessary in most cases. |
Examples
United States
| Year | Pop. | ±% |
|---|---|---|
| 1890 | 1,046,964 | — |
| 1900 | 1,293,697 | +23.6% |
| 1910 | 1,549,008 | +19.7% |
| 1920 | 1,823,779 | +17.7% |
| 1930 | 1,950,961 | +7.0% |
| 1940 | 1,931,334 | −1.0% |
| 1950 | 2,071,605 | +7.3% |
| 1960 | 2,002,512 | −3.3% |
| 1970 | 1,948,609 | −2.7% |
| 1980 | 1,688,210 | −13.4% |
| 1990 | 1,585,577 | −6.1% |
| 2000 | 1,517,550 | −4.3% |
| 2006 (est.) | 1,448,394 | −4.6% |
| Source: "American FactFinder". United States Census Bureau. | ||
The following code will yield the table on the right.
{{Historical populations
|type = US
|source = {{subst:Historical populations/USCensusRef}}
|1890 |1046964
|1900 |1293697
|1910 |1549008
|1920 |1823779
|1930 |1950961
|1940 |1931334
|1950 |2071605
|1960 |2002512
|1970 |1948609
|1980 |1688210
|1990 |1585577
|2000 |1517550
|2006 (est.)
|1448394
}}
Smaller areas
| Year | Pop. |
|---|---|
| 1845 | 749 |
| 1951 | 6,717 |
| 1960 | 6,984 |
| 1970 | 31,752 |
| 1980 | 34,758 |
| 1990 | 35,888 |
| 2000 | 39,317 |
| Note: Sandefjord and Sandar were merged in 1970. Source: SSB | |
The following code will yield the table on the right.
{{Historical populations
|width = 10em
|shading = off
|percentages = off
|1845 |749
|1951 |6717
|1960 |6984
|1970 |31752
|1980 |34758
|1990 |35888
|2000 |39317
|footnote=Note: Sandefjord and [[Sandar, Norway|Sandar]] were merged in 1970.
|source = [http://www.ssb.no SSB]
}}
Non-regular date ranges
| Year | Pop. | ±% p.a. |
|---|---|---|
| 1903 | 219,928 | — |
| 1960 | 1,138,611 | +2.93% |
| 1970 | 1,330,788 | +1.57% |
| 1975 | 1,479,116 | +2.14% |
| 1980 | 1,630,485 | +1.97% |
| 1990 | 1,601,234 | −0.18% |
| 1995 | 1,654,761 | +0.66% |
| 2000 | 1,581,082 | −0.91% |
| 2007 | 1,660,714 | +0.70% |
| 2010 | 1,652,171 | −0.17% |
For non-regular date ranges, use percentages=pagr to show annual growth rate percentages.
{{Historical populations
| title= Population census
| percentages = pagr
| 1903 |219928
| 1960 |1138611
| 1970 |1330788
| 1975 |1479116
| 1980 |1630485
| 1990 |1601234
| 1995 |1654761
| 2000 |1581082
| 2007 |1660714
| 2010 |1652171
}}
Two columns
For a multicolumn non-floating table use align=none and cols=2
{{Historical populations
| title= Population census
| percentages = pagr
| align = none
| cols = 2
| 1903 |219928
| 1960 |1138611
| 1970 |1330788
| 1975 |1479116
| 1980 |1630485
| 1990 |1601234
| 1995 |1654761
| 2000 |1581082
| 2007 |1660714
| 2010 |1652171
}}
|
|
Two columns with graph
For a multicolumn non-floating table with a bottom graph use align=none and cols=2 and graph-pos=bottom
{{Historical populations
| title= Population census
| percentages = pagr
| align = none
| cols = 2
| graph-pos = bottom
| 1903 |219928
| 1960 |1138611
| 1970 |1330788
| 1975 |1479116
| 1980 |1630485
| 1990 |1601234
| 1995 |1654761
| 2000 |1581082
| 2007 |1660714
| 2010 |1652171
}}
|
|
Horizontal direction
For a horizontally arranged table use direction=horizontal
{{Historical populations
| title= Population census
| align = none
| direction = horizontal
| 1903 |219928
| 1960 |1138611
| 1970 |1330788
| 1975 |1479116
| 1980 |1630485
| 1990 |1601234
| 1995 |1654761
| 2000 |1581082
| 2007 |1660714
| 2010 |1652171
}}
| Population census | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Year | 1903 | 1960 | 1970 | 1975 | 1980 | 1990 | 1995 | 2000 | 2007 | 2010 |
| Pop. | 219,928 | 1,138,611 | 1,330,788 | 1,479,116 | 1,630,485 | 1,601,234 | 1,654,761 | 1,581,082 | 1,660,714 | 1,652,171 |
| ±% | — | +417.7% | +16.9% | +11.1% | +10.2% | −1.8% | +3.3% | −4.5% | +5.0% | −0.5% |
See also
- Template:US Census population
- Template:Demography – for horizontal tables