Misplaced Pages

Module:Storm categories/categories: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Module:Storm categories Browse history interactively← Previous editNext edit →Content deleted Content added
Revision as of 18:22, 3 December 2022 view sourcePaine Ellsworth (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, File movers, New page reviewers, Pending changes reviewers, Rollbackers, Template editors255,852 edits per edit request on talk page - alias the formerly-documented vstrtyphoon code to vstyphoon← Previous edit Revision as of 02:31, 6 February 2023 view source Paine Ellsworth (talk | contribs)Autopatrolled, Extended confirmed users, Page movers, File movers, New page reviewers, Pending changes reviewers, Rollbackers, Template editors255,852 edits per edit request on talk page - update to more general "storm"Next edit →
Line 110: Line 110:
unknown = { unknown = {
color = "c0c0c0", color = "c0c0c0",
name = "Unknown strength tropical cyclone", name = "Unknown-strength storm",
sortkey = 0, sortkey = 0,
icon = "'''?'''" icon = "'''?'''"

Revision as of 02:31, 6 February 2023

Module documentation[view] [edit] [history] [purge]
WarningThis Lua module is used on approximately 5,500 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.

This page contains the tropical cyclone category data for Module:Storm categories.

Each category is expected to contain the following information:

  • ID – the ID is derived from the key/index of the category in the cats table
    • This ID must be in lowercase and have no special symbols; the module will take care of data sanitization.
  • color – the hexadecimal code of the category's color, without
  • name – the name of the category
  • sortkey – the sortkey of the category
    • Give decent spacing in between keys for future categories.
  • icon (incomplete) – the icon of the category in wikitext
  • basin (to be done) – a table (list) of basins to which this category applies to
  • scale (to be done) – a wikilink (without brackets) leading to the scale of this category
  • q (to be done) – the Wikidata entity of this category

Aliases are defined at the bottom of the module. They are in the following format:, where actual is the ID of the category:

cats = cats
The above documentation is transcluded from Module:Storm categories/categories/doc. (edit | history)
Editors can experiment in this module's sandbox (edit | diff) and testcases (create) pages.
Subpages of this module.

local p = {}

-- Define categories

-- All sortkeys have been guessed. They may be changed by common sense
-- or consensus at ]
local cats = {
	--
	--  TROPICAL CYCLONES
	--
	severe = {
		color = "ccffff",
		name = "Severe tropical storm",
		sortkey = 120,
		icon = "]"
	},
	mtstorm = {
		 color = "00faf4", -- Old {{storm colour}} did not support. Value guessed.
		 name = "Moderate tropical storm",
		 sortkey = 105,
		 icon = "]"
	},
	storm = {
		color = "00faf4",
		name = "Tropical storm",
		sortkey = 100,
		icon = "]"
	},
	severedep = {
		color = "5ebaff", -- Old {{storm colour}} did not support. Value guessed.
		name = "Severe tropical depression",
		sortkey = 120
	},
	moddepression = {
		color = "5ebaff", -- Old {{storm colour}} did not support. Value guessed.
		name = "Moderate tropical depression",
		sortkey = 95
	},
	depression = {
		color = "5ebaff",
		name = "Tropical depression",
		sortkey = 90,
		icon = "]"
	},
	disturbance = {
		color = "80ccff",
		name = "Tropical disturbance",
		sortkey = 80,
		icon = "]"
	},
	subtropicalcyclone = {
		color = "00faf4",
		name = "Subtropical cyclone",
		sortkey = 70
	},
	subtropical = {
		color = "00faf4",
		name = "Subtropical storm",
		sortkey = 65,
		icon = "]"
	},
	subdepression = {
		color = "5ebaff",
		name = "Subtropical depression",
		sortkey = 62,
		icon = "]"
	},
	overland = {
		color = "5ebaff",
		name = "Overland depression",
		sortkey = 60,
		icon = "]"
	},
	subdisturbance = {
		color = "80ccff",
		name = "Subtropical disturbance",
		sortkey = 55,
		icon = "]"
	},
	extratropical = {
		color = "cccccc",
		name = "Extratropical cyclone",
		sortkey = 50,
		icon = "]"
	},
	monsoondepression = {
		color = "5ebaff",
		name = "Monsoon depression",
		sortkey = 30,
		icon = "]"
	},
	potential = {
		color = "80ccff",
		name = "Potential tropical cyclone",
		sortkey = 25,
		icon = "]"
	},
	posttropical = {
		color = "cccccc",
		name = "Post-tropical depression",
		sortkey = 70,
		icon = "]"
	},
	remnant = {
		color = "cccccc",
		name = "Post-tropical depression",
		sortkey = 70,
		icon = "]"
	},
	unknown = {
		color = "c0c0c0",
		name = "Unknown-strength storm",
		sortkey = 0,
		icon = "'''?'''"
	},
	-- SSWHS hurricane categories
	cat5 = {
		color = "ff6060",
		name = {
			atl = "Category 5 hurricane",
			epac = "Category 5 hurricane",
			satl = "Category 5 hurricane",
			wpac = "Category 5-equivalent super typhoon",
			default = "Category 5-equivalent tropical cyclone"
		},
		sortkey = 80050,
		icon = "]"
	},
	cat4 = {
		color = "ff8f20",
		name = {
			atl = "Category 4 hurricane",
			epac = "Category 4 hurricane",
			satl = "Category 4 hurricane",
			wpac = "Category 4-equivalent typhoon",
			default = "Category 4-equivalent tropical cyclone"
		},
		sortkey = 80040,
		icon = "]"
	},
	cat3 = {
		color = "ffc140",
		name = {
			atl = "Category 3 hurricane",
			epac = "Category 3 hurricane",
			satl = "Category 3 hurricane",
			wpac = "Category 3-equivalent typhoon",
			default = "Category 3-equivalent tropical cyclone"
		},
		sortkey = 80030,
		icon = "]"
	},
	cat2 = {
		color = "ffe775",
		name = {
			atl = "Category 2 hurricane",
			epac = "Category 2 hurricane",
			satl = "Category 2 hurricane",
			wpac = "Category 2-equivalent typhoon",
			default = "Category 2-equivalent tropical cyclone"
		},
		sortkey = 80020,
		icon = "]"
	},
	cat1 = {
		color = "ffffcc",
		name = {
			atl = "Category 1 hurricane",
			epac = "Category 1 hurricane",
			satl = "Category 1 hurricane",
			wpac = "Category 1-equivalent typhoon",
			default = "Category 1-equivalent tropical cyclone"
		},
		sortkey = 80010,
		icon = "]"
	},
	supertyphoon = {
		color = "ff6060",
		name = "Category 4 super typhoon",
		sortkey = 80045
	},
	typhoon = {
		color = "fdaf9a",
		name = "Typhoon",
		sortkey = 60010
	},
	-- HKO
	svtyphoon = {
		color = "ff8f20",
		name = "Severe typhoon",
		sortkey = 60015
	},
	vstyphoon = {
		color = "fe887d",
		name = "Very strong typhoon",
		sortkey = 60020,
		icon = "]"
	},
	vityphoon = {
		color = "ff6060",
		name = "Violent typhoon",
		sortkey = 60030,
		icon = "]"
	},
	-- PAGASA
	styphoon = {
		color = "ff6060",
		name = "Supertyphoon",
		sortkey = 60050
	},
	sprcyclstorm = {
		color = "ff6060",
		name = "Super cyclonic storm",
		sortkey = 50020,
		icon = "]"
	},
	esvrcyclstorm = {
		color = "ffc140",
		name = "Extremely severe cyclonic storm",
		sortkey = 50015,
		icon = "]"
	},
	vsvrcyclstorm = {
		color = "ffffcc",
		name = "Very severe cyclonic storm",
		sortkey = 50010,
		icon = "]"
	},
	svrcyclstorm = {
		color = "ccffff",
		name = "Severe cyclonic storm",
		sortkey = 50008,
		icon = "]"
	},
	niocyclone = {
		color = "00faf4",
		name = "Cyclonic storm",
		sortkey = 50006,
		icon = "]"
	},
	deepdepression = {
		color = "5ebaff",
		name = "Deep depression",
		sortkey = 50002,
		icon = "]"
	},
	niodepression = {
		color = "80ccff",
		name = "Depression",
		sortkey = 50001,
		icon = "]"
	},
	nioland = {
		color = "80ccff",
		name = "Land depression",
		sortkey = 50000,
		icon = "]"
	},
	aus5 = {
		color = "ff6060",
		name = "Category 5 severe tropical cyclone",
		sortkey = 40015,
		icon = "]"
	},
	aus4 = {
		color = "ffc140",
		name = "Category 4 severe tropical cyclone",
		sortkey = 40013,
		icon = "]"
	},
	aus3 = {
		color = "ffffcc",
		name = "Category 3 severe tropical cyclone",
		sortkey = 40010,
		icon = "]"
	},
	aus2 = {
		color = "ccffff",
		name = "Category 2 tropical cyclone",
		sortkey = 40008,
		icon = "]"
	},
	aus1 = {
		color = "00faf4",
		name = "Category 1 tropical cyclone",
		sortkey = 40006,
		icon = "]"
	},
	low = {
		color = "5ebaff",
		name = "Tropical low",
		sortkey = 40002,
		icon = "]"
	},
	sublow = {
		color = "5ebaff",
		name = "Subtropical low",
		sortkey = 40000
	},
	vintense = {
		color = "ff6060",
		name = "Very intense tropical cyclone",
		sortkey = 30010,
		icon = "]"
	},
	intense = {
		color = "ffc140",
		name = "Intense tropical cyclone",
		sortkey = 30008,
		icon = "]"
	},
	tropicalcyclone = {
		color = "ffffcc",
		name = "Tropical cyclone",
		sortkey = 30006,
		icon = "'''TC'''"
	},
	mstorm = {
		color = "00faf4",
		name = "Moderate tropical storm",
		sortkey = 30004,
		icon = "]"
	},
	zodw = {
		color = "80ccff",
		name = "Zone of disturbed weather",
		sortkey = 30000,
		icon = "]"
	},
	shemsvrtc = {
		color = "ffe775",
		name = "Severe tropical cyclone",
		sortkey = 20020
	},
	shem5 = {
		color = "ff6060",
		name = "Severe tropical cyclone",
		sortkey = 20010
	},
	shem4 = {
		color = "ffc140",
		name = "Tropical cyclone",
		sortkey = 20008
	},
	shem2 = {
		color = "ccffff",
		name = "Tropical cyclone",
		sortkey = 20008
	},
	shem1 = {
		color = "00faf4",
		name = "Tropical cyclone",
		sortkey = 20008
	},
	--
	-- WINTER STORMS
	--
	-- Regional Snowfall Index
	rsi0 = {
		color = "cccccc",
		name = "Category 0 \"Nuisance\"",
		sortkey = 80100,
		icon = "]"
	},
	rsi1 = {
		color = "ffffcc",
		name = "Category 1 \"Notable\"",
		sortkey = 80110,
		icon = "]"
	},
	rsi2 = {
		color = "ffe775",
		name = "Category 2 \"Minor\"",
		sortkey = 80120,
		icon = "]"
	},
	rsi3 = {
		color = "ffc140",
		name = "Category 3 \"Major\"",
		sortkey = 80130,
		icon = "]"
	},
	rsi4 = {
		color = "ff8f20",
		name = "Category 4 \"Crippling\"",
		sortkey = 80140,
		icon = "]"
	},
	rsi5 = {
		color = "ff6060",
		name = "Category 5 \"Extreme\"",
		sortkey = 80150,
		icon = "]"
	},
	-- Winter Storm Severity Index
	wssinone = {
		color = "cccccc",
		name = "No impacts",
		sortkey = 80200,
		icon = "]"
	},
	wssilimited = {
		color = "80ccff",
		name = "Limited impacts",
		sortkey = 80210,
		icon = "]"
	},
	wssiminor = {
		color = "ffc140",
		name = "Minor impacts",
		sortkey = 80220,
		icon = "]"
	},
	wssimoderate = {
		color = "ff8f20",
		name = "Moderate impacts",
		sortkey = 80230,
		icon = "]"
	},
	wssimajor = {
		color = "ff6060",
		name = "Major impacts",
		sortkey = 80240,
		icon = "]"
	},
	wssiextreme = {
		color = "cf75ff",
		name = "Extreme impacts",
		sortkey = 80250,
		icon = "]"
	},
	--
	-- TORNADOES
	--
	efu = {
		color = "cccccc",
		name = "EFU tornado",
		sortkey = 1001,
		icon = "]"
	},
	ef0 = {
		color = "00faf4",
		name = "EF0 tornado",
		sortkey = 1000,
		icon = "]"
	},
	ef1 = {
		color = "ffffcc",
		name = "EF1 tornado",
		sortkey = 1010,
		icon = "]"
	},
	ef2 = {
		color = "ffe775",
		name = "EF2 tornado",
		sortkey = 1020,
		icon = "]"
	},
	ef3 = {
		color = "ffc140",
		name = "EF3 tornado",
		sortkey = 1030,
		icon = "]"
	},
	ef4 = {
		color = "ff8f20",
		name = "EF4 tornado",
		sortkey = 1040,
		icon = "]"
	},
	ef5 = {
		color = "ff6060",
		name = "EF5 tornado",
		sortkey = 1050,
		icon = "]"
	},
	-- Beaufort Scale (windstorms)
	beaufort0 = {
		color = "FFFFFF",
		name = "Calm (Force 0)",
		sortkey = 1500,
	},
	beaufort1 = {
		color = "757575",
		name = "Light Air (Force 1)",
		sortkey = 1510,
	},
	beaufort2 = {
		color = "909090",
		name = "Light Breeze (Force 2)",
		sortkey = 1520,
	},
	beaufort3 = {
		color = "B7B7B7",
		name = "Gentle Breeze (Force 3)",
		sortkey = 1530,
	},
	beaufort4 = {
		color = "D2D2D2",
		name = "Moderate Breeze (Force 4)",
		sortkey = 1540,
	},
	beaufort5 = {
		color = "F1F1F1",
		name = "Fresh Breeze (Force 5)",
		sortkey = 1550,
	},
	beaufort6 = {
		color = "007FCE",
		name = "Strong Breeze (Force 6)",
		sortkey = 1560,
	},
    beaufort7 = {
		color = "46A1FF",
		name = "Near Gale (Force 7)",
		sortkey = 1570,
	},
    beaufort8 = {
		color = "5EDBF8",
		name = "Gale (Force 8)",
		sortkey = 1580,
	},
    beaufort9 = {
		color = "3BFDFD",
		name = "Strong Gale (Force 9)",
		sortkey = 1590,
	},
    beaufort10 = {
		color = "AAFD9C",
		name = "Storm (Force 10)",
		sortkey = 1600,
	},
    beaufort11 = {
		color = "D6FFA4",
		name = "Violent Storm (Force 11)",
		sortkey = 1610,
	},
    beaufort12 = {
		color = "FFFCD1",
		name = "Hurricane-force (Force 12)",
		sortkey = 1620,
	}
}

-- Define aliases

-- All non-alphanumeric characters are already stripped, and the string is
-- already set to lowercase, so additional aliases for those are no longer
-- required.

cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats
cats = cats

-- Key standardization check
for k, v in pairs(cats) do
	if k ~= mw.ustring.gsub(k, "", "") then
		mw.addWarning(
			"Category \""
			.. k
			.. "\" in ] is defined with a non-alphanumeric key. "
			.. "This key will likely be unusable unless non-alphanumeric characters are removed."
		)
	end
end

p.defaultCategory = "unknown"
p.cats = cats
return p
Category: