User:Chinissai/Tennis performance timeline
This template produces a performance timeline table for articles on tennis players and their career statistics.
As of April 27, 2017, the template is under development and only works with male tennis players.
Usage
[edit]The template's syntax is as follows:
{{User:Chinissai/Tennis performance timeline |types=<tournament levels> |country=<code> <season statistics> <season statistics> ... <season statistics> |last=<tournament> |prizemoney=... }}
Named parameters have the following descriptions:
|types=
: the tournament levels to be displayed in the performance timeline table. The<tournament levels>
is a comma-separated list, e.g.,GS,Career
. A tournament level is a string in theorder
entry intennis.orders
within Module:Tennis performance timeline/data, or the stringCareer
to display career win–loss and tournament counts. If|types=
is omitted, all applicable tournament levels and career statistics will be included in the performance timeline table.|country=
: the ISO 3166-1 alpha-3 country code for the player's nationality. This optional parameter is only used in the statistics for player's national representation, such as in the Olympics, Davis Cup, and Fed Cup.|last=
: the last tournament whose statistics is included in the performance timeline table. The<tournament>
is a string entry in Module:Tennis performance timeline/calendar, e.g.,GS Roland Garros
. Not only does this optional parameter serve as a note to editors, but it will also trigger the performance table to display an absence of the player from a tournament that has already concluded in the current year. Therefore, performance timeline tables should be updated only at the conclusion of a tournament. If|last=
is unspecified, no absence in the current year will be displayed in the table.|prizemoney=
: the prize money the player has won. The value of this optional parameter is displayed boldface, but otherwise as is, in the lower-right cell of the performance timeline table.
Statistics for older seasons should appear before statistics for more recent ones.
Season statistics
[edit]The statistics for each season has the following syntax:
|year|<year> <tournament statistics> <tournament statistics> ... <tournament statistics> <court statistics> <court statistics> ... <court statistics> |rank|<rank>
The specification for each season's statistics begins with the (mandatory) year of the season, e.g., |year|2017
, and ends with the optional year-end ranking, e.g., |rank|1
.
Tournament and court statistics can be intertwined, but this style is not recommended.
Tournament statistics
[edit]The statistics for each tournament has the following syntax:
|<tournament name>|<outcome>|<wins>|<losses>
<tournament name>
is a table key intennis.tournaments
within Module:Tennis performance timeline/data, e.g.,GS Wimbledon
and1000 Indian Wells
. To add a new or missing tournament, please submit a request on the template's talk page.<outcome>
is the player's outcome of the tournament. This is a table key intennis.rounds
within Module:Tennis performance timeline/data, e.g.,W
and4R
, except for Davis Cup zones, where the zone number followsZ
, as inZ1
.<wins>
and<losses>
are the official match wins and losses for the tournament. For instance, qualifying matches and walkovers are not counted and should not be included in the wins and losses.
Each tournament's statistics populates a cell within the performance timeline table. This cell might include a wikilink to the appropriate article for that tournament in the respective year. A red link indicates that the specifications of the tournament are incomplete; please report red links on the template's talk page.
Court statistics
[edit]The statistics for each court type has the following syntax:
|<environment>|<surface>|<tournament count>|<wins>|<losses>|<titles>|<runnerups>
<environment>
is eitheroutdoor
orindoor
<surface>
is a court surface, a table key intennis.surfaces
within Module:Tennis performance timeline/data. Currently, this is one ofhard
,clay
,grass
, andcarpet
.<tournament count>
is the number of tournaments played in this court type.<wins>
and<wins>
are the official match wins and losses for this court type.<titles>
is the number of titles won in this court type.<runnerups>
is the number of final matches reached in this court type without winning a title.
Court types without an official match should be omitted.
Examples
[edit]Examples reflect Roger Federer's statistics from 2012 to 2013
Full display
[edit]This is the template's default behavior.
{{User:Chinissai/Tennis performance timeline
|country=SUI
|year|2012
|GS Australian Open|SF|4|1
|Davis Cup|1R|2|1
|1000 Indian Wells|W|6|0
|1000 Miami|3R|1|1
|1000 Madrid|W|5|0
|1000 Rome|SF|3|1
|GS Roland Garros|SF|5|1
|GS Wimbledon|W|7|0
|Summer Olympics|F-S|5|1
|1000 Cincinnati|W|5|0
|GS US Open|QF|3|1
|1000 Shanghai|SF|3|1
|World Tour Finals|F|3|2
|outdoor|hard|8|30|4|3|0
|outdoor|clay|3|15|2|1|0
|outdoor|grass|3|15|2|1|2
|indoor|hard|3|11|3|1|2
|indoor|clay|0|0|1|0|0
|rank|2
|year|2013
|GS Australian Open|SF|5|1
|1000 Indian Wells|QF|3|1
|1000 Madrid|3R|1|1
|1000 Rome|F|4|1
|GS Roland Garros|QF|4|1
|GS Wimbledon|2R|1|1
|1000 Cincinnati|QF|2|1
|GS US Open|4R|3|1
|1000 Shanghai|3R|1|1
|1000 Paris|SF|3|1
|World Tour Finals|SF|2|2
|outdoor|hard|6|17|6|0|0
|outdoor|clay|5|12|5|0|1
|outdoor|grass|2|5|1|1|0
|indoor|hard|4|11|5|0|1
|rank|6
}}
|
|
With specified types
[edit]A single type in |types=
generates a short-form table.
{{User:Chinissai/Tennis performance timeline
|types=GS
|country=SUI
|year|2012
|GS Australian Open|SF|4|1
|Davis Cup|1R|2|1
|1000 Indian Wells|W|6|0
|1000 Miami|3R|1|1
|1000 Madrid|W|5|0
|1000 Rome|SF|3|1
|GS Roland Garros|SF|5|1
|GS Wimbledon|W|7|0
|Summer Olympics|F-S|5|1
|1000 Cincinnati|W|5|0
|GS US Open|QF|3|1
|1000 Shanghai|SF|3|1
|World Tour Finals|F|3|2
|outdoor|hard|8|30|4|3|0
|outdoor|clay|3|15|2|1|0
|outdoor|grass|3|15|2|1|2
|indoor|hard|3|11|3|1|2
|indoor|clay|0|0|1|0|0
|rank|2
|year|2013
|GS Australian Open|SF|5|1
|1000 Indian Wells|QF|3|1
|1000 Madrid|3R|1|1
|1000 Rome|F|4|1
|GS Roland Garros|QF|4|1
|GS Wimbledon|2R|1|1
|1000 Cincinnati|QF|2|1
|GS US Open|4R|3|1
|1000 Shanghai|3R|1|1
|1000 Paris|SF|3|1
|World Tour Finals|SF|2|2
|outdoor|hard|6|17|6|0|0
|outdoor|clay|5|12|5|0|1
|outdoor|grass|2|5|1|1|0
|indoor|hard|4|11|5|0|1
|rank|6
}}
|
|
The |types=
parameter can be a list of comma-separated values. The career summary is unaffected by specified types.
{{User:Chinissai/Tennis performance timeline
|types=ATP1000,Career
|country=SUI
|year|2012
|GS Australian Open|SF|4|1
|Davis Cup|1R|2|1
|1000 Indian Wells|W|6|0
|1000 Miami|3R|1|1
|1000 Madrid|W|5|0
|1000 Rome|SF|3|1
|GS Roland Garros|SF|5|1
|GS Wimbledon|W|7|0
|Summer Olympics|F-S|5|1
|1000 Cincinnati|W|5|0
|GS US Open|QF|3|1
|1000 Shanghai|SF|3|1
|World Tour Finals|F|3|2
|outdoor|hard|8|30|4|3|0
|outdoor|clay|3|15|2|1|0
|outdoor|grass|3|15|2|1|2
|indoor|hard|3|11|3|1|2
|indoor|clay|0|0|1|0|0
|rank|2
|year|2013
|GS Australian Open|SF|5|1
|1000 Indian Wells|QF|3|1
|1000 Madrid|3R|1|1
|1000 Rome|F|4|1
|GS Roland Garros|QF|4|1
|GS Wimbledon|2R|1|1
|1000 Cincinnati|QF|2|1
|GS US Open|4R|3|1
|1000 Shanghai|3R|1|1
|1000 Paris|SF|3|1
|World Tour Finals|SF|2|2
|outdoor|hard|6|17|6|0|0
|outdoor|clay|5|12|5|0|1
|outdoor|grass|2|5|1|1|0
|indoor|hard|4|11|5|0|1
|rank|6
}}
|
|
More examples can be found in subpages of this template.