Jump to content

Template:TC cat sort key: Difference between revisions

From Shark's Hypothetical Weather
Created page with "{{#switch: {{uc:{{{1}}}}} | CAT1 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat1}} | CAT2 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat2}} | CAT3 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat3}} | CAT4 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat4}} | CAT5 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat5}} | CAT6 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat6}} | CAT7 = {{#invoke:StormCategoryColor|renderCategoryL..."
 
No edit summary
 
Line 1: Line 1:
{{#switch: {{uc:{{{1}}}}}
<includeonly>{{#switch:{{lc:{{{1}}}}}|depression=5|storm=8|cat1=10|cat2=20|cat3=30|cat4=40|cat5=50|cat6=60|cat7=70|low=2|0}}</includeonly><noinclude>
| CAT1 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat1}}
This template essentially defines a total order on each basin's tropical cyclone categories so it makes sense to sort by category. Lower categories get low numbers and higher categories get higher numbers. The single parameter taken in is the category name and the output is a natural number that indicates its place in the hierarchy.
| CAT2 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat2}}
<templatedata>
| CAT3 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat3}}
{
| CAT4 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat4}}
"params": {
| CAT5 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat5}}
"1": {
| CAT6 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat6}}
"required": true,
| CAT7 = {{#invoke:StormCategoryColor|renderCategoryLabel4|cat7}}
"suggested": true
| DEPRESSION = {{#invoke:StormCategoryColor|renderCategoryLabel4|depression}}
}
| LOW = {{#invoke:StormCategoryColor|renderCategoryLabel4|posttropical}}
},
| STORM = {{#invoke:StormCategoryColor|renderCategoryLabel4|storm}}
"description": "Converts different tropical cyclone intensity category names to sort keys; defaults to 0"
| #default = {{Tc nom list|{{{1}}}}}
}
}}<noinclude>
</templatedata>
 
This template is used to specify the descriptions used by TC stats tables (the cell colouring is specified by [[Template:TC stats cell format]]). The template takes one input parameter, and that is the type of tropical cyclone/storm.
 
=== Examples ===
{| class="wikitable"
! Type !! Color !! Description
|-
| cat1 || {{TC stats cell format|cat1}} | &nbsp; || {{TC stats desc|cat1}}
|-
| cat2 || {{TC stats cell format|cat2}} | &nbsp; || {{TC stats desc|cat2}}
|-
| cat3 || {{TC stats cell format|cat3}} | &nbsp; || {{TC stats desc|cat3}}
|-
| cat4 || {{TC stats cell format|cat4}} | &nbsp; || {{TC stats desc|cat4}}
|-
| cat5 || {{TC stats cell format|cat5}} | &nbsp; || {{TC stats desc|cat5}}
|-
| cat6 || {{TC stats cell format|cat6}} | &nbsp; || {{TC stats desc|cat6}}
|-
| cat7 || {{TC stats cell format|cat7}} | &nbsp; || {{TC stats desc|cat7}}
|-
| depression || {{TC stats cell format|depression}} | &nbsp; || {{TC stats desc|depression}}
|-
| low || {{TC stats cell format|low}} | &nbsp; || {{TC stats desc|low}}
|-
| storm || {{TC stats cell format|storm}} | &nbsp; || {{TC stats desc|storm}}
|-
|}
 
=== See also ===
* {{tl|TC stats cell format}}
 
[[Category:Tropical cyclone statistics templates|Desc]]
</noinclude>
</noinclude>

Latest revision as of 23:55, 24 April 2025

This template essentially defines a total order on each basin's tropical cyclone categories so it makes sense to sort by category. Lower categories get low numbers and higher categories get higher numbers. The single parameter taken in is the category name and the output is a natural number that indicates its place in the hierarchy.

Converts different tropical cyclone intensity category names to sort keys; defaults to 0

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
11

no description

Unknownrequired