components

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AreaChart

type AreaChart struct {
	Data         dataviz.AreaChartData
	Width        int
	Height       int
	Color        string
	Theme        string
	DesignTokens *design.DesignTokens
}

AreaChart represents an area chart visualization component

func NewAreaChart

func NewAreaChart(data dataviz.AreaChartData) *AreaChart

NewAreaChart creates a new area chart component with default settings

func (*AreaChart) Render

func (a *AreaChart) Render() string

Render converts the area chart to a string for terminal display

func (*AreaChart) ToStyledNode

func (a *AreaChart) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the area chart to a styled node for terminal rendering

func (*AreaChart) WithColor

func (a *AreaChart) WithColor(c string) *AreaChart

WithColor sets the primary color

func (*AreaChart) WithDesignTokens

func (a *AreaChart) WithDesignTokens(tokens *design.DesignTokens) *AreaChart

WithDesignTokens sets custom design tokens

func (*AreaChart) WithSize

func (a *AreaChart) WithSize(width, height int) *AreaChart

WithSize sets the width and height

func (*AreaChart) WithTheme

func (a *AreaChart) WithTheme(theme string) *AreaChart

WithTheme sets the theme

type BarChart

type BarChart struct {
	Data         dataviz.BarChartData
	Width        int
	Height       int
	Color        string
	Theme        string
	DesignTokens *design.DesignTokens
}

BarChart represents a bar chart visualization component

func NewBarChart

func NewBarChart(data dataviz.BarChartData) *BarChart

NewBarChart creates a new bar chart component with default settings

func (*BarChart) ToStyledNode

func (b *BarChart) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the bar chart to a styled node for terminal rendering

func (*BarChart) WithColor

func (b *BarChart) WithColor(c string) *BarChart

WithColor sets the primary color

func (*BarChart) WithDesignTokens

func (b *BarChart) WithDesignTokens(tokens *design.DesignTokens) *BarChart

WithDesignTokens sets custom design tokens

func (*BarChart) WithSize

func (b *BarChart) WithSize(width, height int) *BarChart

WithSize sets the width and height

func (*BarChart) WithTheme

func (b *BarChart) WithTheme(theme string) *BarChart

WithTheme sets the theme

type Collapsible

type Collapsible struct {
	Title       string
	Content     string
	Expanded    bool
	Foreground  *color.Color
	TitleColor  *color.Color
	Border      renderer.BorderChars
	BorderColor *color.Color
}

Collapsible represents a collapsible section with a header and content

func NewCollapsible

func NewCollapsible(title, content string) *Collapsible

NewCollapsible creates a new collapsible section

func (*Collapsible) ToStyledNode

func (c *Collapsible) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the collapsible to a styled node

func (*Collapsible) Toggle

func (c *Collapsible) Toggle()

Toggle toggles the expanded state

type Heatmap

type Heatmap struct {
	Data         dataviz.HeatmapData
	Width        int
	Height       int
	Color        string
	Theme        string
	DesignTokens *design.DesignTokens
}

Heatmap represents a contribution heatmap visualization component

func NewHeatmap

func NewHeatmap(data dataviz.HeatmapData) *Heatmap

NewHeatmap creates a new heatmap component with default settings

func (*Heatmap) ToStyledNode

func (h *Heatmap) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the heatmap to a styled node for terminal rendering

func (*Heatmap) WithColor

func (h *Heatmap) WithColor(c string) *Heatmap

WithColor sets the primary color

func (*Heatmap) WithDesignTokens

func (h *Heatmap) WithDesignTokens(tokens *design.DesignTokens) *Heatmap

WithDesignTokens sets custom design tokens

func (*Heatmap) WithSize

func (h *Heatmap) WithSize(width, height int) *Heatmap

WithSize sets the width and height

func (*Heatmap) WithTheme

func (h *Heatmap) WithTheme(theme string) *Heatmap

WithTheme sets the theme

type LineGraph

type LineGraph struct {
	Data         dataviz.LineGraphData
	Width        int
	Height       int
	Color        string
	Theme        string
	DesignTokens *design.DesignTokens
}

LineGraph represents a line graph visualization component

func NewLineGraph

func NewLineGraph(data dataviz.LineGraphData) *LineGraph

NewLineGraph creates a new line graph component with default settings

func (*LineGraph) ToStyledNode

func (l *LineGraph) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the line graph to a styled node for terminal rendering

func (*LineGraph) WithColor

func (l *LineGraph) WithColor(c string) *LineGraph

WithColor sets the primary color

func (*LineGraph) WithDesignTokens

func (l *LineGraph) WithDesignTokens(tokens *design.DesignTokens) *LineGraph

WithDesignTokens sets custom design tokens

func (*LineGraph) WithSize

func (l *LineGraph) WithSize(width, height int) *LineGraph

WithSize sets the width and height

func (*LineGraph) WithTheme

func (l *LineGraph) WithTheme(theme string) *LineGraph

WithTheme sets the theme

type LoadingDots

type LoadingDots struct {
	Phase      int
	MaxPhases  int
	Interval   time.Duration
	LastUpdate time.Time
	Foreground *color.Color
}

