chart

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 2 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.

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) 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) 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) SetOverlayMode added in v1.1.0

func (bc *BrailleChart) SetOverlayMode(enabled bool)

SetOverlayMode sets the display mode

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 DataPoint

type DataPoint struct {
	Upload   uint64
	Download uint64
}

DataPoint represents a single measurement point

Jump to

Keyboard shortcuts

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