{"id":13593843,"url":"https://github.com/mmcloughlin/globe","last_synced_at":"2025-04-08T10:14:57.049Z","repository":{"id":38361886,"uuid":"96056297","full_name":"mmcloughlin/globe","owner":"mmcloughlin","description":"Globe wireframe visualizations in Golang","archived":false,"fork":false,"pushed_at":"2024-02-09T19:29:54.000Z","size":204,"stargazers_count":1597,"open_issues_count":6,"forks_count":50,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-01T08:39:17.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mmcloughlin/globe","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmcloughlin.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}},"created_at":"2017-07-03T00:24:48.000Z","updated_at":"2025-03-03T01:35:49.000Z","dependencies_parsed_at":"2022-08-25T04:50:45.010Z","dependency_job_id":"61f08b6f-4b9d-4a7b-a659-f68395812b9e","html_url":"https://github.com/mmcloughlin/globe","commit_stats":{"total_commits":54,"total_committers":1,"mean_commits":54.0,"dds":0.0,"last_synced_commit":"d41128bd463262a5076c679da1110f8944baea14"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmcloughlin%2Fglobe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmcloughlin%2Fglobe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmcloughlin%2Fglobe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmcloughlin%2Fglobe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmcloughlin","download_url":"https://codeload.github.com/mmcloughlin/globe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819933,"owners_count":21001394,"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-08-01T16:01:25.339Z","updated_at":"2025-04-08T10:14:57.028Z","avatar_url":"https://github.com/mmcloughlin.png","language":"Go","funding_links":[],"categories":["开源类库","Multimedia","Open source library","Go"],"sub_categories":["图表","Image and pictures","Charts","Tools","[Tools](#tools-1)"],"readme":"# globe\n\nGlobe wireframe visualizations in Golang backed by\n[pinhole](https://github.com/tidwall/pinhole).\n\n[![go.dev Reference](https://img.shields.io/badge/doc-reference-007d9b?logo=go\u0026style=flat-square)](https://pkg.go.dev/github.com/mmcloughlin/globe)\n![Build status](https://img.shields.io/github/actions/workflow/status/mmcloughlin/globe/ci.yml?style=flat-square)\n\n\n\n\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/D0ZcrFu.png\" /\u003e\u003c/p\u003e\n\n## Getting Started\n\nInstall `globe` with\n\n```sh\n$ go get -u github.com/mmcloughlin/globe\n```\n\nStart with a blank globe with a graticule at 10 degree intervals.\n\n```go\ng := globe.New()\ng.DrawGraticule(10.0)\ng.SavePNG(\"graticule.png\", 400)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/gXcYu8r.png\" /\u003e\u003c/p\u003e\n\nAdd some land boundaries and center it on a point. Alternatively\n[`DrawCountryBoundaries`](https://godoc.org/github.com/mmcloughlin/globe#Globe.DrawCountryBoundaries)\nwill give you countries.\n\n```go\ng := globe.New()\ng.DrawGraticule(10.0)\ng.DrawLandBoundaries()\ng.CenterOn(51.453349, -2.588323)\ng.SavePNG(\"land.png\", 400)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/rlzEKfX.png\" /\u003e\u003c/p\u003e\n\nHere's all the [Starbucks\nlocations](https://github.com/mmcloughlin/starbucks). Note `color.NRGBA`\nrecommended to [avoid\nartifacts](https://github.com/mmcloughlin/globe/issues/6).\n\n```go\nshops, err := LoadCoffeeShops(\"./starbucks.json\")\nif err != nil {\n\tlog.Fatal(err)\n}\n\ngreen := color.NRGBA{0x00, 0x64, 0x3c, 192}\ng := globe.New()\ng.DrawGraticule(10.0)\nfor _, s := range shops {\n\tg.DrawDot(s.Lat, s.Lng, 0.05, globe.Color(green))\n}\ng.CenterOn(40.645423, -73.903879)\nerr = g.SavePNG(\"starbucks.png\", 400)\nif err != nil {\n\tlog.Fatal(err)\n}\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/s46UomA.png\" /\u003e\u003c/p\u003e\n\nYou can also do lines along great circles.\n\n```go\ng := globe.New()\ng.DrawGraticule(10.0)\ng.DrawLandBoundaries()\ng.DrawLine(\n\t51.453349, -2.588323,\n\t40.645423, -73.903879,\n\tglobe.Color(color.NRGBA{255, 0, 0, 255}),\n)\ng.CenterOn(50.244440, -37.207949)\ng.SavePNG(\"line.png\", 400)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/W2lUCTc.png\" /\u003e\u003c/p\u003e\n\nAlso rectangles.\n\n```go\ng := globe.New()\ng.DrawGraticule(10.0)\ng.DrawLandBoundaries()\ng.DrawRect(\n\t41.897209, 12.500285,\n\t55.782693, 37.615993,\n\tglobe.Color(color.NRGBA{255, 0, 0, 255}),\n)\ng.CenterOn(48, 25)\ng.SavePNG(\"rect.png\", 400)\n```\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://i.imgur.com/oWEiV1v.png\" /\u003e\u003c/p\u003e\n\nSee [examples](examples/) and [package\ndocumentation](https://pkg.go.dev/github.com/mmcloughlin/globe) for more.\n\n## License\n\n`globe` is available under the ISC [License](/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmcloughlin%2Fglobe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmcloughlin%2Fglobe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmcloughlin%2Fglobe/lists"}