Documentation
¶
Index ¶
- type BarChart
- type BarChartOption
- type HeatMap
- type HeatMapOption
- type LineChart
- type LineChartOption
- type ProgressBar
- func (pb *ProgressBar) Blur()
- func (pb *ProgressBar) Focus()
- func (pb *ProgressBar) Focused() bool
- func (pb *ProgressBar) GetProgress() float64
- func (pb *ProgressBar) Increment(delta float64)
- func (pb *ProgressBar) Init() tea.Cmd
- func (pb *ProgressBar) SetLabel(s string)
- func (pb *ProgressBar) SetProgress(p float64)
- func (pb *ProgressBar) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (pb *ProgressBar) View() string
- type ProgressBarOption
- func WithProgressBarDesignTokens(tokens *design.DesignTokens) ProgressBarOption
- func WithProgressBarEmptyChar(r rune) ProgressBarOption
- func WithProgressBarFilledChar(r rune) ProgressBarOption
- func WithProgressBarGradient(start, end colorpkg.Color) ProgressBarOption
- func WithProgressBarLabel(label string) ProgressBarOption
- func WithProgressBarMultiStopGradient(stops []colorpkg.GradientStop) ProgressBarOption
- func WithProgressBarShowPercent(show bool) ProgressBarOption
- func WithProgressBarStyle(style ProgressBarStyle) ProgressBarOption
- func WithProgressBarTheme(theme string) ProgressBarOption
- func WithProgressBarWidth(width int) ProgressBarOption
- type ProgressBarStyle
- type ScatterPlot
- type ScatterPlotOption
- type Sparkline
- func (s *Sparkline) Blur()
- func (s *Sparkline) Focus()
- func (s *Sparkline) Focused() bool
- func (s *Sparkline) Init() tea.Cmd
- func (s *Sparkline) SetData(data []float64)
- func (s *Sparkline) SetLabel(label string)
- func (s *Sparkline) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (s *Sparkline) View() string
- type SparklineOption
- func WithSparklineAutoRange(auto bool) SparklineOption
- func WithSparklineData(data []float64) SparklineOption
- func WithSparklineDesignTokens(tokens *design.DesignTokens) SparklineOption
- func WithSparklineLabel(label string) SparklineOption
- func WithSparklineRange(minVal, maxVal float64) SparklineOption
- func WithSparklineTheme(theme string) SparklineOption
- func WithSparklineWidth(width int) SparklineOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarChart ¶ added in v2.1.0
type BarChart struct {
// contains filtered or unexported fields
}
BarChart wraps dataviz terminal bar chart rendering.
func NewBarChart ¶ added in v2.1.0
func NewBarChart(title string, labels []string, values []float64, opts ...BarChartOption) *BarChart
NewBarChart creates a new BarChart.
func (*BarChart) Blur ¶ added in v2.1.0
func (c *BarChart) Blur()
Blur marks the component unfocused.
func (*BarChart) Focus ¶ added in v2.1.0
func (c *BarChart) Focus()
Focus marks the component focused.
type BarChartOption ¶ added in v2.1.0
type BarChartOption func(*BarChart)
BarChartOption configures a BarChart.
func WithBarChartDesignTokens ¶ added in v2.1.0
func WithBarChartDesignTokens(tokens *design.DesignTokens) BarChartOption
WithBarChartDesignTokens applies design-system tokens.
func WithBarChartHeight ¶ added in v2.1.0
func WithBarChartHeight(height int) BarChartOption
WithBarChartHeight sets chart height.
func WithBarChartTheme ¶ added in v2.1.0
func WithBarChartTheme(theme string) BarChartOption
WithBarChartTheme applies a named theme.
func WithBarChartWidth ¶ added in v2.1.0
func WithBarChartWidth(width int) BarChartOption
WithBarChartWidth sets chart width.
type HeatMap ¶ added in v2.1.0
type HeatMap struct {
// contains filtered or unexported fields
}
HeatMap renders a matrix as colored terminal blocks.
func NewHeatMap ¶ added in v2.1.0
func NewHeatMap(title string, data [][]float64, opts ...HeatMapOption) *HeatMap
NewHeatMap creates a new HeatMap.
func (*HeatMap) Focus ¶ added in v2.1.0
func (c *HeatMap) Focus()
Focus marks the component focused.
type HeatMapOption ¶ added in v2.1.0
type HeatMapOption func(*HeatMap)
HeatMapOption configures a HeatMap.
func WithHeatMapDesignTokens ¶ added in v2.1.0
func WithHeatMapDesignTokens(tokens *design.DesignTokens) HeatMapOption
WithHeatMapDesignTokens applies design-system tokens.
func WithHeatMapHeight ¶ added in v2.1.0
func WithHeatMapHeight(height int) HeatMapOption
WithHeatMapHeight sets chart height.
func WithHeatMapTheme ¶ added in v2.1.0
func WithHeatMapTheme(theme string) HeatMapOption
WithHeatMapTheme applies a named theme.
func WithHeatMapWidth ¶ added in v2.1.0
func WithHeatMapWidth(width int) HeatMapOption
WithHeatMapWidth sets chart width.
type LineChart ¶ added in v2.1.0
type LineChart struct {
// contains filtered or unexported fields
}
LineChart wraps terminal line chart rendering using a braille canvas.
func NewLineChart ¶ added in v2.1.0
func NewLineChart(title string, opts ...LineChartOption) *LineChart
NewLineChart creates a new LineChart.
func (*LineChart) Blur ¶ added in v2.1.0
func (c *LineChart) Blur()
Blur marks the component unfocused.
func (*LineChart) Focus ¶ added in v2.1.0
func (c *LineChart) Focus()
Focus marks the component focused.
type LineChartOption ¶ added in v2.1.0
type LineChartOption func(*LineChart)
LineChartOption configures a LineChart.
func WithLineChartDesignTokens ¶ added in v2.1.0
func WithLineChartDesignTokens(tokens *design.DesignTokens) LineChartOption
WithLineChartDesignTokens applies design-system tokens.
func WithLineChartHeight ¶ added in v2.1.0
func WithLineChartHeight(height int) LineChartOption
WithLineChartHeight sets chart height.
func WithLineChartTheme ¶ added in v2.1.0
func WithLineChartTheme(theme string) LineChartOption
WithLineChartTheme applies a named theme.
func WithLineChartWidth ¶ added in v2.1.0
func WithLineChartWidth(width int) LineChartOption
WithLineChartWidth sets chart width.
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar renders a horizontal progress bar with optional gradient coloring.
func NewProgressBar ¶
func NewProgressBar(progress float64, opts ...ProgressBarOption) *ProgressBar
NewProgressBar creates a new progress bar.
func (*ProgressBar) Focused ¶
func (pb *ProgressBar) Focused() bool
Focused returns whether the component is focused.
func (*ProgressBar) GetProgress ¶
func (pb *ProgressBar) GetProgress() float64
GetProgress returns current progress.
func (*ProgressBar) Increment ¶
func (pb *ProgressBar) Increment(delta float64)
Increment changes progress by delta and clamps to [0, 1].
func (*ProgressBar) SetLabel ¶
func (pb *ProgressBar) SetLabel(s string)
SetLabel sets the right-side label.
func (*ProgressBar) SetProgress ¶
func (pb *ProgressBar) SetProgress(p float64)
SetProgress sets and clamps progress to [0, 1].
type ProgressBarOption ¶
type ProgressBarOption func(*ProgressBar)
ProgressBarOption configures a ProgressBar.
func WithProgressBarDesignTokens ¶
func WithProgressBarDesignTokens(tokens *design.DesignTokens) ProgressBarOption
WithProgressBarDesignTokens applies design-system tokens.
func WithProgressBarEmptyChar ¶
func WithProgressBarEmptyChar(r rune) ProgressBarOption
WithProgressBarEmptyChar sets a custom empty segment character.
func WithProgressBarFilledChar ¶
func WithProgressBarFilledChar(r rune) ProgressBarOption
WithProgressBarFilledChar sets a custom filled segment character.
func WithProgressBarGradient ¶
func WithProgressBarGradient(start, end colorpkg.Color) ProgressBarOption
WithProgressBarGradient configures a two-stop gradient.
func WithProgressBarLabel ¶
func WithProgressBarLabel(label string) ProgressBarOption
WithProgressBarLabel sets the right-side label.
func WithProgressBarMultiStopGradient ¶
func WithProgressBarMultiStopGradient(stops []colorpkg.GradientStop) ProgressBarOption
WithProgressBarMultiStopGradient configures a multi-stop gradient.
func WithProgressBarShowPercent ¶
func WithProgressBarShowPercent(show bool) ProgressBarOption
WithProgressBarShowPercent toggles percent rendering.
func WithProgressBarStyle ¶
func WithProgressBarStyle(style ProgressBarStyle) ProgressBarOption
WithProgressBarStyle sets the bar style.
func WithProgressBarTheme ¶
func WithProgressBarTheme(theme string) ProgressBarOption
WithProgressBarTheme applies a named design-system theme.
func WithProgressBarWidth ¶
func WithProgressBarWidth(width int) ProgressBarOption
WithProgressBarWidth sets the bar width in characters.
type ProgressBarStyle ¶
type ProgressBarStyle int
ProgressBarStyle defines visual styles for the progress bar.
const ( ProgressBarBlock ProgressBarStyle = iota ProgressBarTick ProgressBarClassic ProgressBarThin )
type ScatterPlot ¶ added in v2.1.0
type ScatterPlot struct {
// contains filtered or unexported fields
}
ScatterPlot renders a terminal scatter plot using braille dots.
func NewScatterPlot ¶ added in v2.1.0
func NewScatterPlot(title string, xData, yData []float64, opts ...ScatterPlotOption) *ScatterPlot
NewScatterPlot creates a new ScatterPlot.
func (*ScatterPlot) Blur ¶ added in v2.1.0
func (c *ScatterPlot) Blur()
Blur marks the component unfocused.
func (*ScatterPlot) Focus ¶ added in v2.1.0
func (c *ScatterPlot) Focus()
Focus marks the component focused.
func (*ScatterPlot) Focused ¶ added in v2.1.0
func (c *ScatterPlot) Focused() bool
Focused reports focus state.
func (*ScatterPlot) Init ¶ added in v2.1.0
func (c *ScatterPlot) Init() tea.Cmd
Init initializes the component.
func (*ScatterPlot) View ¶ added in v2.1.0
func (c *ScatterPlot) View() string
View renders the scatter plot using braille dots.
type ScatterPlotOption ¶ added in v2.1.0
type ScatterPlotOption func(*ScatterPlot)
ScatterPlotOption configures a ScatterPlot.
func WithScatterPlotDesignTokens ¶ added in v2.1.0
func WithScatterPlotDesignTokens(tokens *design.DesignTokens) ScatterPlotOption
WithScatterPlotDesignTokens applies design-system tokens.
func WithScatterPlotHeight ¶ added in v2.1.0
func WithScatterPlotHeight(height int) ScatterPlotOption
WithScatterPlotHeight sets chart height.
func WithScatterPlotTheme ¶ added in v2.1.0
func WithScatterPlotTheme(theme string) ScatterPlotOption
WithScatterPlotTheme applies a named theme.
func WithScatterPlotWidth ¶ added in v2.1.0
func WithScatterPlotWidth(width int) ScatterPlotOption
WithScatterPlotWidth sets chart width.
type Sparkline ¶
type Sparkline struct {
// contains filtered or unexported fields
}
Sparkline renders a compact trend line using Unicode block characters.
func NewSparkline ¶
func NewSparkline(data []float64, opts ...SparklineOption) *Sparkline
NewSparkline creates a new sparkline component.
type SparklineOption ¶
type SparklineOption func(*Sparkline)
SparklineOption configures a Sparkline.
func WithSparklineAutoRange ¶
func WithSparklineAutoRange(auto bool) SparklineOption
WithSparklineAutoRange toggles dynamic min/max range calculation.
func WithSparklineData ¶
func WithSparklineData(data []float64) SparklineOption
WithSparklineData sets the sparkline series values.
func WithSparklineDesignTokens ¶
func WithSparklineDesignTokens(tokens *design.DesignTokens) SparklineOption
WithSparklineDesignTokens applies design-system tokens.
func WithSparklineLabel ¶
func WithSparklineLabel(label string) SparklineOption
WithSparklineLabel sets a right-side label.
func WithSparklineRange ¶
func WithSparklineRange(minVal, maxVal float64) SparklineOption
WithSparklineRange sets a fixed value range and disables auto-range.
func WithSparklineTheme ¶
func WithSparklineTheme(theme string) SparklineOption
WithSparklineTheme applies a named design-system theme.
func WithSparklineWidth ¶
func WithSparklineWidth(width int) SparklineOption
WithSparklineWidth sets the sparkline width in characters.