-
Notifications
You must be signed in to change notification settings - Fork 51
/
README.md.j2
64 lines (43 loc) · 1.57 KB
/
README.md.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# globe
Globe wireframe visualizations in Golang backed by
[pinhole](https://github.com/tidwall/pinhole).
[![go.dev Reference](https://img.shields.io/badge/doc-reference-007d9b?logo=go&style=flat-square)](https://pkg.go.dev/github.com/mmcloughlin/globe)
![Build status](https://img.shields.io/github/actions/workflow/status/mmcloughlin/globe/ci.yml?style=flat-square)
{% macro image(name) -%}
<p align="center"><img src="{% include 'examples/' + name + '.imgur' %}" /></p>
{%- endmacro %}
{% macro code(name) -%}
```go
{% include 'examples/' + name + '.snip' %}
```
{%- endmacro %}
{{ image('cities') }}
## Getting Started
Install `globe` with
```sh
$ go get -u github.com/mmcloughlin/globe
```
Start with a blank globe with a graticule at 10 degree intervals.
{{ code('graticule') }}
{{ image('graticule') }}
Add some land boundaries and center it on a point. Alternatively
[`DrawCountryBoundaries`](https://godoc.org/github.com/mmcloughlin/globe#Globe.DrawCountryBoundaries)
will give you countries.
{{ code('land') }}
{{ image('land') }}
Here's all the [Starbucks
locations](https://github.com/mmcloughlin/starbucks). Note `color.NRGBA`
recommended to [avoid
artifacts](https://github.com/mmcloughlin/globe/issues/6).
{{ code('starbucks') }}
{{ image('starbucks') }}
You can also do lines along great circles.
{{ code('line') }}
{{ image('line') }}
Also rectangles.
{{ code('rect') }}
{{ image('rect') }}
See [examples](examples/) and [package
documentation](https://pkg.go.dev/github.com/mmcloughlin/globe) for more.
## License
`globe` is available under the ISC [License](/LICENSE).