Documentation
¶
Overview ¶
Package chart provides braille chart rendering functionality
This package implements high-resolution braille chart rendering for terminal displays. It creates split-axis charts with upload data below and download data above a central axis, using Unicode braille characters for detailed visualization.
Package chart provides data management functionality for braille charts ¶
Package chart provides rendering functionality for braille charts ¶
Package chart provides scaling functionality for braille charts ¶
Package chart provides gradient and styling functionality for braille charts ¶
Package chart provides braille chart rendering functionality
Index ¶
- Constants
- type BrailleChart
- func (bc *BrailleChart) AddDataPoint(upload, download uint64)
- func (bc *BrailleChart) CycleScalingMode() ScalingMode
- func (bc *BrailleChart) GetDataLength() int
- func (bc *BrailleChart) GetMaxValue() uint64
- func (bc *BrailleChart) GetScalingMode() ScalingMode
- func (bc *BrailleChart) GetScalingModeName() string
- func (bc *BrailleChart) IsOverlayMode() bool
- func (bc *BrailleChart) Render() string
- func (bc *BrailleChart) Reset()
- func (bc *BrailleChart) SetHeight(height int)
- func (bc *BrailleChart) SetMaxPoints(maxPoints int)
- func (bc *BrailleChart) SetOverlayMode(enabled bool)
- func (bc *BrailleChart) SetScalingMode(mode ScalingMode)
- func (bc *BrailleChart) SetWidth(width int)
- func (bc *BrailleChart) ToggleOverlayMode()
- type ColorGradient
- type DataPoint
- type ScalingMode
Constants ¶
const ( // Chart configuration constants MinChartHeight = 8 // Minimum chart height in rows )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrailleChart ¶
type BrailleChart struct {
// contains filtered or unexported fields
}
BrailleChart creates beautiful braille-based charts for terminal display
func NewBrailleChart ¶
func NewBrailleChart(maxPoints int) *BrailleChart
NewBrailleChart creates a new braille chart
func (*BrailleChart) AddDataPoint ¶
func (bc *BrailleChart) AddDataPoint(upload, download uint64)
AddDataPoint adds a new data point to the chart
func (*BrailleChart) CycleScalingMode ¶ added in v1.3.0
func (bc *BrailleChart) CycleScalingMode() ScalingMode
CycleScalingMode cycles through available scaling modes
func (*BrailleChart) GetDataLength ¶
func (bc *BrailleChart) GetDataLength() int
GetDataLength returns the number of data points currently stored
func (*BrailleChart) GetMaxValue ¶
func (bc *BrailleChart) GetMaxValue() uint64
GetMaxValue returns the current maximum value for scaling
func (*BrailleChart) GetScalingMode ¶ added in v1.3.0
func (bc *BrailleChart) GetScalingMode() ScalingMode
GetScalingMode returns the current scaling mode
func (*BrailleChart) GetScalingModeName ¶ added in v1.3.0
func (bc *BrailleChart) GetScalingModeName() string
GetScalingModeName returns a human-readable name for the current scaling mode
func (*BrailleChart) IsOverlayMode ¶ added in v1.1.0
func (bc *BrailleChart) IsOverlayMode() bool
IsOverlayMode returns true if overlay mode is enabled
func (*BrailleChart) Render ¶
func (bc *BrailleChart) Render() string
Render renders the braille chart as a string
func (*BrailleChart) Reset ¶
func (bc *BrailleChart) Reset()
Reset clears all data points and resets the chart
func (*BrailleChart) SetHeight ¶
func (bc *BrailleChart) SetHeight(height int)
SetHeight sets the chart height
func (*BrailleChart) SetMaxPoints ¶ added in v1.2.1
func (bc *BrailleChart) SetMaxPoints(maxPoints int)
SetMaxPoints updates the maximum number of data points to maintain If reducing the limit, excess data is trimmed from the beginning
func (*BrailleChart) SetOverlayMode ¶ added in v1.1.0
func (bc *BrailleChart) SetOverlayMode(enabled bool)
SetOverlayMode sets the display mode
func (*BrailleChart) SetScalingMode ¶ added in v1.3.0
func (bc *BrailleChart) SetScalingMode(mode ScalingMode)
SetScalingMode sets the scaling mode for the chart
func (*BrailleChart) SetWidth ¶
func (bc *BrailleChart) SetWidth(width int)
SetWidth sets the chart width
func (*BrailleChart) ToggleOverlayMode ¶ added in v1.1.0
func (bc *BrailleChart) ToggleOverlayMode()
ToggleOverlayMode toggles between split axis and overlay mode
type ColorGradient ¶ added in v1.3.0
ColorGradient represents a color gradient configuration
type ScalingMode ¶ added in v1.3.0
type ScalingMode int
ScalingMode defines how the chart scales data
const ( ScalingLinear ScalingMode = iota ScalingLogarithmic ScalingSquareRoot )