Versions in this module Expand all Collapse all v0 v0.0.4 Apr 17, 2022 v0.0.3 Jul 27, 2021 Changes in this version + var CloudPathData = PathIconData + type PathIcon struct + Data PathIconData + func (pi PathIcon) Draw(ctx DrawContext, x int, y int, lineStyle *SvgStyle) + func (pi PathIcon) Size() (width int, height int) + type PathIconData struct + Height float64 + IconPadding float64 + Path string + TargetIconSize float64 + Width float64 v0.0.2 Nov 13, 2020 v0.0.1 Nov 11, 2020 Changes in this version + const CenterNotePos + const DashedArrowStem + const LINE_GAP + const LeftActorBox + const LeftNotePos + const LeftTextAlign + const MiddleActorBox + const MiddleTextAlign + const RightActorBox + const RightNotePos + const RightTextAlign + const SolidArrowStem + const ThickArrowStem + func MeasureFontRect(font Font, size int, text string, x, y int, gravity Gravity) (Rect, Point) + type ActivityArrowStem int + type ActivityLine struct + TC int + func NewActivityLine(toCol int, selfRef bool, text string, style ActivityLineStyle) *ActivityLine + func (al *ActivityLine) Constraint(r, c int, applier ConstraintApplier) + func (al *ActivityLine) Draw(ctx DrawContext, point Point) + type ActivityLineStyle struct + ArrowHead *ArrowHeadStyle + ArrowStem ActivityArrowStem + Font Font + FontSize int + Margin Point + SelfRefHeight int + SelfRefWidth int + TextGap int + type ActorBox struct + func NewActorBox(text string, style ActorBoxStyle, pos ActorBoxPos) *ActorBox + func (r *ActorBox) Draw(ctx DrawContext, point Point) + func (tr *ActorBox) Constraint(r, c int, applier ConstraintApplier) + type ActorBoxPos int + const BottomActorBox + const TopActorBox + type ActorBoxStyle struct + Color string + Font Font + FontSize int + Margin Point + Padding Point + TextColor string + type ActorIconBox struct + Icon Icon + func NewActorIconBox(text string, icon Icon, style ActorIconBoxStyle, pos ActorBoxPos) *ActorIconBox + func (tr *ActorIconBox) Constraint(r, c int, applier ConstraintApplier) + func (tr *ActorIconBox) Draw(ctx DrawContext, point Point) + type ActorIconBoxStyle struct + Color string + Font Font + FontSize int + IconGap int + Margin Point + Padding Point + TextColor string + type AddSizeConstraint struct + Bottom int + C int + Left int + R int + Right int + Top int + func (sc AddSizeConstraint) Apply(cm ConstraintChanger) + type ArrowHeadStyle struct + BaseStyle string + Xs []int + Ys []int + type Block struct + IsLast bool + MarginMup int + ShowMessage bool + ShowPrefix bool + Style BlockStyle + TC int + TR int + func NewBlock(toRow int, toCol int, marginMup int, isLast bool, prefix string, ...) *Block + func (block *Block) Constraint(r, c int, applier ConstraintApplier) + func (block *Block) Draw(ctx DrawContext, point Point) + type BlockStyle struct + Font Font + FontSize int + GapWidth int + Margin Point + MessagePadding Point + MidMargin int + PrefixExtraWidth int + TextPadding Point + type BoxFrame struct + InnerRect Rect + OuterRect Rect + type Constraint interface + Apply func(cm ConstraintChanger) + type ConstraintApplier struct + func (ca ConstraintApplier) Apply(constraint Constraint) + func (ca ConstraintApplier) Cols() int + type ConstraintChanger interface + AddLeftToCol func(col, newLeft int) + AddTopToRow func(row, newTop int) + Cols func() int + EnsureLeftIsAtleast func(col, newLeft int) + EnsureTopIsAtLeast func(row, newTop int) + GridPointRect func(fr, fc, tr, tc int) (int, int) + type CylinderIcon int + func (ci CylinderIcon) Draw(ctx DrawContext, x int, y int, lineStyle *SvgStyle) + func (ci CylinderIcon) Size() (width int, height int) + type Divider struct + TC int + func NewDivider(toCol int, text string, style DividerStyle) *Divider + func (div *Divider) Constraint(r, c int, applier ConstraintApplier) + func (div *Divider) Draw(ctx DrawContext, point Point) + type DividerShape int + const DSFramedRect + const DSFullLine + const DSFullRect + const DSSpacerRect + type DividerStyle struct + Font Font + FontSize int + Margin Point + Overlap int + Padding Point + Shape DividerShape + TextPadding Point + type DrawContext struct + C int + Canvas *svg.SVG + Graphic *Graphic + R int + func (dc *DrawContext) PointAt(r, c int) (Point, bool) + type Font interface + Measure func(txt string, size float64) (int, int) + SvgName func() string + type GraphboxItem interface + Constraint func(r, c int, applier ConstraintApplier) + Draw func(ctx DrawContext, point Point) + type Graphic struct + Margin Point + ShowGrid bool + Viewport bool + func NewGraphic(rows, cols int) *Graphic + func (g *Graphic) AddLeftToCol(col, newLeft int) + func (g *Graphic) AddTopToRow(row, newTop int) + func (g *Graphic) Cols() int + func (g *Graphic) DrawSVG(w io.Writer) + func (g *Graphic) EnsureLeftIsAtleast(col, newLeft int) + func (g *Graphic) EnsureTopIsAtLeast(row, newTop int) + func (g *Graphic) GridPointRect(fr, fc, tr, tc int) (int, int) + func (g *Graphic) PointAt(r, c int) (Point, bool) + func (g *Graphic) Put(r, c int, item GraphboxItem) bool + func (g *Graphic) Rows() int + type Gravity func(w, h int) (int, int) + var CenterGravity Gravity = func(w, h int) (int, int) { ... } + var EastGravity Gravity = func(w, h int) (int, int) { ... } + var NorthGravity Gravity = func(w, h int) (int, int) { ... } + var NorthWestGravity Gravity = func(w, h int) (int, int) { ... } + var SouthGravity Gravity = func(w, h int) (int, int) { ... } + var SouthWestGravity Gravity = func(w, h int) (int, int) { ... } + var WestGravity Gravity = func(w, h int) (int, int) { ... } + func AtSpecificGravity(fx, fy float64) Gravity + type Icon interface + Draw func(ctx DrawContext, x int, y int, lineStyle *SvgStyle) + Size func() (width int, height int) + type LifeLine struct + Style LifeLineStyle + TC int + TR int + func (ll *LifeLine) Constraint(r, c int, applier ConstraintApplier) + func (ll *LifeLine) Draw(ctx DrawContext, point Point) + type LifeLineStyle struct + Color string + type NoteBox struct + func NewNoteBox(text string, style NoteBoxStyle, pos NoteBoxPos) *NoteBox + func (r *NoteBox) Draw(ctx DrawContext, point Point) + func (tr *NoteBox) Constraint(r, c int, applier ConstraintApplier) + type NoteBoxPos int + type NoteBoxStyle struct + Font Font + FontSize int + Margin Point + Padding Point + Position NoteBoxPos + type Point struct + X int + Y int + type Rect struct + H int + W int + X int + Y int + func (r Rect) AddSize(w, h int) Rect + func (r Rect) BlowOut(dims Point) Rect + func (r Rect) PointAt(gravity Gravity) (int, int) + func (r Rect) PositionAt(x, y int, gravity Gravity) Rect + type SizeConstraint struct + Bottom int + C int + Left int + R int + Right int + Top int + func (sc SizeConstraint) Apply(cm ConstraintChanger) + type Spacer struct + Margin Point + func (sp *Spacer) Constraint(r, c int, applier ConstraintApplier) + func (sp *Spacer) Draw(ctx DrawContext, point Point) + type StickPersonIcon int + func (spi StickPersonIcon) Draw(ctx DrawContext, x int, y int, lineStyle *SvgStyle) + func (spi StickPersonIcon) Size() (width int, height int) + type SvgStyle map[string]string + func StyleFromString(str string) SvgStyle + func (ss SvgStyle) Extend(other SvgStyle) + func (ss SvgStyle) Set(key, value string) + func (ss SvgStyle) ToStyle() string + type TTFFont struct + func NewTTFFont(path string) (*TTFFont, error) + func NewTTFFontFromByteSlice(bytes []byte, fontName string) (*TTFFont, error) + func (ttf *TTFFont) Measure(txt string, size float64) (int, int) + func (ttf *TTFFont) SvgName() string + type TextAlign int + type TextBox struct + Align TextAlign + Color string + Font Font + FontSize int + Lines []string + func NewTextBox(font Font, fontSize int, align TextAlign) *TextBox + func (tb *TextBox) AddText(text string) + func (tb *TextBox) BoundingRect() Rect + func (tb *TextBox) Measure() (int, int) + func (tb *TextBox) Render(svg *svg.SVG, x, y int, gravity Gravity) + type Title struct + TC int + func NewTitle(toCol int, text string, style TitleStyle) *Title + func (al *Title) Constraint(r, c int, applier ConstraintApplier) + func (al *Title) Draw(ctx DrawContext, point Point) + type TitleStyle struct + Font Font + FontSize int + Padding Point + type TotalSizeConstraint struct + FC int + FR int + Height int + TC int + TR int + Width int + func (sc TotalSizeConstraint) Apply(cm ConstraintChanger)