{"id":30432042,"url":"https://github.com/dhvcc/github-contribution-treemap-generator","last_synced_at":"2025-10-07T02:06:45.043Z","repository":{"id":310719382,"uuid":"1040165463","full_name":"dhvcc/github-contribution-treemap-generator","owner":"dhvcc","description":"GitHub contribution treemap SVG generator","archived":false,"fork":false,"pushed_at":"2025-08-19T19:33:14.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T21:26:42.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhvcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-08-18T14:53:36.000Z","updated_at":"2025-08-19T19:33:17.000Z","dependencies_parsed_at":"2025-08-25T05:30:45.390Z","dependency_job_id":null,"html_url":"https://github.com/dhvcc/github-contribution-treemap-generator","commit_stats":null,"previous_names":["dhvcc/github-contribution-treemap-generator"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dhvcc/github-contribution-treemap-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhvcc%2Fgithub-contribution-treemap-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhvcc%2Fgithub-contribution-treemap-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhvcc%2Fgithub-contribution-treemap-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhvcc%2Fgithub-contribution-treemap-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhvcc","download_url":"https://codeload.github.com/dhvcc/github-contribution-treemap-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhvcc%2Fgithub-contribution-treemap-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278708004,"owners_count":26031932,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-22T20:32:15.131Z","updated_at":"2025-10-07T02:06:45.025Z","avatar_url":"https://github.com/dhvcc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Contribution Treemap Generator\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./treemap.svg\" /\u003e\n\u003c/div\u003e\n\nGitHub contributions as an SVG treemap. Built with [d3](https://github.com/d3/d3)\n\nIt counts merged PRs you authored across repos, sizes by your contributions, and colors by repo stars.\n\n![Version](https://img.shields.io/github/package-json/version/dhvcc/github-contribution-treemap-generator)\n[![License](https://img.shields.io/pypi/l/rss-parser?color=success)](https://github.com/dhvcc/rss-parser/blob/master/LICENSE)\n\n![NPM/GitHub publish](https://github.com/dhvcc/github-contribution-treemap-generator/actions/workflows/publish.yml/badge.svg)\n\n\n## Install\n\n```bash\nnpm i -g @dhvcc/github-contribution-treemap-generator\n# for project install, use\nnpm i @dhvcc/github-contribution-treemap-generator\n```\n\n## Quick start (CLI)\n\n```bash\nexport GITHUB_TOKEN=YOUR_TOKEN\ngithub-contribution-treemap-generator -o treemap.svg\n```\n\n- Without `-o`, SVG goes to stdout\n- If you don't pass `--username`, it auto-detects from the token\n\n## Usage\n\n```man\nUsage: github-contribution-treemap-generator [options]\n\nGitHub contribution treemap SVG generator\n\nOptions:\n  -V, --version              output the version number\n  -t, --token \u003ctoken\u003e        GitHub personal access token (env: GITHUB_TOKEN)\n  -u, --username \u003cusername\u003e  GitHub username (auto-detected if not provided) (env: GITHUB_USERNAME)\n  -o, --output \u003cfile\u003e        Output file path (default: stdout)\n  -w, --width \u003cpixels\u003e       SVG width in pixels (default: 465, env: WIDTH)\n  --height \u003cpixels\u003e          SVG height in pixels (default: 165, env: HEIGHT)\n  --exclude-repos \u003crepos\u003e    Comma-separated list of repos to exclude (default: none) (default: \"\", env: EXCLUDE_REPOS)\n  --exclude-owners \u003cowners\u003e  Comma-separated list of owners to hide (default: none) (default: \"\", env: EXCLUDE_OWNERS)\n  --timeout \u003cms\u003e             GitHub API timeout in milliseconds (default: 15000, env: GITHUB_TIMEOUT_MS)\n  --github-base-url \u003curl\u003e    GitHub GraphQL API base URL (default: \"https://api.github.com/graphql\", env: GITHUB_BASE_URL)\n  -q, --quiet                Suppress non-error logs\n  -h, --help                 display help for command\n\nEnvironment variables:\n  GITHUB_TOKEN           Required unless --token is provided\n  GITHUB_USERNAME        Username, otherwise auto-detected from token\n  EXCLUDE_REPOS          Comma-separated repos to exclude (default: none)\n  EXCLUDE_OWNERS            Comma-separated owners to hide (default: none)\n  WIDTH                  SVG width in pixels (default 465)\n  HEIGHT                 SVG height in pixels (default 165)\n  GITHUB_TIMEOUT_MS      GitHub API timeout in ms (default 15000)\n  GITHUB_BASE_URL        GitHub GraphQL API base URL (default https://api.github.com/graphql)\n  QUIET=0                Suppress non-error logs\n\n```\n\n## Examples\n\n```bash\n# Save to file\ngithub-contribution-treemap-generator -t $GITHUB_TOKEN -o treemap.svg\n\n# Custom size\ngithub-contribution-treemap-generator -t $GITHUB_TOKEN -w 800 --height 400 -o treemap.svg\n\n# Hide my org and exclude a repo\ngithub-contribution-treemap-generator -t $GITHUB_TOKEN -H my-org -e owner/repo,another-repo -o treemap.svg\n\n# Print to stdout (pipe to file)\ngithub-contribution-treemap-generator -t $GITHUB_TOKEN \u003e treemap.svg\n```\n\n## Use as a library\n\n```ts\nimport { generateContributionTreemap } from '@dhvcc/github-contribution-treemap-generator';\n\nconst svg = await generateContributionTreemap(process.env.GITHUB_TOKEN!, {\n  username: 'your-username',\n  width: 800,\n  height: 400,\n  excludeRepos: ['owner/repo', 'name-only'],\n  hideOwners: ['some-org'],\n});\n```\n\n## Notes\n\n- Public data only. A basic token is fine for public repos\n- Uses GitHub GraphQL search for merged PRs you authored (`is:pr is:merged author:\u003cyou\u003e`)\n\n## License\n\n[GPLv3](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhvcc%2Fgithub-contribution-treemap-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhvcc%2Fgithub-contribution-treemap-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhvcc%2Fgithub-contribution-treemap-generator/lists"}