Jump to content

Module:Tennis performance timeline/data

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Chinissai (talk | contribs) at 02:22, 28 April 2017 (Added Q3 round.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local tennis = {}

-- display specifications for player rankings
tennis.rankings = {
	["1"] = {bgcolor = "lime", bold = true}, -- #00ff00
	["2"] = {bgcolor = "thistle"}, -- #d8bfd8
	["3"] = {bgcolor = "#9cf"}, -- yellow
	["4"] = {bgcolor = "#eee8aa"}, -- #ffebcd
	["5"] = {bgcolor = "#eee8aa"},
	["6"] = {bgcolor = "#eee8aa"}, -- #afeeee
	["7"] = {bgcolor = "#eee8aa"}, -- #afeeee
	["8"] = {bgcolor = "#eee8aa"}, -- #afeeee
	["9"] = {bgcolor = "#eee8aa"}, -- #afeeee
	["10"] = {bgcolor = "#eee8aa"}, -- #afeeee
}

-- display specifications for court surfaces
tennis.surfaces = {
	hard = {name = "Hard"},
	clay = {name = "Clay"},
	grass = {name = "Grass"},
	carpet = {
		name = "Carpet",
		absence = {
			type = "chrono",
			{2009, {color = "#ccc", round = "N/A", tooltip = "Discontinued", span = true, minSpellCols = 3}}
		}
	}
}

-- display specifications for indoor/outdoor courts
tennis.environments = {
	outdoor = {name = "Outdoor"},
	indoor = {name = "Indoor"}
}

-- display specifications for tournament results
tennis.rounds = {
	["Q1"] = {nocount = true, tooltip = "Out in qualification first round"},
	["Q2"] = {nocount = true, tooltip = "Out in qualification second round"},
	["Q3"] = {nocount = true, tooltip = "Out in qualification third round"},
	["1R"] = {bgcolor = "#afeeee", tooltip = "Out in first round"},
	["2R"] = {bgcolor = "#afeeee", tooltip = "Out in second round"},
	["3R"] = {bgcolor = "#afeeee", tooltip = "Out in third round"},
	["4R"] = {bgcolor = "#afeeee", tooltip = "Out in fourth round"},
	["QF"] = {bgcolor = "#ffebcd", tooltip = "Reached quarterfinal"},
	["SF"] = {bgcolor = "yellow", tooltip = "Reached semifinal"},
	["F"] = {bgcolor = "#d8bfd8", tooltip = "Reached final"},
	["W"] = {strike = true, bgcolor = "#00ff00", tooltip = "Won tournament", bold = true},
	["DNQ"] = {color = "#ccc", tooltip = "Did not qualify", span = true, minSpellCols = 3},
	["DNP"] = {nocount = true, tooltip = "Qualified but did not play"},
	["RR"] = {bgcolor = "#afeeee", tooltip = "Competed at a round-robin stage"},
	["Z"] = {nocount = true, bgcolor = "#ecf2ff", tooltip = "Played in Zonal Group $group$"},
	["PO"] = {nocount = true, bgcolor = "#ecf2ff", tooltip = "Played in play-offs"},
	["P"] = {nocount = true, bgcolor = "#ecf2ff", tooltip = "Played in preliminary rounds"},
	["G"] = {strike = true, bgcolor = "gold", tooltip = "Won a gold Olympic medal", bold = true},
	["F-S"] = {bgcolor = "silver", tooltip = "Won a silver Olympic medal"},
	["SF-B"] = {bgcolor = "#cd7f32", tooltip = "Won a bronze Olympic medal"},
	["4th"] = {bgcolor = "yellow", tooltip = "Fourth place"},
	-- internal use only
	["A"] = {tooltip = "Absent"},
	["NH"] = {color = "#ccc", tooltip = "Not held", span = true, minSpellCols = 2},
	["NMS"] = {color = "#ccc", tooltip = "Not a Masters Series", span = true, minSpellCols = 4},
	["NGPS"] = {color = "#ccc", tooltip = "Not a Grand Prix Super Series", span = true, minSpellCols = 5},
	["X"] = {color = "#ccc", tooltip = "Discontinued", span = true, minSpellCols = 3},
	["DNE"] = {color = "#ccc", tooltip = "Did not exist", span = true, minSpellCols = 3},
}

-- display ordering for various groups of tournaments
tennis.orders = {
	order = {"GS", "YearEnd", "ATP1000", "National"},
	GS = {
		link = "Grand Slam (tennis)",
		name = "Grand Slam",
		tooltip = "Grand Slam tournaments",
		"GS Australian Open",
		"GS Roland Garros",
		"GS Wimbledon",
		"GS US Open"
	},
	YearEnd = {
		name = "Year-end",
		tooltip = "Year-end championships",
		{
			type = "chrono",
			{2009, "World Tour Finals"},
			{2000, "Masters Cup"},
			{1990, "World Championships"},
			default = "Masters Grand Prix"
		},
		"WCT Finals",
		"Grand Slam Cup"
	},
	ATP1000 = {
		link = {
			type = "chrono",
			{2009, "ATP World Tour Masters 1000"},
			{1990, "ATP Masters Series"},
			default = "Grand Prix Super Series"
		},
		name = {
			type = "chrono",
			{2009, "ATP Masters 1000"},
			{2000, "ATP Masters Series"},
			{1990, "ATP Super 9"},
			default = "Grand Prix Super Series"
		},
		abbr = {
			type = "chrono",
			{2009, "Masters 1000"},
			{2000, "Masters Series"},
			{1990, "Super 9"},
			default = "Super Series"
		},
		{
			type = "chrono",
			{1990, "1000 Indian Wells"},
			{1987, "GPMS Indian Wells"},
			default = "GPMS Philadelphia"
		},
		{
			type = "chrono",
			{1990, "1000 Miami"},
			default = "GPMS Miami"
		},
		{
			type = "chrono",
			{1990, "1000 Monte Carlo"},
			default = "GPMS Monte Carlo"
		},
		{
			type = "chrono",
			{1982, "GPMS Forest Hills"},
			default = "GPMS Las Vegas"
		},
		{
			type = "chrono",
			{2009, "1000 Madrid"},
			{1990, "1000 Hamburg"},
			default = "GPMS Hamburg"
		},
		{
			type = "chrono",
			{1990, "1000 Rome"},
			default = "GPMS Rome"
		},
		"GPMS Washington",
		"GPMS Indianapolis",
		{
			type = "chrono",
			{1990, "1000 Canada"},
			default = "GPMS Canada"
		},
		{
			type = "chrono",
			{1990, "1000 Cincinnati"},
			default = "GPMS Cincinnati"
		},
		{
			type = "chrono",
			{2009, "1000 Shanghai"},
			{2002, "1000 Madrid"},
			{1995, "1000 Stuttgart"},
			{1990, "1000 Stockholm"},
			default = "GPMS Stockholm"
		},
		{
			type = "chrono",
			{1990, "1000 Paris"},
			{1989, "GPMS Paris"},
			{1978, "GPMS Tokyo"},
			default = "GPMS Boston"
		},
		"GPMS Los Angeles",
		"GPMS Johannesburg",
		"GPMS Wembley",
	},
	National = {
		name = "National rep.",
		tooltip = "National representation",
		"Summer Olympics",
		"Davis Cup",
		"World Team Cup"
	},
	surfaces = {"hard", "clay", "grass", "carpet"},
	environments = {"outdoor", "indoor"}
}

-- display specifications for tennis seasons
tennis.tours = {
	ATP = {
		link = {
			type = "chrono",
			{2009, "$year$ ATP World Tour"},
			{1990, "$year$ ATP Tour"},
--			default = "$year$ Grand Prix (tennis)"
		}
	}
}

-- display specifications for tennis tournaments
tennis.tournaments = {
	["GS Australian Open"] = {
		name = "Australian Open",
		annualLink = "$year$ Australian Open – $gender$'s $type$s",
		absence = {
			type = "switch",
			param = "year",
			["1986"] = "NH"
		}
	},
	["GS Roland Garros"] = {
		name = "French Open",
		annualLink = "$year$ French Open – $gender$'s $type$s"
	},
	["GS Wimbledon"] = {
		link = "Wimbledon Championships",
		name = "Wimbledon",
		annualLink = "$year$ Wimbledon Championships – $gender$'s $type$s"
	},
	["GS US Open"] = {
		link = "US Open (tennis)",
		name = "US Open",
		annualLink = "$year$ US Open – $gender$'s $type$s"
	},
	["1000 Indian Wells"] = {
		name = "Indian Wells Masters",
		annualLink = {
			type = "chrono",
			{2009, "$year$ BNP Paribas Open – $gender$'s $type$s"},
			{2002, "$year$ Pacific Life Open – $gender$'s $type$s"},
			{2000, "$year$ Indian Wells Masters – $gender$'s $type$s"},
			{1988, "$year$ Newsweek Champions Cup – $type$s"},
			default = "$year$ Pilot Pen Classic – $type$s"
		},
		absence = {
			type = "chrono",
			{1987},
			default = "NGPS"
		}
	},
	["1000 Miami"] = {
		link = "Miami Open (tennis)",
		name = "Miami Open",
		annualLink = {
			type = "chrono",
			{2015, "$year$ Miami Open – $gender$'s $type$s"},
			{2013, "$year$ Sony Open Tennis – $gender$'s $type$s"},
			{2007, "$year$ Sony Ericsson Open – $gender$'s $type$s"},
			{2002, "$year$ NASDAQ-100 Open – $gender$'s $type$s"},
			{2000, "$year$ Ericsson Open – $gender$'s $type$s"},
			{1993, "$year$ Lipton Championships – $gender$'s $type$s"},
			default = "$year$ Lipton International Players Championships – $gender$'s $type$s"
		},
		absence = {
			type = "chrono",
			{1987},
			default = "NGPS"
		}
	},
	["1000 Monte Carlo"] = {
		link = "Monte-Carlo Masters",
		name = "Monte Carlo Masters",
		annualLink = {
			type = "chrono",
			{2009, "$year$ Monte-Carlo Rolex Masters – $type$s"},
			{2000, "$year$ Monte Carlo Masters – $type$s"},
			{1990, "$year$ Monte Carlo Open – $type$s"},
			default = "$year$ Monte Carlo Open"
		},
	},
	["1000 Madrid"] = {
		link = "Madrid Open (tennis)",
		name = "Madrid Open",
		annualLink = {
			type = "chrono",
			{2011, "$year$ Mutua Madrid Open – $gender$'s $type$s"},
			{2009, "$year$ Mutua Madrileña Madrid Open – $gender$'s Singles"},
			default = "$year$ Mutua Madrileña Masters Madrid – Singles"
		},
	},
	["1000 Hamburg"] = {
		name = "Hamburg Masters",
		annualLink = {
			type = "chrono",
			{2000, "$year$ Hamburg Masters – $type$s"},
			{1990, "$year$ ATP German Open – $type$s"}
		},
		absence = {
			type = "chrono",
			{1978},
			default = "NGPS"
		}
	},
	["1000 Rome"] = {
		link = "Italian Open (tennis)",
		name = "Italian Open",
		annualLink = {
			type = "chrono",
			{2002, "$year$ Internazionali BNL d'Italia – $gender$'s $type$s"},
			{2000, "$year$ Rome Masters – $gender$'s $type$s"},
			{1990, "$year$ Italian Open – $gender$'s $type$s"}
		},
	},
	["1000 Canada"] = {
		link = "Canadian Open (tennis)",
		name = "Canadian Open",
		annualLink = {
			type = "chrono",
			{2010, "$year$ Rogers Cup – $gender$'s $type$s"},
			{2005, "$year$ Rogers Masters – $type$s"},
			{2001, "$year$ Canada Masters – $type$s"},
			{1996, "$year$ du Maurier Open – $gender$'s $type$s"},
			{1990, "$year$ Canadian Open (tennis)"},
			{1979, "$year$ Player's Canadian Open"},
			default = "$year$ Rothmans Canadian Open"
		},
		absence = {
			type = "chrono",
			{1978},
			default = "NGPS"
		}
	},
	["1000 Cincinnati"] = {
		name = "Cincinnati Masters",
		annualLink = {
			type = "chrono",
			{2011, "$year$ Western & Southern Open – $gender$'s $type$s"},
			{2002, "$year$ Western & Southern Financial Group Masters – $type$s"},
			{2000, "$year$ Cincinnati Masters – $type$s"},
			{1996, "$year$ Great American Insurance ATP Championships – $type$s"},
			{1990, "$year$ Thriftway ATP Championships – $type$s"},
			{1989, "$year$ Cincinnati Open – $type$s"},
			default = "$year$ Cincinnati Open"
		},
		absence = {
			type = "chrono",
			{1981},
			default = "NGPS"
		}
	},
	["1000 Shanghai"] = {
		link = "Shanghai Masters (tennis)",
		name = "Shanghai Masters",
		annualLink = {
			type = "chrono",
			{2010, "$year$ Shanghai Rolex Masters – $type$s"},
			default = "$year$ Shanghai ATP Masters 1000 – $type$s"
		},
	},
	["1000 Stuttgart"] = {
		name = "Stuttgart Masters",
		annualLink = "$year$ Stuttgart Masters – $type$s"
	},
	["1000 Stockholm"] = {
		name = "Stockholm Open",
		annualLink = {
			type = "chrono",
			{1981, "$year$ Stockholm Open – $type$s"},
			{1979, "$year$ Stockholm Open – $gender$'s $type$s"},
			{1976, "$year$ Stockholm Open – $type$s"},
			{1975, "$year$ Stockholm Open – $gender$'s $type$s"},
			default = "$year$ Stockholm Open – $type$s"
		},
		absence = {
			type = "chrono",
			{1984},
			{1981, "NGPS"}
		}
	},
	["1000 Paris"] = {
		name = "Paris Masters",
		annualLink = {
			type = "chrono",
			{2002, "$year$ BNP Paribas Masters – $type$s"},
			{2000, "$year$ Paris Masters – $type$s"},
			default = "$year$ Paris Open – $type$s"
		},
	},
	["World Tour Finals"] = {
		name = "ATP World Tour Finals",
		annualLink = "$year$ ATP World Tour Finals – $type$s",
		absence = "DNQ"
	},
	["Masters Cup"] = {
		name = "Tennis Masters Cup",
		annualLink = "$year$ Tennis Masters Cup – $type$s",
		absence = "DNQ"
	},
	["World Championships"] = {
		name = "ATP Tour World Championships",
		annualLink = "$year$ World Championship Tennis Finals – $type$s",
		absence = "DNQ"
	},
	["GPMS Philadelphia"] = {
		name = "U.S. Pro Indoor",
		abbr = "Philadelphia",
		annualLink = {
			type = "chrono",
			{1985, "$year$ Ebel U.S. Pro Indoor – $type$s"},
			default = "$year$ U.S. Pro Indoor – $type$s"
		}
	},
	["GPMS Forest Hills"] = {
		name = "WCT Tournament of Champions",
		abbr = "Forest Hills",
		annualLink = "$year$ WCT Tournament of Champions",
		absence = {
			type = "chrono",
			{1990, "NMS"},
			{1986, "NGPS"},
			{1982},
			default = "NGPS"
		}
	},
	["GPMS Las Vegas"] = {
		name = "Alan King Tennis Classic",
		abbr = "Las Vegas",
		absence = {
			type = "chrono",
			{1978},
			{1976, "NGPS"},
			{1972},
			default = "NGPS"
		}
	},
	["GPMS Washington"] = {
		name = "Legg Mason Tennis Classic",
		abbr = "Washington",
		annualLink = "$year$ Washington Star International",
		absence = {
			type = "chrono",
			{1990, "NMS"},
			{1978, "NGPS"},
			{1975},
			default = "NGPS"
		}
	},
	["GPMS Indianapolis"] = {
		name = "U.S. Men's Clay Court Championships",
		abbr = "Indianapolis",
		annualLink = "$year$ U.S. Clay Court Championships – $gender$'s $type$s",
		absence = {
			type = "chrono",
			{1990, "NMS"},
			{1978, "NGPS"},
			{1974},
			default = "NGPS"
		}
	},
	["GPMS Tokyo"] = {
		name = "Tokyo Indoor",
		annualLink = "$year$ Tokyo Indoor – $type$s"
	},
	["GPMS Boston"] = {
		name = "U.S. Pro Tennis Championships",
		abbr = "Boston",
		annualLink = "$year$ U.S. Pro Tennis Championships"
	},
	["GPMS Los Angeles"] = {
		link = "Los Angeles Open (tennis)",
		abbr = "Los Angeles",
		annualLink = "$year$ Pacific Southwest Open",
		absence = {
			type = "chrono",
			{1990, "NMS"},
			{1974, "NGPS"}
		}
	},
	["GPMS Wembley"] = {
		name = "Wembley Championships",
		abbr = "Wembley",
		annualLink = {
			type = "chrono",
			{1976, "$year$ Benson & Hedges Championships"},
			default = "$year$ Embassy British Indoor Championships"
		},
		absence = {
			type = "chrono",
			{1990, "NMS"},
			{1984, "NGPS"},
			{1976},
			{1972, "NGPS"}
		}
	},
	["GPMS Johannesburg"] = {
		link = "South African Open (tennis)",
		name = "South African Open",
		abbr = "Johannesburg",
		annualLink = "$year$ South African Open (tennis)",
		absence = {
			type = "chrono",
			{1990, "NMS"},
			{1975, "NGPS"},
		}
	},
	["Masters Grand Prix"] = {
		name = "Masters Grand Prix",
		annualLink = {
			type = "chrono",
			{1985, "$year$ Nabisco Masters – $type$s"},
			{1980, "$year$ Volvo Masters – $type$s"},
			{1977, "$year$ Colgate-Palmolive Masters – $type$s"},
			{1972, "$year$ Commercial Union Assurance Masters – $type$s"},
			default = "$year$ Pepsi-Cola Masters – $type$s"
		},
	},
	["WCT Finals"] = {
		name = "WCT Finals",
		annualLink = {
			type = "chrono",
			{1987, "$year$ World Championship Tennis Finals – $type$s"},
			{1985, "$year$ Buick WCT Finals – $type$s"},
			default = "$year$ World Championship Tennis Finals – $type$s"
		},
		absence = {
			type = "chrono",
			{1990, "X"},
			{1971},
			default = "DNE"
		}
	},
	["Grand Slam Cup"] = {
		name = "Grand Slam Cup",
		annualLink = "Grand Slam Cup",
		absence = {
			type = "chrono",
			{2000, "X"},
			{1990},
			default = "DNE"
		}
	},
	["Summer Olympics"] = {
		link = "Tennis at the Summer Olympics",
		name = "Summer Olympics",
		annualLink = "Tennis at the $year$ Summer Olympics – $gender$'s $type$s",
		absence = {
			type = "switch",
			param = "year",
			default = "NH"
		}
	},
	["Davis Cup"] = {
		name = "Davis Cup",
		annualLink = {
			type = "chrono",
			{2000, {
					type = "switch",
					param = "round",
					W = "$year$ Davis Cup World Group",
					F = "$year$ Davis Cup World Group",
					SF = "$year$ Davis Cup World Group",
					QF = "$year$ Davis Cup World Group",
					["1R"] = "$year$ Davis Cup World Group",
					PO = "$year$ Davis Cup World Group Play-offs",
					default = {
						type = "switch",
						param = "group",
						["1"] = "$year$ Davis Cup $region$ Zone Group $group$",
						default = "$year$ Davis Cup $region$ Zone"
					}
				}
			},
			{1994, {
					type = "switch",
					param = "round",
					W = "$year$ Davis Cup World Group",
					F = "$year$ Davis Cup World Group",
					SF = "$year$ Davis Cup World Group",
					QF = "$year$ Davis Cup World Group",
					["1R"] = "$year$ Davis Cup World Group",
					PO = "$year$ Davis Cup World Group Play-offs",
					default = "$year$ Davis Cup $region$ Zone"
				}
			},
			{1981, {
					type = "switch",
					param = "round",
					W = "$year$ Davis Cup World Group",
					F = "$year$ Davis Cup World Group",
					SF = "$year$ Davis Cup World Group",
					QF = "$year$ Davis Cup World Group",
					["1R"] = "$year$ Davis Cup World Group",
					default = "$year$ Davis Cup"
				}
			},
			default = "$year$ Davis Cup"
		},
		group = {
			type = "switch",
			param = "group",
			["1"] = "I",
			["2"] = "II",
		},
		region = {
			type = "switch",
			param = "country",
			default = "(region needed)",
			AUT = "Europe/Africa",
			BUL = "Europe/Africa",
			ESP = "Europe/Africa",
			SRB = "Europe/Africa",
			USA = "Americas",
		}
	},
	["World Team Cup"] = {
		name = "World Team Cup",
		absence = {
			type = "chrono",
			{2012, "X"},
			{1975}
		}
	}
}
-- aliases
tennis.tournaments["GPMS Indian Wells"] = tennis.tournaments["1000 Indian Wells"]
tennis.tournaments["GPMS Miami"] = tennis.tournaments["1000 Miami"]
tennis.tournaments["GPMS Monte Carlo"] = tennis.tournaments["1000 Monte Carlo"]
tennis.tournaments["GPMS Hamburg"] = tennis.tournaments["1000 Hamburg"]
tennis.tournaments["GPMS Rome"] = tennis.tournaments["1000 Rome"]
tennis.tournaments["GPMS Canada"] = tennis.tournaments["1000 Canada"]
tennis.tournaments["GPMS Cincinnati"] = tennis.tournaments["1000 Cincinnati"]
tennis.tournaments["GPMS Stockholm"] = tennis.tournaments["1000 Stockholm"]
tennis.tournaments["GPMS Paris"] = tennis.tournaments["1000 Paris"]
-- Populate years Summer Olympics were held.
for year = 1960, 2060, 4 do
	tennis.tournaments["Summer Olympics"].absence[tostring(year)] = "A"
end

return tennis