Skip to content

Commit

Permalink
Merge pull request #57 from MoenMi/fix-plotly-figure
Browse files Browse the repository at this point in the history
Fix Plotly rendering for Speedrun.com recipe
  • Loading branch information
vfscalfani authored Sep 25, 2024
2 parents a31a3a0 + fcdebe8 commit 388d27b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 47 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ launch_buttons:
binderhub_url: ""
jupyterhub_url: ""

sphinx:
config:
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
89 changes: 42 additions & 47 deletions src/python/speedrun.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,25 @@
"\n",
"The Speedrun\\.com API is licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/), allowing its data to be shared and adapted for non-commercial purposes as long as proper attribution is given. \n",
"\n",
"#### Key Features of the Speedrun\\.com API:\n",
"Key Features of the Speedrun\\.com API:\n",
"\n",
"1. **Game Information:**\n",
" - Retrieve detailed information about various games available on Speedrun\\.com, including game titles, release dates, and associated categories.\n",
"1. **Game Information:** Retrieve detailed information about various games available on Speedrun\\.com, including game titles, release dates, and associated categories.\n",
"\n",
"2. **Category Data:**\n",
" - Access information about different speedrunning categories for each game. Categories define specific rules and objectives for speedruns, such as \"Any%\", \"100%\", or unique challenges like \"16 Star\" in Super Mario 64.\n",
"2. **Category Data:** Access information about different speedrunning categories for each game. Categories define specific rules and objectives for speedruns, such as \"Any%\", \"100%\", or unique challenges like \"16 Star\" in Super Mario 64.\n",
"\n",
"3. **Leaderboards:**\n",
" - Fetch leaderboard data to see the top-performing speedruns for a particular game and category. This includes detailed run information, such as the runner, completion time, and submission date.\n",
"3. **Leaderboards:** Fetch leaderboard data to see the top-performing speedruns for a particular game and category. This includes detailed run information, such as the runner, completion time, and submission date.\n",
"\n",
"4. **Run Details:**\n",
" - Obtain comprehensive data about individual speedrun attempts, including player information, run times, and dates. This allows for in-depth analysis and tracking of speedrun progress and history.\n",
"4. **Run Details:** Obtain comprehensive data about individual speedrun attempts, including player information, run times, and dates. This allows for in-depth analysis and tracking of speedrun progress and history.\n",
"\n",
"5. **User Profiles:**\n",
" - Access user profile data to get information about speedrunners, including their usernames, social media links, and their submitted runs and achievements.\n",
"5. **User Profiles:** Access user profile data to get information about speedrunners, including their usernames, social media links, and their submitted runs and achievements.\n",
"\n",
"6. **Platform and Region Information:**\n",
" - Retrieve data related to the platforms (e.g., PC, console) and regions (e.g., NTSC, PAL) used for specific runs, providing context for different versions and conditions under which the runs were performed.\n",
"6. **Platform and Region Information:** Retrieve data related to the platforms (e.g., PC, console) and regions (e.g., NTSC, PAL) used for specific runs, providing context for different versions and conditions under which the runs were performed.\n",
"\n",
"#### Rate Limiting and Usage:\n",
"Rate Limiting and Usage:\n",
"\n",
"- **Rate Limit:**\n",
" - *Each IP address is allowed to perform a maximum of 100 requests per minute.* This rate limit ensures fair usage and prevents abuse of the API.\n",
"- **Rate Limit:** *Each IP address is allowed to perform a maximum of 100 requests per minute.* This rate limit ensures fair usage and prevents abuse of the API.\n",
"\n",
"- **Authentication:**\n",
" - While some endpoints are publicly accessible, certain actions and higher rate limits may require users to authenticate using their personal API keys, which can be obtained by registering on Speedrun\\.com.\n",
"- **Authentication:** While some endpoints are publicly accessible, certain actions and higher rate limits may require users to authenticate using their personal API keys, which can be obtained by registering on Speedrun\\.com.\n",
"\n",
"*These recipes were tested on September 18, 2024.*"
]
Expand Down Expand Up @@ -70,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -79,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -97,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -122,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 24,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -164,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 25,
"metadata": {},
"outputs": [
{
Expand All @@ -173,7 +165,7 @@
"2610"
]
},
"execution_count": 5,
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -192,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 26,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -227,7 +219,7 @@
" 'values': {'e8m7em86': '9qj7z0oq', 'kn04ewol': '4qyxop3l'}}}"
]
},
"execution_count": 6,
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -239,7 +231,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 27,
"metadata": {},
"outputs": [
{
Expand All @@ -250,7 +242,7 @@
" 'uri': 'https://www.speedrun.com/api/v1/users/zxzk1q9x'}]"
]
},
"execution_count": 7,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -270,7 +262,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 28,
"metadata": {},
"outputs": [
{
Expand All @@ -279,7 +271,7 @@
"'ikori_o'"
]
},
"execution_count": 8,
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -298,7 +290,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 29,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -346,7 +338,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 30,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -380,7 +372,7 @@
" 'values': {'e8m7em86': '9qj7z0oq', 'kn04ewol': '4qyxop3l'}}"
]
},
"execution_count": 10,
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -402,7 +394,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -417,7 +409,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 32,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -532,7 +524,7 @@
"12 46.466667 2023-12-09"
]
},
"execution_count": 12,
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -559,7 +551,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 33,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -604,7 +596,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 34,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -654,7 +646,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -670,7 +662,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 36,
"metadata": {},
"outputs": [
{
Expand All @@ -695,7 +687,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 37,
"metadata": {},
"outputs": [
{
Expand All @@ -704,7 +696,7 @@
"{'xqk9zzn1': 'No Skips', '81p4xxg1': 'Skips'}"
]
},
"execution_count": 17,
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -716,7 +708,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -733,7 +725,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -790,7 +782,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 48,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1705,8 +1697,11 @@
" yaxis=dict(showgrid=True) # Enable gridlines for the y-axis\n",
")\n",
"\n",
"# Display the plot in the notebook (if working in a Jupyter notebook)\n",
"fig.show()"
"# Write the plot to an HTML file for offline viewing or sharing\n",
"fig.write_html(\"figures/mkw-speedrun-plot.html\")\n",
"\n",
"# Display figure\n",
"fig"
]
}
],
Expand Down

0 comments on commit 388d27b

Please sign in to comment.