{"id":15760588,"url":"https://github.com/d3-node/choropleth-us-counties","last_synced_at":"2025-04-30T23:16:31.007Z","repository":{"id":49789888,"uuid":"101368865","full_name":"d3-node/choropleth-us-counties","owner":"d3-node","description":"Easy way to create a US County Choropleth with Node.js","archived":false,"fork":false,"pushed_at":"2017-08-25T05:22:54.000Z","size":642,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-30T23:16:13.667Z","etag":null,"topics":[],"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/d3-node.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}},"created_at":"2017-08-25T05:21:57.000Z","updated_at":"2022-07-26T13:47:58.000Z","dependencies_parsed_at":"2022-09-12T16:50:20.963Z","dependency_job_id":null,"html_url":"https://github.com/d3-node/choropleth-us-counties","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/d3-node%2Fchoropleth-us-counties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3-node%2Fchoropleth-us-counties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3-node%2Fchoropleth-us-counties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d3-node%2Fchoropleth-us-counties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d3-node","download_url":"https://codeload.github.com/d3-node/choropleth-us-counties/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795420,"owners_count":21645023,"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":[],"created_at":"2024-10-04T10:59:03.684Z","updated_at":"2025-04-30T23:16:30.982Z","avatar_url":"https://github.com/d3-node.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Choropleth Map of US Counties :earth_americas:\n\nChoropleth of US counties via CSV data and custom color scale \n\n![map](./test/output.png)\n\n## Install\n```bash\n$ npm install @d3-node/choropleth-us-counties --save\n```\n\n## Usage\n\n```js\nconst d3nMap = require('@d3-node/choropleth-us-counties')\n\n// read CSV -\u003e parse to json\nconst csv = fs.readFileSync('./unemployment.csv').toString()\nconst data = d3nMap.csvParse(csv)\n\nconst colors = [ // 9-color scheme (blue)\n  '#f7fbff', '#deebf7', '#c6dbef',\n  '#9ecae1', '#6baed6', '#4292c6',\n  '#2171b5', '#08519c', '#08306b'\n]\n\nconst scale = [ 2, 3, 4, 5, 6, 7, 8, 9 ] // buckets for unemployment rate\n\nconst map = d3nMap({ data, colors, scale })\nmap.svgString() // returns \u003csvg\u003e\n```\n\nSee [test](./test/index.js) for actual usage.\n\n##### Output the test map to an image (PNG)\n```\nnpm test\n```\n\n## API\n\n#### Options \n`{ data, colors, scale, [ idField = 0, metricField = 1 ] }`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3-node%2Fchoropleth-us-counties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd3-node%2Fchoropleth-us-counties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd3-node%2Fchoropleth-us-counties/lists"}