{"id":21293366,"url":"https://github.com/ejw-data/plotly-dashboard-nba-championship","last_synced_at":"2025-03-15T16:44:36.576Z","repository":{"id":106650272,"uuid":"508725241","full_name":"ejw-data/plotly-dashboard-nba-championship","owner":"ejw-data","description":"Simple dashboard utilizing the NBA api to obtain play-by-play data that is filtered and aggregated for several plotly charts.  The dashboard uses several controls on the page for filtering.","archived":false,"fork":false,"pushed_at":"2023-06-18T16:52:05.000Z","size":849,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T06:47:20.700Z","etag":null,"topics":["bootstrap5","flask-application","html-css-javascript","plotly","proxy-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ejw-data.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-29T14:26:48.000Z","updated_at":"2023-06-18T16:54:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"66f1fb33-9e8b-4237-80a2-49ad2d4d6757","html_url":"https://github.com/ejw-data/plotly-dashboard-nba-championship","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejw-data%2Fplotly-dashboard-nba-championship","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejw-data%2Fplotly-dashboard-nba-championship/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejw-data%2Fplotly-dashboard-nba-championship/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejw-data%2Fplotly-dashboard-nba-championship/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejw-data","download_url":"https://codeload.github.com/ejw-data/plotly-dashboard-nba-championship/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243762236,"owners_count":20343976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap5","flask-application","html-css-javascript","plotly","proxy-server"],"created_at":"2024-11-21T13:54:28.923Z","updated_at":"2025-03-15T16:44:36.567Z","avatar_url":"https://github.com/ejw-data.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plotly-dashboard-nba-championship\n\nAuthor:  Erin James Wills, ejw.data@gmail.com  \n\n![2022 NBA Championship](./images/nba-dashboard.png)\n\u003ccite\u003ePhoto by [Kenny Eliason](https://unsplash.com/@neonbrand?utm_source=unsplash\u0026utm_medium=referral\u0026utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/nba?utm_source=unsplash\u0026utm_medium=referral\u0026utm_content=creditCopyText)\u003c/cite\u003e\n\u003cbr\u003e\n\n## Overview  \n\u003chr\u003e\n\nSimple dashboard utilizing the NBA api to obtain play-by-play data that is filtered and aggregated for several plotly charts.  The dashboard uses several controls on the page for filtering.\n\n\u003cbr\u003e\n\n## Github Pages  \nNote:  Proxy server needs to be running for the page to be viewable\nhttps://ejw-data.github.io/plotly-dashboard-nba-championship/  \n   \n\n\u003cbr\u003e\n\n## Technologies    \n*  HTML/CSS/JS\n*  Plotly.js\n*  Flask Proxy Server\n\n\u003cbr\u003e\n\n## Data Source  \n\nBelow is an example of how to form the api endpoint.  The information is specific to a particular game and the game id comes from https://www.nba.com/.  This information is often found in the url of the box score page.  \n\n`date` = '20220602'   \n`game_id` = '0042100401'  \n`quarter` = 1    \n\nurl = `https://data.nba.net/prod/v1/`\u003c date \u003e`/`\u003c game_id \u003e`_pbp_`\u003c quarter \u003e`.json`;   \n\n**Update**  \nThe api was replaced with another api but the new api does not work unless a proxy server modifies the headers.  The new url information is as follows:  \n\n`game_id` = '0042100401'  \n`proxyServer` = 'http://localhost:5000/'\n\nurl = \u003c proxyServer \u003e`https://cdn.nba.com/static/json/liveData/playbyplay/playbyplay_`\u003c game_id \u003e`.json`  \n\nNote:  The proxy server is a flask app run locally.\n\n\u003cbr\u003e\n\n## Setup and Installation  \n1. Clone the repo to your local machine\n1. Open repo folder in an IDE like VSCode\n1. Using a virtual server like the VSCode extention LiveServer\n1. Run `index.html`  \n1. Due CORS block, you may need to apply a method to insert the correct headers so the api will load.  \n    * Option 1:  Run a browser extension to bypass these restrictions.  I have been using the Chrome extension called \"Moesif Origin \u0026 CORS Changer\".  This extension has a toggle button to turn it on and off easily.  The page should display at this point assuming you have changed the `proxyserver` variable in `app.js` to \"\".  \n    * Option 2:  This is how the repo is currently setup to run - First run the flask proxy server by navigating to the proxy folder in the repo in a terminal and running the flask server by typing `python proxy.py`.  Now when you open the index.html, it should load the data and graphics.  \n\n\u003cbr\u003e\n\n## Example\n\n![Dashboard](./images/dashboard-screenshot.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejw-data%2Fplotly-dashboard-nba-championship","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejw-data%2Fplotly-dashboard-nba-championship","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejw-data%2Fplotly-dashboard-nba-championship/lists"}