chart

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 4 Imported by: 0

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

View Source
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

type ColorGradient struct {
	Steps []lipgloss.Color
}

ColorGradient represents a color gradient configuration

type DataPoint

type DataPoint struct {
	Upload   uint64
	Download uint64
}

DataPoint represents a single measurement point

type ScalingMode added in v1.3.0

type ScalingMode int

ScalingMode defines how the chart scales data

const (
	ScalingLinear ScalingMode = iota
	ScalingLogarithmic
	ScalingSquareRoot
)

Jump to

Keyboard shortcuts

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