Module:Tropical cyclone categories/doc
This is the documentation page for Module:Tropical cyclone categories
Usage
This module exports three functions for templates: p.color
, p.name
, and p.sortkey
. It also provides p._color
, p._name
, and p._sortkey
for use in other modules.
Color
Provides the color of the given tropical cyclone category code. This comes in the format of their raw hexidecimal code.
Code | Output |
---|---|
<span style="padding:4px;border:1px solid black;background-color:#{{#invoke:Tropical cyclone categories|color|depression}}">depression</span>
|
depression |
Name
Provides the name of the given tropical cyclone category code. A optional basin argument can be provided as the second argument in order to slightly tweak the name of the category, if the given category definition supports it. This function is case-insensitive, and all non-alphanumeric characters are stripped.
Code | Output |
---|---|
{{#invoke:Tropical cyclone categories|name|severe}}
|
Severe tropical storm |
{{#invoke:Tropical cyclone categories|name|spr - cYcL -s TorM}}
|
Super cyclonic storm |
{{#invoke:Tropical cyclone categories|name|cat5}}
|
Category 5 tropical cyclone |
{{#invoke:Tropical cyclone categories|name|cat5|WPac}}
|
Category 5 super typhoon |
Sortkey
The sortkey is a number that aids in sorting categories. Using the sortkey, it is possible to automatically sort a table of tropical cyclones given their category code. Due to the ambiguous nature of sortkeys, tables may be sorted incorrectly if values from other basins were used. For categories that span multiple basins, however, (e.g. depression
and storm
) they are given the lowest possible sortkeys in order to achieve maximum compatibility.
This sortkey is used in Template:T, a subtemplate of Template:T.
The sortkey format is as follows. Note that not all values between the given ranges were used. The arrangement of these were determined by their positions in the Template:T template.
Basin | Sortkey range |
---|---|
Template:Gray | 90000 to 99999 |
Atl/EPac/SAtl | 80000 to 89999 |
WPac | 60000 to 69999 |
Nio | 50000 to 59999 |
Aus/Fiji | 40000 to 49999 |
SWio | 30000 to 39999 |
Historical | 20000 to 29999 |
Global | 0 to 9999 |
A demonstration of a sortable table using these sortkeys can be found below. Note that it does not use categories outside of its own basin (in this case, the Atl/EPac/SAtl basin) and the global range.
Category | Sortkey | Code |
---|---|---|
cat3 | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|cat3}}
|
cat1 | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|cat1}}
|
cat5 | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|cat5}}
|
cat4 | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|cat4}}
|
depression | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|depression}}
|
cat2 | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|cat2}}
|
Category | Sortkey | Code |
---|---|---|
typhoon | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|typhoon}}
|
potential | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|potential}}
|
cat5 | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|cat5}}
|
svrcyclstorm | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|svrcyclstorm}}
|
unknown | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|unknown}}
|
supertyphoon | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|supertyphoon}}
|
niodepression | Template:Nts | {{#invoke:Tropical cyclone categories|sortkey|niodepression}}
|
Compatibility
This module was designed to be backwards-compatible with Template:T as of revision 919481476 and Template:T as of revision 990905269. For category names that did not have matching colors, their colors have been guessed. For colors with aliases that were too vague (e.g. 5
for the color of cat5
, but could have also meant Aus5
or shem5
), the vague alias works only with p.color
.
Compatibility with Template:T | Compatibility with Template:T | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|