Documentation ¶
Overview ¶
Package volume exposes functions for rendering 3D views of treemaps
Index ¶
- func Image(tree *treemap.Block, width, height float64) (image.Image, error)
- func NewGIF(tree *treemap.Block, width, height float64) (io.WriterTo, error)
- func NewJPEG(tree *treemap.Block, width, height float64) (io.WriterTo, error)
- func NewPNG(tree *treemap.Block, width, height float64) (io.WriterTo, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGIF ¶
NewGIF returns the image of the received tree encoded as a GIF
Example ¶
encoder, err := NewGIF(block, 1024, 768) if err != nil { fmt.Println(err.Error()) } buf := new(bytes.Buffer) fmt.Println(encoder.WriteTo(buf)) fmt.Println(ioutil.WriteFile("../docs/volume.gif", buf.Bytes(), 0644))
Output: 52546 <nil> <nil>
func NewJPEG ¶
NewJPEG returns the image of the received tree encoded as a JPEG
Example ¶
encoder, err := NewJPEG(block, 1024, 768) if err != nil { fmt.Println(err.Error()) } buf := new(bytes.Buffer) fmt.Println(encoder.WriteTo(buf)) fmt.Println(ioutil.WriteFile("../docs/volume.jpg", buf.Bytes(), 0644))
Output: 50430 <nil> <nil>
func NewPNG ¶
NewPNG returns the image of the received tree encoded as a PNG
Example ¶
encoder, err := NewPNG(block, 1024, 768) if err != nil { fmt.Println(err.Error()) } buf := new(bytes.Buffer) fmt.Println(encoder.WriteTo(buf)) fmt.Println(ioutil.WriteFile("../docs/volume.png", buf.Bytes(), 0644))
Output: 85536 <nil> <nil>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.