LoadingDots represents an animated loading indicator

func NewLoadingDots

func NewLoadingDots() *LoadingDots

NewLoadingDots creates a new loading dots component

func (*LoadingDots) ToStyledNode

func (l *LoadingDots) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the loading dots to a styled node

func (*LoadingDots) Update

func (l *LoadingDots) Update(now time.Time) bool

Update updates the animation state

type MessageBlock

type MessageBlock struct {
	Text        string
	Foreground  *color.Color
	Background  *color.Color
	Border      renderer.BorderChars
	BorderColor *color.Color
}

MessageBlock represents a styled message box

func NewMessageBlock

func NewMessageBlock(text string) *MessageBlock

NewMessageBlock creates a new message block with default styling

func (*MessageBlock) ToStyledNode

func (m *MessageBlock) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the message block to a styled node

func (*MessageBlock) WithBackground

func (m *MessageBlock) WithBackground(c *color.Color) *MessageBlock

WithBackground sets the background color

func (*MessageBlock) WithBorder

func (m *MessageBlock) WithBorder(border renderer.BorderChars) *MessageBlock

WithBorder sets the border style

func (*MessageBlock) WithBorderColor

func (m *MessageBlock) WithBorderColor(c *color.Color) *MessageBlock

WithBorderColor sets the border color

func (*MessageBlock) WithForeground

func (m *MessageBlock) WithForeground(c *color.Color) *MessageBlock

WithForeground sets the foreground color

type ProgressBar

type ProgressBar struct {
	Progress   float64 // 0.0 to 1.0
	Width      int
	Foreground *color.Color
	Background *color.Color
}

ProgressBar represents a progress bar component

func NewProgressBar

func NewProgressBar(width int) *ProgressBar

NewProgressBar creates a new progress bar

func (*ProgressBar) SetProgress

func (p *ProgressBar) SetProgress(progress float64)

SetProgress sets the progress value (0.0 to 1.0)

func (*ProgressBar) ToStyledNode

func (p *ProgressBar) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the progress bar to a styled node

type ScatterPlot

type ScatterPlot struct {
	Data         dataviz.ScatterPlotData
	Width        int
	Height       int
	Color        string
	Theme        string
	DesignTokens *design.DesignTokens
}

ScatterPlot represents a scatter plot visualization component

func NewScatterPlot

func NewScatterPlot(data dataviz.ScatterPlotData) *ScatterPlot

NewScatterPlot creates a new scatter plot component with default settings

func (*ScatterPlot) Render

func (s *ScatterPlot) Render() string

Render converts the scatter plot to a string for terminal display

func (*ScatterPlot) ToStyledNode

func (s *ScatterPlot) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the scatter plot to a styled node for terminal rendering

func (*ScatterPlot) WithColor

func (s *ScatterPlot) WithColor(c string) *ScatterPlot

WithColor sets the primary color

func (*ScatterPlot) WithDesignTokens

func (s *ScatterPlot) WithDesignTokens(tokens *design.DesignTokens) *ScatterPlot

WithDesignTokens sets custom design tokens

func (*ScatterPlot) WithSize

func (s *ScatterPlot) WithSize(width, height int) *ScatterPlot

WithSize sets the width and height

func (*ScatterPlot) WithTheme

func (s *ScatterPlot) WithTheme(theme string) *ScatterPlot

WithTheme sets the theme

type SpinnerDots

type SpinnerDots struct {
	Phase      int
	Interval   time.Duration
	LastUpdate time.Time
	Foreground *color.Color
	// contains filtered or unexported fields
}

SpinnerDots represents a spinning dot animation

func NewSpinnerDots

func NewSpinnerDots() *SpinnerDots

NewSpinnerDots creates a new spinner dots component

func (*SpinnerDots) ToStyledNode

func (s *SpinnerDots) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the spinner to a styled node

func (*SpinnerDots) Update

func (s *SpinnerDots) Update(now time.Time) bool

Update updates the animation state

type StatCard

type StatCard struct {
	Data         dataviz.StatCardData
	Width        int
	Height       int
	Color        string
	Theme        string
	DesignTokens *design.DesignTokens
}

StatCard represents a statistics card with trend visualization

func NewStatCard

func NewStatCard(data dataviz.StatCardData) *StatCard

NewStatCard creates a new stat card component with default settings

func (*StatCard) ToStyledNode

func (s *StatCard) ToStyledNode() *renderer.StyledNode

ToStyledNode converts the stat card to a styled node for terminal rendering

func (*StatCard) WithColor

func (s *StatCard) WithColor(c string) *StatCard

WithColor sets the primary color

func (*StatCard) WithDesignTokens

func (s *StatCard) WithDesignTokens(tokens *design.DesignTokens) *StatCard

WithDesignTokens sets custom design tokens

func (*StatCard) WithSize

func (s *StatCard) WithSize(width, height int) *StatCard

WithSize sets the width and height

func (*StatCard) WithTheme

func (s *StatCard) WithTheme(theme string) *StatCard

WithTheme sets the theme

Jump to

Keyboard shortcuts

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