{"id":23666581,"url":"https://github.com/redsift/d3-rs-geo","last_synced_at":"2026-02-24T01:10:08.745Z","repository":{"id":11045950,"uuid":"68112413","full_name":"redsift/d3-rs-geo","owner":"redsift","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-16T14:57:39.000Z","size":2659,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-09-27T22:52:14.776Z","etag":null,"topics":["d3js","frontend","lib"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redsift.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":"2016-09-13T13:46:11.000Z","updated_at":"2025-08-27T12:10:13.000Z","dependencies_parsed_at":"2025-05-21T00:13:40.002Z","dependency_job_id":"714e26e5-cc9c-413e-8495-a3a0f23124fd","html_url":"https://github.com/redsift/d3-rs-geo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redsift/d3-rs-geo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsift%2Fd3-rs-geo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsift%2Fd3-rs-geo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsift%2Fd3-rs-geo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsift%2Fd3-rs-geo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redsift","download_url":"https://codeload.github.com/redsift/d3-rs-geo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redsift%2Fd3-rs-geo/sbom","scorecard":{"id":768071,"data":{"date":"2025-08-11","repo":{"name":"github.com/redsift/d3-rs-geo","commit":"d789a1c410c9790088a92e9c1fd93a5350a61062"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"39 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-wrw9-m778-g6mc","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-r7jx-5m6m-cpg9","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-x6fg-f45m-jf5q","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T01:25:52.644Z","repository_id":11045950,"created_at":"2025-08-23T01:25:52.644Z","updated_at":"2025-08-23T01:25:52.644Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29765743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T21:02:23.375Z","status":"ssl_error","status_checked_at":"2026-02-23T20:58:31.539Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["d3js","frontend","lib"],"created_at":"2024-12-29T07:33:11.773Z","updated_at":"2026-02-24T01:10:08.729Z","avatar_url":"https://github.com/redsift.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3-rs-geo\n\n`d3-rs-geo` presents a TopoJSON map in an SVG container.\n\n## Builds\n\n[![Circle CI](https://img.shields.io/circleci/project/redsift/d3-rs-geo.svg?style=flat-square)](https://circleci.com/gh/redsift/d3-rs-geo)\n[![npm](https://img.shields.io/npm/v/@redsift/d3-rs-geo.svg?style=flat-square)](https://www.npmjs.com/package/@redsift/d3-rs-geo)\n[![MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/redsift/d3-rs-geo/master/LICENSE)\n\n## Example\n\n[View @redsift/d3-rs-geo on Codepen](http://codepen.io/collection/nGqPYd/)\n\n### Flat map\n\n![World map](https://bricks.redsift.io/reusable/d3-rs-geo?_datum={%22url%22:%22https://static.redsift.io/thirdparty/topojson/examples/world-50m.json%22}\u0026offline)\n\n### Map with country coloring and great arcs\n\n![World map with links](https://bricks.redsift.io/reusable/d3-rs-geo?_datum={%22url%22:%22https://static.redsift.io/thirdparty/topojson/examples/world-50m.json%22}\u0026offline)\n\n### Interrupted projection with points of interest\n\n![Interrupted Homolosine projection]()\n\n### USA highlighting states\n\n![USA with states]()\n\n### Stylized Europe\n\n![Funky europe]()\n\n## Usage\n\n### Browser\n\n    \u003cscript src=\"//static.redsift.io/reusable/d3-rs-geo/latest/d3-rs-geo.umd-es2015.min.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n        var chart = d3_rs_geo.html();\n        d3.select('body')\n            .datum('https://static.redsift.io/thirdparty/topojson/examples/world-50m.json')\n            .call(chart);\n    \u003c/script\u003e\n\n### ES6\n\n    import { html as chart } from \"@redsift/d3-rs-geo\";\n    let eml = chart();\n    ...\n\n### Require\n\n    var chart = require(\"@redsift/d3-rs-geo\");\n    var eml = chart.html();\n    ...\n\n### Datum\n\nDatum can be one of:\n\n1. String representing the URL to load the TopoJSON file for the map from\n1. Object representing the TopoJSON itself\n1. Object with key `url` (URL to load the TopoJSON file) and optionally the keys `points` and `links`\n\n### Points \n\nRepresents points of interest on the map. `[ [ longitude, latitude ] ... ]`\n\n#### Points - Custom presentation\n\nDefault presentation uses a symbol. You can supply a custom symbol i.e. object that implements a `draw` function as per https://github.com/d3/d3-shape#symbol_type or supply a totally custom reusable component via the `pointsDisplay` property.\n\n    // Display a text label instead of the default symbol.\n    var points = [ [ -76.852587, 38.991621, 'NY' ], [ -0.076132, 51.5074, 'London' ] ];\n    \n    function displayText(selection) {\n        selection.each(function(d, i) {\n            let node = select(this).selectAll('text').data([ d ]);\n            node = node.enter().append('text').merge(node);\n            node.text(d[2]);\n        });\n    }\n    var chart = d3_rs_geo.html().points(points).pointsDisplay(displayText);\n    d3.select('body')\n        .datum('https://static.redsift.io/thirdparty/topojson/examples/world-50m.json')\n        .call(chart);\n\n### Links\n\nRepresents great arcs between two points. `[ [ longitude-1, latitude-1, longitude-2, latitude-2 ] ... ]`\n\n#### Links - Custom presentation\n\nDefault presentation uses a dashed line. \n    \n    // Display a solid red line\n    var links = [ [ -76.852587, 38.991621, -0.076132, 51.5074 ] ];\n\n    function redLine(selection) {\n        selection.attr('stroke', 'red').attr('stroke-width', '2px');\n    }\n    var chart = d3_rs_geo.html().links(links).linksDisplay(redLine);\n    d3.select('body')\n        .datum('https://static.redsift.io/thirdparty/topojson/examples/world-50m.json')\n        .call(chart);\n\n### onClick(d,i,c)\n\nClick handler for map interactions. `d` will be the object of the interaction from the TopoJSON data structure. E.g. if the click was on a country, `d` will be an object and `d.id` will be the [ISO_3166-1 country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric).\n\n`d` will be null if the click was outside a country boundary.\n\n### Performance checklist\n\nAs setup in the examples, the drawing of the map involves a number of heavy operations.\n\n1. Downloading the specified topojson data set.\n1. Parsing the data set.\n1. Applying the projection to convert the data into paths where the paths represent the landmass and/or the political boundaries of the planet.\n1. Performing a standard D3 `enter()/update()/exit()` pattern for the paths.\n1. Rendering the additional points and links on the map.\n\nWhile this is all done relatively efficiently (once the JSON is in the network cache, a 110m world map will compute in ~200ms on a fast desktop), reducing the amount of work that needs to be done will improve performance, reduce energy consumption and free cycles for the rest of the application. You can do this by:\n\n1. Use a topojson that provides the appropriate level of detail for your application. The 50m resolution version of the world `https://static.redsift.io/thirdparty/topojson/examples/world-50m.json` is ~750kb of JSON while the 110 meter resolution version `https://static.redsift.io/thirdparty/topojson/examples/world-110m.json` is ~ 100kb. The 110m version obviously does not capture outlines and smaller islands as accurately.\n1. Load the topojson once and parse the parsed javascript object to the chart via the `datum` indead of using the URL reference.\n1. Once your map is rendered and you do not intend the change the topology of the map itself, you can supress logic associated with refreshing the paths by setting `redrawTopology` to false e.g. you may use this when updating data points on the same map.\n\n### Parameters\n\nProperty|Description|Transition|\n----|-----------|----------|\n`classed`| *String* SVG custom class. |N|\n`width`, `height`, `size`, `scale`|*Integer* SVG container sizes. |Y|\n`background`| *String* Change the colour of the SVG background. |Y|\n`theme`| *String* Change the graph theme, includes `'light'`(default) and `'dark'`. |Y| \n`margin`| *Number* Change the margin inside of the SVG container. |Y|\n`graticule`| *Number* Opacity of the graticule (line grid). Range between 0 and 1. |N|\n`projection`| *String* Change projection view of the world map. `Default` set to [`geoPatterson`](http://map-projections.net/patterson.php). The available world projection can be on found the [D3 geo library github webpage.](https://github.com/d3/d3-geo/blob/master/README.md#geoAlbers)|Y|\n`projectionScale`| *Number* Change the projection scale of the world map. |Y| \n`interrupted`| *Boolean* Enabled clipping for interrupted projections. `Default` set to `true`.|N|\n`geometry` | *String* Set the country geometry Parameters `land`;display the entire country geometry , `states`; display each state of the country, `countries`; display each countries.|N|  \n`fill`| *String* Change the land filling colour. Parameter `colour name`, `rgb colour` or `hex colour`.|Y|\n`points`| *(Array of)Number* Add points on the map using decimal expression of [ `Longitude`, `Latitude` ].|N|\n`pointsDisplay`| *Function, String* Supply custom [symbol](https://github.com/d3/d3-shape#symbol) of the plotted points i.e. object that implements a `draw` function or supply a totally custom reusable component via the pointDisplay property. `Default` set to `symbolWye`*|N|\n`links`| *(Array of)Number* Links each points. Parameter include an arrays of points connecting the link.|Y|\n`linksDisplay`| *Function, String* Supply custom presentation to the dashed line. ||\n`zoom`| *Number* Zoom into the map. `Default` set to `1.0`.|Y|\n`zoomX`, `zoomY`| *Number* Zoom into the map at x-coordinate (zoomX) and Y-coordinate (zoomY). |Y| \n`onClick`| *Function* Handler for a click event on a data series. |N|\n`redrawTopology`|*Boolean* When drawing the map, redraw the topology too\n`negative`|*String* Color for the negative space in the map i.e. typically the water. When interrupted is set to false, this does not display and the `background` color shows through\n`boundary`|*String* Color for the boundaries between country polygons","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredsift%2Fd3-rs-geo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredsift%2Fd3-rs-geo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredsift%2Fd3-rs-geo/lists"}