Re:Show HN: Globe visualizations in Golang
by AYBABTME on Friday July 07, 2017 @06:06PM
(#14722550)
That's pretty cool! It would be nice if the API allowed writing to io.Writer instead of taking filenames.
[ Parent
| on HN ]
Re:Show HN: Globe visualizations in Golang
by mmcloughlin on Friday July 07, 2017 @07:09PM
(#14722934)
If you'd like to output to an arbitrary writer, you can use the Image method.
https://godoc.org/github.com/mmcloughlin/globe#Globe.Image
This can be passed to an image encoder like
https://golang.org/pkg/image/png/#Encode https://golang.org/pkg/image/gif/#Encode https://golang.org/pkg/image/jpeg/#Encode
These functions take io.Writer objects. SavePNG was provided for convenience.