| Title: | Shiny App of The Famous 151 First Pokemons |
|---|---|
| Description: | Discover everything you want to know about your favorites pokemon. Data are taken from the awesome API <https://pokeapi.co>. |
| Authors: | David Granjon [aut, cre], RinteRface [cph] |
| Maintainer: | David Granjon <[email protected]> |
| License: | GPL-2 |
| Version: | 0.2.0 |
| Built: | 2026-05-28 07:48:30 UTC |
| Source: | https://github.com/DivadNojnarg/shinyMons |
Function that calculates the damages of an attack on a given opponent
calculate_damages(current_attack, current_pokemon, opponent, types)calculate_damages(current_attack, current_pokemon, opponent, types)
current_attack |
The currently selected attack. |
current_pokemon |
Id of the randomly generated pokemon who is attacking. |
opponent |
Opponent type. Useful for effectiveness calculations. |
types |
Object containing all pokemons types strenght and weaknesses. |
As already explained, I only consider physical attacks...
Function that calculate a given stat of a pokemon based on its level.
compute_stat(level, base_stat)compute_stat(level, base_stat)
level |
Current pokemon level. |
base_stat |
Stat to be scaled. |
To be used in generate_pokemons.
Function that generates a timelineItem for each attack the pokemon does.
fight_History(attacking, opponent, current_attack, damages)fight_History(attacking, opponent, current_attack, damages)
attacking |
Id of the randomly generated pokemon who is attacking. |
opponent |
Opponent type. Useful for effectiveness calculations. |
current_attack |
The currently selected attack. |
damages |
Result of calculate_damages witht the current_attack. TRUE in this case. |
Function that generate 2 random pokemons. Levels are between 1 and 100 and ids are between 1 and 151
generate_pokemons(mainData, sprites, difficulty, attacks)generate_pokemons(mainData, sprites, difficulty, attacks)
mainData |
Object containing the main pokemon data. |
sprites |
Object containing pokemon images. |
difficulty |
Game difficulty. |
attacks |
Object containing pokemon attacks. |
Aggregated list of pokemon attacks data
poke_attackspoke_attacks
## 'who' A list with 'r length(poke_attacks)' elements.
<https://pokeapi.co/docs/v2>
Aggregated list of pokemon data
poke_datapoke_data
## 'who' A list with 'r length(poke_data)' elements:
Pokemon name
Pokemon description
Pokemon shape
...
<https://pokeapi.co/docs/v2>
UI module for generating the pokemon evolution timeline
Server module generating the pokemon evolution timeline
poke_evol_ui(id) poke_evol_server(id, selected, shiny)poke_evol_ui(id) poke_evol_server(id, selected, shiny)
id |
character used to specify namespace, see |
selected |
Input containing the selected pokemon index. |
shiny |
Whether to display a shiny version. FALSE by default. |
a shiny::tagList containing UI elements
Server module generating the pokemon info cards
poke_infos_server(id, selected, shiny)poke_infos_server(id, selected, shiny)
id |
Module id. |
selected |
Input containing the selected pokemon index. |
shiny |
Whether to display a shiny version. FALSE by default. |
UI module for generating the pokemon info cards
poke_infos_ui(id)poke_infos_ui(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
UI module for generating the pokemon location card
Server module generating the pokemon location card
poke_locations_ui(id) poke_locations_server(id, selected)poke_locations_ui(id) poke_locations_server(id, selected)
id |
character used to specify namespace, see |
selected |
Input containing the selected pokemon index. |
a shiny::tagList containing UI elements
UI module for sorting pokemon
Server module generating the pokemon interface
poke_moves_ui(id) poke_moves_server(id, selected)poke_moves_ui(id) poke_moves_server(id, selected)
id |
character used to specify namespace, see |
selected |
Input containing the selected pokemon index. |
a shiny::tagList containing UI elements
Useful data to reconstruct with visNetwork htmlWidget.
poke_networkpoke_network
## 'who' A list with nodes and edges dataframes. For the node dataframe:
Pokemon id
Pokemon name
Pokemon family
Pokemon sprite
Node shape
Node value
For edges:
Pokemon previous stage
Pokemon next stage
Evolution detail
Direction of arrows
<https://pokeapi.co/docs/v2#evolution-section>
Server module generating the pokemon interface
poke_select_server(id, selected)poke_select_server(id, selected)
id |
Module id. |
selected |
Object containing the selected pokemon in the network, if not NULL. |
UI module for sorting pokemon
poke_select_ui(id)poke_select_ui(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
Server module generating the pokemon stats chart
poke_stats_server(id, selected)poke_stats_server(id, selected)
id |
Module id. |
selected |
Input containing the selected pokemon index. |
UI module for generating the pokemon stats chart
poke_stats_ui(id)poke_stats_ui(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
UI module for generating the pokemon type
Server module generating the pokemon types info boxes
poke_types_ui(id) poke_types_server(id, selected)poke_types_ui(id) poke_types_server(id, selected)
id |
character used to specify namespace, see |
selected |
Input containing the selected pokemon index. |
a shiny::tagList containing UI elements
Server module for generating the pokeAttacks section
pokeAttack(input, output, session, attacks)pokeAttack(input, output, session, attacks)
input |
Shiny inputs. |
output |
Shiny outputs. |
session |
Shiny session. |
attacks |
Data containing all pokemon abilities in the first generation. |
UI module for generating the pokeAttacks section
pokeAttackUi(id)pokeAttackUi(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
Server module for generating the pokeFight section
pokeFight(input, output, session, mainData, sprites, attacks, types)pokeFight(input, output, session, mainData, sprites, attacks, types)
input |
Shiny inputs. |
output |
Shiny outputs. |
session |
Shiny session. |
mainData |
Object containing the main pokemon data. |
sprites |
Object containing pokemon images. |
attacks |
Object containing pokemon attacks. |
types |
Object containing all pokemon types. |
UI module for generating the pokeFight section
pokeFightUi(id)pokeFightUi(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
Server module generating the pokemon gallery interface
pokeGallery(input, output, session, mainData, details, shiny)pokeGallery(input, output, session, mainData, details, shiny)
input |
Shiny inputs. |
output |
Shiny outputs. |
session |
Shiny session. |
mainData |
Object containing the main pokemon data. |
details |
Object containing extra pokemon details. |
shiny |
Whether to display a shiny version. FALSE by default. |
UI module for generating the gallery of the first 151 pokemons
pokeGalleryUi(id)pokeGalleryUi(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
Server module for generating the pokeNetwork section
pokeNetwork( input, output, session, mainData, details, families, groups, mobile )pokeNetwork( input, output, session, mainData, details, families, groups, mobile )
input |
Shiny inputs. |
output |
Shiny outputs. |
session |
Shiny session. |
mainData |
All pokemon main data. |
details |
Object containing extra pokemon details. |
families |
List containg all pokemon connections. |
groups |
List containing data for grouping pokemons by evolution family. |
mobile |
Shiny input checking if the app is running on a cellphone/tablet. |
UI module for generating the pokeNetwork section
pokeNetworkUi(id)pokeNetworkUi(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
Server module generating other stats chart
pokeOther(input, output, session, mainData, details)pokeOther(input, output, session, mainData, details)
input |
Shiny inputs. |
output |
Shiny outputs. |
session |
Shiny session. |
mainData |
Object containing the main pokemon data. |
details |
Object containing extra pokemon details. |
UI module for generating other stats chart
pokeOtherUi(id)pokeOtherUi(id)
id |
character used to specify namespace, see |
a shiny::tagList containing UI elements
Unleash the pokemon app
run_pokemons()run_pokemons()
if (interactive()) { run_pokemon() }if (interactive()) { run_pokemon() }
Function that list all possible learnable moves for a pokemon and select only 4 moves.
select_attacks(mainData, attacks, current_pokemon_id)select_attacks(mainData, attacks, current_pokemon_id)
mainData |
Object containing the main pokemon data. |
attacks |
Object containing all pokemon attacks data. |
current_pokemon_id |
Id of the randomly generated pokemon. |
Limitations: only physical moves are considered for the moment. This function has to be called inside generate_pokemons.
Discover everything you want to know about your favorites pokemon. Data are taken from the awesome API https://pokeapi.co.
Maintainer: David Granjon [email protected]
Other contributors:
RinteRface [copyright holder]
Useful links:
Report bugs at https://github.com/DivadNojnarg/shinyMons/issues