svg

command
v0.0.0-...-80d7cf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

README

SVG example

This is a hello world for rendering SVG images with gd. The output in this README is derived from running example.go with gd example.go >README.md.


package main

import (
	"io"
	"log"
	"net/http"
	"strings"

The "show" package is a magic package that is resolved by the gd build tool. The full path may also be used, then it would be "github.com/kortschak/gd/show".

	"show"
)

func main() {
	resp, err := http.Get("https://raw.githubusercontent.com/gonum/gonum/master/gopher.svg")
	if err != nil {
		log.Fatal(err)
	}
	var buf strings.Builder
	_, err = io.Copy(&buf, resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	show.SVG(buf.String(), "gopher", "Gonum Gopher")

gopher

}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL