draw

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 2 Imported by: 1

README

Build Status codecov Maintainability

draw - package for writing software design diagrams

Documentation

Overview

Package draw provides svg writing features.

s := NewSvg()
s.WriteSvg(os.Stdout)

<svg
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  width="100" height="100" font-family="Arial, Helvetica, sans-serif"></svg>

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SVG added in v0.12.0

type SVG struct {
	Content []SVGWriter
	// contains filtered or unexported fields
}

func NewSvg

func NewSvg() *SVG

NewSvg returns an empty Svg of size 100x100

Example
s := NewSvg()
s.WriteSVG(os.Stdout)
Output:
<svg
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  width="100" height="100" font-family="Arial, Helvetica, sans-serif"></svg>

func (*SVG) Append added in v0.12.0

func (s *SVG) Append(w ...SVGWriter)

func (*SVG) Height added in v0.12.0

func (s *SVG) Height() int

func (*SVG) Prepend added in v0.12.0

func (s *SVG) Prepend(w ...SVGWriter)

func (*SVG) SetHeight added in v0.12.0

func (s *SVG) SetHeight(h int)

func (*SVG) SetSize added in v0.12.0

func (s *SVG) SetSize(w, h int)

func (*SVG) SetWidth added in v0.12.0

func (s *SVG) SetWidth(w int)

func (*SVG) Width added in v0.12.0

func (s *SVG) Width() int

func (*SVG) WriteSVG added in v0.12.0

func (s *SVG) WriteSVG(out io.Writer) error

type SVGWriter added in v0.12.0

type SVGWriter interface {
	WriteSVG(io.Writer) error
}

type TagWriter

type TagWriter struct {
	// contains filtered or unexported fields
}

func NewTagWriter

func NewTagWriter(w io.Writer) (*TagWriter, *error)

NewTagWriter returns a writer nexus. The referenced error is set by all methods if an error occurs.

Example
w, err := NewTagWriter(os.Stdout)
w.Print("hello")
*err = fmt.Errorf("stop subsequent calls")
w.Printf("cruel %s", "world")
Output:
hello

func (*TagWriter) Print

func (t *TagWriter) Print(args ...interface{})

Print prints arguments using the underlying writer. Does nothing if TagWriter has failed.

func (*TagWriter) Printf

func (t *TagWriter) Printf(format string, args ...interface{})

Printf prints a formated string using the underlying writer. Does nothing if TagWriter has failed.

func (*TagWriter) Write

func (t *TagWriter) Write(b []byte) (int, error)

Write writes the bytes using the underlying writer. Does nothing if TagWriter has failed.

Directories

Path Synopsis
Package design provides svg diagram creators
Package design provides svg diagram creators
internal
app
cmd/dog command
Document generation for example diagrams
Document generation for example diagrams
Package shape provides various SVG shapes
Package shape provides various SVG shapes
Package xy provides xy Position
Package xy provides xy Position

Jump to

Keyboard shortcuts

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