{"id":19838665,"url":"https://github.com/brayvid/covidreportnyc","last_synced_at":"2025-06-17T16:36:33.471Z","repository":{"id":231398110,"uuid":"313019913","full_name":"brayvid/covidreportnyc","owner":"brayvid","description":"View the latest Covid-19 trends for NYC in a simple web interface.","archived":false,"fork":false,"pushed_at":"2025-06-01T08:12:58.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T16:46:19.116Z","etag":null,"topics":["chart-js","covid-19","dashboard","netlify","new-york-city","open-data","public-health","web-app"],"latest_commit_sha":null,"homepage":"https://covidnyc.blakerayvid.com","language":"HTML","has_issues":false,"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/brayvid.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":"2020-11-15T11:51:14.000Z","updated_at":"2025-06-01T08:28:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e251077-32b5-4ae4-857f-f66197215b57","html_url":"https://github.com/brayvid/covidreportnyc","commit_stats":null,"previous_names":["brayvid/covidreportnyc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brayvid/covidreportnyc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brayvid%2Fcovidreportnyc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brayvid%2Fcovidreportnyc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brayvid%2Fcovidreportnyc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brayvid%2Fcovidreportnyc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brayvid","download_url":"https://codeload.github.com/brayvid/covidreportnyc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brayvid%2Fcovidreportnyc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260399858,"owners_count":23003262,"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":["chart-js","covid-19","dashboard","netlify","new-york-city","open-data","public-health","web-app"],"created_at":"2024-11-12T12:18:37.314Z","updated_at":"2025-06-17T16:36:28.461Z","avatar_url":"https://github.com/brayvid.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Covid Report NYC Dashboard\n\nhttps://covidreportnyc.netlify.app/\n\nThis website fetches recent Covid-19 data from [NYC Health Department](https://github.com/nychealth/coronavirus-data), displays key statistics for the last few days (cases, hospitalizations, deaths), and plots a scatter chart to visualize the trend of cases over the last 30 days. All functionality is on the client-side.\n\n### Architecture\n1. **Fetch and Parse CSV Data:**\n- The `getDataCSV` function is responsible for fetching a CSV file from a remote URL: `https://raw.githubusercontent.com/nychealth/coronavirus-data/master/trends/data-by-day.csv`.\n- An `XMLHttpRequest` is used to send an asynchronous HTTP GET request to retrieve the CSV data.\n- Once the request is successful (HTTP status 200), the function verifies if the response is of type `text/csv`.\n- The CSV data is parsed by splitting the response into lines and using a helper function (`getCsvValuesFromLine`) to break each line into individual values (CSV columns).\n- The parsed data is stored in a global variable `days`.\n\n2. **Display Latest Data:**\n- The function retrieves the 7-day average of cases, hospitalizations, and deaths, from the parsed CSV data.\n- It extracts the most recent three entries: one for each metric—cases, hospitalizations, and deaths.\n- These values are then inserted into HTML elements (with IDs `cases`, `hosp`, and `deaths`) to display the data on a web page.\n\n3. **Generate a Scatter Plot:**\n- The `scatterPlot` function takes the most recent 30 days of case count data (7-day averages) and creates an array of objects with `x` (representing days relative to today) and `y` (representing case count averages).\n- This data is then plotted as a scatter chart using Chart.js. The x-axis represents the days (from -30 to 0), and the y-axis shows the number of cases.\n- The chart is rendered on an HTML canvas element with the ID `myChart`.\n\n4. **Helper Function for CSV Parsing:**\n- `getCsvValuesFromLine`: This helper function splits a CSV line by commas and removes any quotation marks (`\"`) around the values.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrayvid%2Fcovidreportnyc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrayvid%2Fcovidreportnyc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrayvid%2Fcovidreportnyc/lists"}