Documentation ¶
Index ¶
- Constants
- Variables
- func FormatString(txt string, length int, align TextAlign) string
- type Border
- type Cell
- type ConsoleRenderer
- type FilterDef
- type FilterFunc
- type FormatterFn
- type Formatters
- type MarkedText
- type MarkedTextList
- type Row
- func (tr *Row) AddAlignedText(txt string, marker, alignment int) *Row
- func (tr *Row) AddBlock(positive bool) *Row
- func (tr *Row) AddCategorizedFloat(v, l1, l2, l3 float64) *Row
- func (tr *Row) AddCategorizedPercentage(v, steps float64) *Row
- func (tr *Row) AddCategoryBlock(c float64) *Row
- func (tr *Row) AddCenteredText(txt string, marker int) *Row
- func (tr *Row) AddChange(change, changePercent float64) *Row
- func (tr *Row) AddChangePercent(v float64) *Row
- func (tr *Row) AddColouredPercentage(v, steps float64) *Row
- func (tr *Row) AddDate(txt string) *Row
- func (tr *Row) AddDefaultText(txt string) *Row
- func (tr *Row) AddEmpty() *Row
- func (tr *Row) AddExtendedFloat(v float64, pattern string, marker int) *Row
- func (tr *Row) AddFlaggedFloat(v float64, flag bool) *Row
- func (tr *Row) AddFloat(v float64, marker int) *Row
- func (tr *Row) AddHisto(p, c float64) *Row
- func (tr *Row) AddHistoBlock(prev, cur float64) *Row
- func (tr *Row) AddInt(v int, marker int) *Row
- func (tr *Row) AddLink(txt, url string) *Row
- func (tr *Row) AddMarkedBlock(marker int) *Row
- func (tr *Row) AddMarkedFloat(v float64) *Row
- func (tr *Row) AddMarkedFloatThreshold(v, t float64) *Row
- func (tr *Row) AddMarkedInt(v int) *Row
- func (tr *Row) AddMarkedPercentage(v, steps float64) *Row
- func (tr *Row) AddRelation(first, second float64) *Row
- func (tr *Row) AddRelationPercentage(first, second float64) *Row
- func (tr *Row) AddText(txt string, marker int) *Row
- func (tr *Row) AddTextRight(txt string, marker int) *Row
- func (tr *Row) AddTime(txt string) *Row
- type Styles
- type Table
- func (rt *Table) AddColumn(name string, values []float64, fn FormatterFn)
- func (rt *Table) AddIntColumn(name string, values []int)
- func (rt *Table) AddMarkedTextColumn(name string, values []MarkedText)
- func (rt *Table) AddStringColumn(name string, values []string)
- func (rt *Table) AddStyle(fg, bg string, bold bool) int
- func (rt *Table) AddTableHeader(name string)
- func (rt *Table) Border(border Border) *Table
- func (rt *Table) BuildHeadlessHtml() string
- func (rt *Table) BuildHtml() string
- func (rt *Table) BuildPlainHtml() string
- func (rt *Table) CreateRow() *Row
- func (rt *Table) DelimiterLine(txt string) *Row
- func (tr *Table) Filter(f string) *Table
- func (tr *Table) FilterRecent(num int) *Table
- func (rt *Table) FindColumnIndex(name string) int
- func (rt *Table) Headers(headers ...string) *Table
- func (rt *Table) JSON(w io.Writer) error
- func (rt *Table) Name(name string) *Table
- func (rt *Table) Padding(padding int) *Table
- func (rt *Table) RebuildSizes()
- func (rt *Table) Recent(count int) *Table
- func (rt *Table) SetText(row, col int, txt string)
- func (rt *Table) Sort(name string)
- func (rt *Table) SortReverse(name string)
- func (rt *Table) String() string
- func (tr *Table) Sub(start, end int) *Table
- func (rt *Table) TableHeader(idx int, name string) *Table
- func (tr *Table) Top(num int) *Table
- func (rt *Table) Width() int
- type TableCell
- type TableRow
- type TextAlign
Constants ¶
View Source
const ( BG_COLOR = "#0C0C0C" BG_COLOR_ODD = "#1C1C1C" RED = "#cc0000" ORANGE = "#ff7800" BLUE = "#1a7091" LIGHT_GREEN = "#008a33" GREEN = "#82cc00" //TEXT_COLOR = "#efefef" TEXT_COLOR = "#fff" HEADER_COLOR = "#81858d" )
#094A25, #0C6B37, #F8B324, #EB442C, #BC2023
View Source
const ( ARROW_DOWN = "▼" ARROW_UP = "▲" DIAMOND = "◆" SQUARE = "■" MEDIUM_SQUARE = "◼" CIRCLE = "●" WHITE_CIRCLE = "○" )
View Source
const HeadlessTableTemplate = `` /* 1234-byte string literal not displayed */
View Source
const HeatMapTemplate = `` /* 333-byte string literal not displayed */
View Source
const InlineHeatMapTemplate = `` /* 293-byte string literal not displayed */
View Source
const ReportMailTemplate = `` /* 856-byte string literal not displayed */
View Source
const TableTemplate = `` /* 1423-byte string literal not displayed */
Variables ¶
View Source
var CAT_DESCRIPTORS = [5]string{"Tiny", "Small", "Medium", "Big", "Huge"}
View Source
var DefaultBorder = Border{
Size: 1,
H_LINE: "│",
V_LINE: "─",
TL_CORNER: "┌",
TR_CORNER: "┐",
BR_CORNER: "┘",
BL_CORNER: "└",
CROSS: "┼",
TOP_DEL: "┬",
BOT_DEL: "┴",
LEFT_DEL: "├",
RIGHT_DEL: "┤",
}
View Source
var DoubleBorder = Border{
Size: 1,
V_LINE: "═",
H_LINE: "║",
TL_CORNER: "╔",
TR_CORNER: "╗",
BL_CORNER: "╚",
BR_CORNER: "╝",
LEFT_DEL: "╠",
RIGHT_DEL: "╣",
CROSS: "╬",
TOP_DEL: "╦",
BOT_DEL: "╩",
}
View Source
var HiddenBorder = Border{
Size: 0,
H_LINE: "",
V_LINE: "─",
TL_CORNER: "",
TR_CORNER: "",
BR_CORNER: "",
BL_CORNER: "",
CROSS: "",
TOP_DEL: "",
BOT_DEL: "",
LEFT_DEL: "",
RIGHT_DEL: "",
}
View Source
var RoundedBorder = Border{
Size: 1,
V_LINE: "─",
H_LINE: "│",
TL_CORNER: "╭",
TR_CORNER: "╮",
BL_CORNER: "╰",
BR_CORNER: "╯",
LEFT_DEL: "├",
RIGHT_DEL: "┤",
CROSS: "┼",
TOP_DEL: "┬",
BOT_DEL: "┴",
}
View Source
var ThickBorder = Border{
Size: 1,
V_LINE: "━",
H_LINE: "┃",
TL_CORNER: "┏",
TR_CORNER: "┓",
BL_CORNER: "┗",
BR_CORNER: "┛",
LEFT_DEL: "┣",
RIGHT_DEL: "┫",
CROSS: "╋",
TOP_DEL: "┳",
BOT_DEL: "┻",
}
Functions ¶
Types ¶
type ConsoleRenderer ¶
type ConsoleRenderer struct { Styles Styles // contains filtered or unexported fields }
func NewConsoleRenderer ¶
func NewConsoleRenderer() *ConsoleRenderer
func (*ConsoleRenderer) String ¶
func (cr *ConsoleRenderer) String() string
type FilterDef ¶
func BuildFilterDef ¶
type Formatters ¶
type Formatters struct { Float FormatterFn Int FormatterFn HistoInt FormatterFn MarkedFloat FormatterFn Histo FormatterFn Block FormatterFn HistoBlock FormatterFn ColorBlock FormatterFn Percentage FormatterFn Relation FormatterFn Categorized FormatterFn CategorizedNorm FormatterFn BuySell FormatterFn }
func DefaultFormatters ¶
func DefaultFormatters() Formatters
type MarkedText ¶
type MarkedTextList ¶
type MarkedTextList struct {
Items []MarkedText
}
func NewMarkedTextList ¶
func NewMarkedTextList() *MarkedTextList
func (*MarkedTextList) Add ¶
func (m *MarkedTextList) Add(txt string, marker int)
func (*MarkedTextList) AddEmpty ¶
func (m *MarkedTextList) AddEmpty()
type Row ¶
func (*Row) AddCategorizedFloat ¶
func (*Row) AddCategorizedPercentage ¶
func (*Row) AddCategoryBlock ¶
func (*Row) AddChangePercent ¶
func (*Row) AddColouredPercentage ¶
func (*Row) AddDefaultText ¶
func (*Row) AddExtendedFloat ¶
func (*Row) AddHistoBlock ¶
func (*Row) AddMarkedBlock ¶
func (*Row) AddMarkedFloat ¶
func (*Row) AddMarkedFloatThreshold ¶
func (*Row) AddMarkedInt ¶
func (*Row) AddMarkedPercentage ¶
func (*Row) AddRelation ¶
func (*Row) AddRelationPercentage ¶
type Styles ¶
type Styles struct { Text term.Style Header term.Style PositiveMarker term.Style NegativeMarker term.Style ClassAMarker term.Style ClassBMarker term.Style ClassCMarker term.Style ClassDMarker term.Style ClassEMarker term.Style ClassFMarker term.Style HeaderStriped term.Style TextStriped term.Style PositiveMarkerStriped term.Style NegativeMarkerStriped term.Style ClassAMarkerStriped term.Style ClassBMarkerStriped term.Style ClassCMarkerStriped term.Style ClassDMarkerStriped term.Style ClassEMarkerStriped term.Style ClassFMarkerStriped term.Style }
type Table ¶
type Table struct { Description string Created string TableHeaders []string Rows []Row Count int HeaderSizes []int Limit int Formatters Formatters BorderStyle Border PaddingSize int // contains filtered or unexported fields }
func (*Table) AddIntColumn ¶
func (*Table) AddMarkedTextColumn ¶
func (rt *Table) AddMarkedTextColumn(name string, values []MarkedText)
func (*Table) AddStringColumn ¶
func (*Table) AddTableHeader ¶
func (*Table) BuildHeadlessHtml ¶
func (*Table) BuildPlainHtml ¶
func (*Table) DelimiterLine ¶
func (*Table) FilterRecent ¶
func (*Table) FindColumnIndex ¶
func (*Table) RebuildSizes ¶
func (rt *Table) RebuildSizes()
func (*Table) SortReverse ¶
Click to show internal directories.
Click to hide internal directories.