{"id":16364589,"url":"https://github.com/keyurparalkar/render-million-rows","last_synced_at":"2025-03-16T15:32:46.337Z","repository":{"id":227794335,"uuid":"772404924","full_name":"keyurparalkar/render-million-rows","owner":"keyurparalkar","description":"A project to demonstrate rendering 1 million rows in React","archived":false,"fork":false,"pushed_at":"2024-04-22T14:51:53.000Z","size":66984,"stargazers_count":38,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-16T03:41:26.174Z","etag":null,"topics":["canvas","css","html5","javascript","papaparse","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/keyurparalkar.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":"2024-03-15T05:59:28.000Z","updated_at":"2025-03-10T06:04:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbda3275-7bf9-434b-88c8-a2468721fc00","html_url":"https://github.com/keyurparalkar/render-million-rows","commit_stats":null,"previous_names":["keyurparalkar/render-million-rows"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyurparalkar%2Frender-million-rows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyurparalkar%2Frender-million-rows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyurparalkar%2Frender-million-rows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyurparalkar%2Frender-million-rows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyurparalkar","download_url":"https://codeload.github.com/keyurparalkar/render-million-rows/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243891283,"owners_count":20364575,"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":["canvas","css","html5","javascript","papaparse","reactjs","typescript"],"created_at":"2024-10-11T02:30:50.095Z","updated_at":"2025-03-16T15:32:45.154Z","avatar_url":"https://github.com/keyurparalkar.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Render One Million Rows By Drawing\n\nThis project is a demonstration of how you can render 1 million rows in a table by drawing. I made use of the canvas API to achieve this task. \nI have also demonstrated this project as a part of the talk in Reactjs-pune meetup. Details about the talk can be found below:\n* Slides - [Render Million Rows.pdf](https://github.com/keyurparalkar/render-million-rows/files/15064694/Render.Million.Rows.pdf)\n* [Talk](https://www.meetup.com/reactjs-and-friends/events/299595472/)\n\n\n## Data Source\n\nI took this repository as my data source - [https://github.com/datablist/sample-csv-files](https://github.com/datablist/sample-csv-files). It contains sample CSV data for a range of rows, i.e., 0.5M, 1M rows, etc.\n\n## Inspiration\n\nI got inspired to do this project when I was exploring how Google Sheets are able to render 0.5 million rows. I also got inspired by the Glide Apps Data Grid library, which helped me understand the concept of canvas drawing: [https://github.com/glideapps/glide-data-grid](https://github.com/glideapps/glide-data-grid).\n\n## Approach\n\nI took an approach of drawing each and every row of a CSV file onto a target canvas that displays these rows. Once the CSV data is loaded, a worker is created that creates an offscreen canvas based on the scroll top value. This offscreen canvas will have 100 rows drawn onto it.\n\nI make use of the `drawImage` function to blit the rows from the offscreen canvas to the target canvas. This happens on every scroll.\n\nHere is a short video that demonstrates ~1 Million rows drawn:\n\n[https://github.com/keyurparalkar/render-million-rows/assets/14138515/348a7267-651a-4b47-aa42-9472318effa4](https://github.com/keyurparalkar/render-million-rows/assets/14138515/348a7267-651a-4b47-aa42-9472318effa4)\n\nAlso, I was able to render ~2 Million rows as well:\n\n[https://github.com/keyurparalkar/render-million-rows/assets/14138515/1cf80b9d-bd0c-449c-a0de-0322e1536a7b](https://github.com/keyurparalkar/render-million-rows/assets/14138515/1cf80b9d-bd0c-449c-a0de-0322e1536a7b)\n\n## Future Enhancement\n\n- Improve the current blitting approach by self-blitting the target canvas.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyurparalkar%2Frender-million-rows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyurparalkar%2Frender-million-rows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyurparalkar%2Frender-million-rows/lists"}