- TennisPlayer
Class representing a tennis player.
- Statistics
Class representing a player's overall statistics.
- Ranking
Class representing a player's ranking
- initializePlayer() ⇒
Player
Initializes player. If data in local storage exists, retrieves them. If not, dummy data are shown to the user.
- displayPlayerInfo()
Creates table with player's basic info
- displayPlayerStatistics()
Creates tables with player's statistics (service & return records)
- displayPlayerRanking()
Create table with player's ranking (by year)
- createSection(headerStr, categoryIconSrc, categoryIconAltTxt) ⇒
Element
Creates a section, along with its header and icon.
- createTable(keyValObj, tableId, header) ⇒
Array
Creates a new table based on a key-value object (populates its data).
- createRankingTable(tableId, header) ⇒
Array
Creates a new table (ranking) based on given a table id & a subcategory header.
- insertRankingRow()
Inserts a new row at the end of the ranking table.
- getBase64Image(img) ⇒
string
Given a img element, creates a 2d canvas & draws a base64 image.
- loadMainTitle()
Loads the main title (H1). If it is previous saved, retrieves it from local storage. Else, shows 'Enter Name Here'.
- keepNavBar()
Add the sticky class to the navigation bar when you reach its scroll position. Remove 'sticky' when you leave the scroll position.
- addSortingEventListeners()
Add event listeners for all columns, according to their class & id (word before the '-th')
- sortTable(id, n)
Sorts a table with the given ID, by clicked column. This will be triggered only when user clicks on a column.
- addVisibilityEventListeners()
Adds event listeners that refer to column's visibility. This function is triggered when the user clicks the 'eye' button.
- loadRankingChart()
Loads the ranking chart (disposes potential old ones first)
- addEventListenerToMainTitle()
Adds all the proper events listeners to H1 (title of page)
- saveDataToLocalStorage(element)
Given an element, saves its data to local storage properly.
- saveRankingToLocalStorage()
Saves ranking table data to local storage properly.
- setAutomaticCalculations()
Sets a number of automatic calculations that need to be done. This function is triggered when user changes specific data from a stats table.
- addEventListenersToTds()
Adds event listeners to tds (row cells). This function is triggered once at the begining (on load) & every time a users adds rows to ranking table.
- addEventListenersToSocialMedia()
Adds event listeners to social media icons in order to make their links editable by the user.
Class representing a tennis player.
Kind: global class
Creates a tennis player instance
Param | Type | Description |
---|---|---|
name | string |
Player's complete name |
birthday | string |
Player's birthday (MM/DD/YYYY) |
birthplace | string |
Player's birthplace (country name) |
citizenship | string |
Player's citizenship (country name) |
height | number |
Player's height (in meters) |
outfitter | string |
Player's outfitter (Brand's complete name) |
Returns a string representation of the player's instance
Kind: instance method of TennisPlayer
Creates a Map object with player's basic info.
Kind: instance method of TennisPlayer
Returns: Map
- a Map object
Class representing a player's overall statistics.
Kind: global class
Creates a statistics instance
Set complementary fields (for autocompletion) for service records.
Kind: instance method of Statistics
Set complementary fields (for autocompletion) for return records.
Kind: instance method of Statistics
Initialize data for singles service records.
Kind: instance method of Statistics
Initialize data for return records.
Kind: instance method of Statistics
Class representing a player's ranking
Creates a ranking instance
Param | Type | Description |
---|---|---|
high | array |
Array with the highest rankings (per year). |
end | array |
Array with the final rankings (per year). |
low | array |
Array with the lowest rankings (per year). |
Initializes player. If data in local storage exists, retrieves them. If not, dummy data are shown to the user.
Kind: global function
Returns: Player
- New player instance.
Creates table with player's basic info
Creates tables with player's statistics (service & return records)
Create table with player's ranking (by year)
Creates a section, along with its header and icon.
Kind: global function
Returns: Element
- Section's element
Param | Type | Description |
---|---|---|
headerStr | string |
The header's string |
categoryIconSrc | string |
Icon's src |
categoryIconAltTxt | string |
Icon's alternative text |
Creates a new table based on a key-value object (populates its data).
Kind: global function
Returns: Array
- Containing table & header's division
Param | Type | Description |
---|---|---|
keyValObj | string |
The key-value object |
tableId | Element |
Table's id |
header | Element |
Subcategory header |
Creates a new table (ranking) based on given a table id & a subcategory header.
Kind: global function
Returns: Array
- Containing table & header's division
Param | Type | Description |
---|---|---|
tableId | string |
Ranking table id |
header | Element |
Subcategory header |
Inserts a new row at the end of the ranking table.
Given a img element, creates a 2d canvas & draws a base64 image.
Kind: global function
Returns: string
- the url of the created image
Param | Type | Description |
---|---|---|
img | Element |
An image element |
Loads the main title (H1). If it is previous saved, retrieves it from local storage. Else, shows 'Enter Name Here'.
Add the sticky class to the navigation bar when you reach its scroll position. Remove 'sticky' when you leave the scroll position.
Add event listeners for all columns, according to their class & id (word before the '-th')
Sorts a table with the given ID, by clicked column. This will be triggered only when user clicks on a column.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The id of the table's element |
n | int |
The column number that will be sorted |
Adds event listeners that refer to column's visibility. This function is triggered when the user clicks the 'eye' button.
Loads the ranking chart (disposes potential old ones first)
Adds all the proper events listeners to H1 (title of page)
Given an element, saves its data to local storage properly.
Kind: global function
Param | Type | Description |
---|---|---|
element | Element |
A HTML element |
Saves ranking table data to local storage properly.
Sets a number of automatic calculations that need to be done. This function is triggered when user changes specific data from a stats table.
Adds event listeners to tds (row cells). This function is triggered once at the begining (on load) & every time a users adds rows to ranking table.
Adds event listeners to social media icons in order to make their links editable by the user.
Kind: global function