Documentation
¶
Index ¶
- type BR
- type FONT
- type HtmLike
- type HtmLikeAlign
- type HtmLikeElement
- type HtmLikeImgScale
- type HtmLikeValign
- type IMG
- type RuleElement
- type StyleElement
- func NewB(children ...HtmLikeElement) *StyleElement
- func NewI(children ...HtmLikeElement) *StyleElement
- func NewO(children ...HtmLikeElement) *StyleElement
- func NewS(children ...HtmLikeElement) *StyleElement
- func NewSUB(children ...HtmLikeElement) *StyleElement
- func NewSUP(children ...HtmLikeElement) *StyleElement
- func NewU(children ...HtmLikeElement) *StyleElement
- type TD
- func (td *TD) AppendChildren(children ...HtmLikeElement) *TD
- func (td *TD) SetAlign(v HtmLikeAlign) *TD
- func (td *TD) SetBAlign(v HtmLikeAlign) *TD
- func (td *TD) SetBGColor(v string) *TD
- func (td *TD) SetBorder(v uint) *TD
- func (td *TD) SetCellPadding(v uint) *TD
- func (td *TD) SetColor(v string) *TD
- func (td *TD) SetColspan(v uint) *TD
- func (td *TD) SetFixedSize(v bool) *TD
- func (td *TD) SetGradientAngle(v int) *TD
- func (td *TD) SetHREF(v string) *TD
- func (td *TD) SetHeight(v uint) *TD
- func (td *TD) SetID(v string) *TD
- func (td *TD) SetPort(v string) *TD
- func (td *TD) SetRowspan(v uint) *TD
- func (td *TD) SetSides(v string) *TD
- func (td *TD) SetStyle(v string) *TD
- func (td *TD) SetTarget(v string) *TD
- func (td *TD) SetTitle(v string) *TD
- func (td *TD) SetTooltip(v string) *TD
- func (td *TD) SetValign(v HtmLikeValign) *TD
- func (td *TD) SetWidth(v uint) *TD
- func (td *TD) WriteDOT(w io.Writer) error
- type TR
- type Table
- func (t *Table) AppendChildren(children ...HtmLikeElement) *Table
- func (t *Table) SetAlign(v HtmLikeAlign) *Table
- func (t *Table) SetBGColor(v string) *Table
- func (t *Table) SetBorder(v uint) *Table
- func (t *Table) SetCellBorder(v uint) *Table
- func (t *Table) SetCellPadding(v uint) *Table
- func (t *Table) SetCellSpacing(v uint) *Table
- func (t *Table) SetColor(v string) *Table
- func (t *Table) SetColumns(v string) *Table
- func (t *Table) SetFixedSize(v bool) *Table
- func (t *Table) SetGradientAngle(v int) *Table
- func (t *Table) SetHREF(v string) *Table
- func (t *Table) SetHeight(v uint) *Table
- func (t *Table) SetID(v string) *Table
- func (t *Table) SetPort(v string) *Table
- func (t *Table) SetRows(v string) *Table
- func (t *Table) SetSides(v string) *Table
- func (t *Table) SetStyle(v string) *Table
- func (t *Table) SetTarget(v string) *Table
- func (t *Table) SetTitle(v string) *Table
- func (t *Table) SetTooltip(v string) *Table
- func (t *Table) SetValign(v HtmLikeValign) *Table
- func (t *Table) SetWidth(v uint) *Table
- func (t *Table) WriteDOT(w io.Writer) error
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BR ¶
type BR struct {
Align HtmLikeAlign
}
BR represents a <BR/> element.
func (*BR) SetAlign ¶
func (b *BR) SetAlign(v HtmLikeAlign) *BR
SetAlign sets the align attribute for the BR element.
type FONT ¶
type FONT struct {
Color string
Face string
PointSize *int // Max 65535 apparently for POINT-SIZE as int? Spec says "value". Let's assume int for now.
Children []HtmLikeElement // Can contain Text, BR, IMG, style tags, other FONT, or even TABLES/TRs/TDs
}
FONT represents a <FONT> element.
func (*FONT) AppendChildren ¶
func (f *FONT) AppendChildren(children ...HtmLikeElement) *FONT
AppendChildren adds children to the font element.
func (*FONT) SetPointSize ¶
type HtmLike ¶
type HtmLike struct {
Elements []HtmLikeElement
}
HtmLike represents a Graphviz HTML-like label, enclosed in <...>. It can contain one or more HtmLikeElement children. Typically, the root element is a *Table.
func NewHtmLike ¶
func NewHtmLike(elements ...HtmLikeElement) *HtmLike
NewHtmLike creates a new HtmLike label with the given root elements.
func (*HtmLike) AppendElements ¶
func (h *HtmLike) AppendElements(elements ...HtmLikeElement) *HtmLike
AppendElements adds root elements to the HtmLike label.
type HtmLikeAlign ¶
type HtmLikeAlign string
const ( AlignCENTER HtmLikeAlign = "CENTER" AlignLEFT HtmLikeAlign = "LEFT" AlignRIGHT HtmLikeAlign = "RIGHT" AlignTEXT HtmLikeAlign = "TEXT" // TD only )
type HtmLikeElement ¶
HtmLikeElement is an interface for any element that can be part of an HTML-like label.
type HtmLikeImgScale ¶
type HtmLikeImgScale string
const ( ScaleFALSE HtmLikeImgScale = "FALSE" ScaleTRUE HtmLikeImgScale = "TRUE" ScaleWIDTH HtmLikeImgScale = "WIDTH" ScaleHEIGHT HtmLikeImgScale = "HEIGHT" ScaleBOTH HtmLikeImgScale = "BOTH" )
type HtmLikeValign ¶
type HtmLikeValign string
const ( ValignMIDDLE HtmLikeValign = "MIDDLE" ValignBOTTOM HtmLikeValign = "BOTTOM" ValignTOP HtmLikeValign = "TOP" )
type StyleElement ¶
type StyleElement struct {
Tag string
Children []HtmLikeElement
}
Style elements (B, I, U, O, SUB, SUP, S)
func (*StyleElement) AppendChildren ¶
func (s *StyleElement) AppendChildren(children ...HtmLikeElement) *StyleElement
AppendChildren adds children to the style element.
type TD ¶
type TD struct {
Align HtmLikeAlign // Can also be TEXT
BAlign HtmLikeAlign // Default ALIGN for child BRs
BGColor string
Border *uint // Max 255
CellPadding *uint // Max 255
CellSpacing *uint // Max 127 (Note: TD doesn't have CellSpacing in spec? Maybe inherited?)
Color string
Colspan *uint // Max 65535
FixedSize *bool
GradientAngle *int
Height *uint // Max 65535
HREF string
ID string
Port string
Rowspan *uint // Max 65535
Sides string // e.g., "LT", "B", "LRTB"
Style string // Only "RADIAL" currently
Target string
Title string // Alias for TOOLTIP
Tooltip string
Valign HtmLikeValign
Width *uint // Max 65535
Children []HtmLikeElement // Can contain anything a label can contain (Text, <TABLE>, <FONT>, <BR>, <IMG>, style tags)
}
TD represents a <TD> element.
func (*TD) AppendChildren ¶
func (td *TD) AppendChildren(children ...HtmLikeElement) *TD
AppendChildren adds children to the table cell.
func (*TD) SetBAlign ¶
func (td *TD) SetBAlign(v HtmLikeAlign) *TD
func (*TD) SetBGColor ¶
func (*TD) SetCellPadding ¶
func (*TD) SetColor ¶
SetCellSpacing seems incorrect based on spec, TD doesn't have it. func (td *TD) SetCellSpacing(v uint) *TD { td.CellSpacing = &v; return td }
func (*TD) SetColspan ¶
func (*TD) SetFixedSize ¶
func (*TD) SetGradientAngle ¶
func (*TD) SetRowspan ¶
func (*TD) SetTooltip ¶
func (*TD) SetValign ¶
func (td *TD) SetValign(v HtmLikeValign) *TD
type TR ¶
type TR struct {
Children []HtmLikeElement // Expected to contain *TD elements or HR/VR
}
TR represents a <TR> element.
func (*TR) AppendChildren ¶
func (tr *TR) AppendChildren(children ...HtmLikeElement) *TR
AppendChildren adds children to the table row.
type Table ¶
type Table struct {
Align HtmLikeAlign
BGColor string
Border *uint // Note: BORDER is uint up to 255 for TABLE, 127 for CELLBORDER
CellBorder *uint // Max 127
CellPadding *uint // Max 255
CellSpacing *uint // Max 127
Color string
Columns string // Only "*" currently
FixedSize *bool
GradientAngle *int
Height *uint // Max 65535
HREF string
ID string
Port string
Rows string // Only "*" currently
Sides string // e.g., "LT", "B", "LRTB"
Style string // e.g., "ROUNDED", "RADIAL"
Target string
Title string // Alias for TOOLTIP
Tooltip string
Valign HtmLikeValign
Width *uint // Max 65535
Children []HtmLikeElement // Expected to contain *TR elements
}
Table represents a <TABLE> element.
func NewTable ¶
func NewTable(children ...HtmLikeElement) *Table
NewTable creates a new Table element.
func (*Table) AppendChildren ¶
func (t *Table) AppendChildren(children ...HtmLikeElement) *Table
AppendChildren adds children to the table.
func (*Table) SetBGColor ¶
func (*Table) SetCellBorder ¶
func (*Table) SetCellPadding ¶
func (*Table) SetCellSpacing ¶
func (*Table) SetColumns ¶
func (*Table) SetFixedSize ¶
func (*Table) SetGradientAngle ¶
func (*Table) SetTooltip ¶
func (*Table) SetValign ¶
func (t *Table) SetValign(v HtmLikeValign) *Table