draw

package
v0.1.14-b Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2017 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package intended to draw phylogenetic trees on different devices :

  • Terminal,
  • Images (svg, png)
  • ...

And with different drawing algorithms. So far, only ASCII form in terminal.

  • Circular
  • Normal
  • Unrooted

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeDrawer

type TreeDrawer interface {
	DrawHLine(x1, x2, y, maxlength, maxheight float64)
	DrawVLine(x, y1, y2, maxlength, maxheight float64)
	DrawLine(x1, y1, x2, y2, maxlength, maxheight float64)
	/* angle : angle of the tip incoming branch */
	DrawName(x, y float64, name string, maxlength, maxheight float64, angle float64)
	Write()
}

Generic struct to draw on different supports:

  • ascii in terminal
  • png
  • svg

func NewPngTreeDrawer

func NewPngTreeDrawer(file *os.File, width, height int, leftmargin, rightmargin, topmargin, bottommargin int) TreeDrawer

TextTreeDrawer initializer. TextTreeDraws draws tree as ASCII on stdout or any file. So far: Does not take into account branch lengths.

func NewSvgTreeDrawer

func NewSvgTreeDrawer(file *os.File, width, height int, leftmargin, rightmargin, topmargin, bottommargin int) TreeDrawer

TextTreeDrawer initializer. TextTreeDraws draws tree as ASCII on stdout or any file. So far: Does not take into account branch lengths.

func NewTextTreeDrawer

func NewTextTreeDrawer(file *os.File, width, height int, rightmargin int) TreeDrawer

TextTreeDrawer initializer. TextTreeDraws draws tree as ASCII on stdout or any file. So far: Does not take into account branch lengths.

type TreeLayout

type TreeLayout interface {
	DrawTree(t *tree.Tree) error
}

Generic struct that represents tree layout:

  • circular
  • normal
  • unrooted

func NewNormalLayout

func NewNormalLayout(td TreeDrawer, withBranchLengths, withTipLabels bool) TreeLayout

func NewRadialLayout

func NewRadialLayout(td TreeDrawer, withBranchLengths, withTipLabels bool) TreeLayout

Jump to

Keyboard shortcuts

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