Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressElement ¶
type ProgressElement struct {
*pb.ProgressBar
}
ProgressElement renders a progress bar. This wraps the cheggaaa/pb package since that provides important functionality. This uses single call renders to render the progress bar as values change.
func Progress ¶
func Progress(total int) *ProgressElement
Progress creates a new progress bar element with the given total. For more fine-grained control, please construct a ProgressElement directly.
func (*ProgressElement) Body ¶
func (el *ProgressElement) Body(context.Context) glint.Component
type SparklineComponent ¶
type SparklineComponent struct { sync.Mutex // If set, this will style the peak value. PeakStyle []glint.StyleOption // contains filtered or unexported fields }
SparklineComponent renders a sparkline graph.
func Sparkline ¶
func Sparkline(values []uint) *SparklineComponent
Sparkline creates a SparklineComponent with the given set of initial values. These initial values will also specify the max width for this sparkline unless values are replaced with Set.
func (*SparklineComponent) Append ¶
func (c *SparklineComponent) Append(values ...uint)
Append adds the given values to the end of the values buffer. The buffer size is determined by the values list given in Sparkline or Set. This will overwrite the oldest values.
func (*SparklineComponent) Body ¶
func (c *SparklineComponent) Body(context.Context) glint.Component
func (*SparklineComponent) Set ¶
func (c *SparklineComponent) Set(values []uint)
Set sets the full set of values to the given slice. This will also reset the size of the sparkline to this length.
type SpinnerComponent ¶
type SpinnerComponent struct {
// contains filtered or unexported fields
}
func Spinner ¶
func Spinner() *SpinnerComponent
Spinner creates a new spinner. The created spinner should NOT be started or data races will occur that can result in a panic.
func (*SpinnerComponent) Body ¶
func (c *SpinnerComponent) Body(context.Context) glint.Component
type StopwatchComponent ¶
type StopwatchComponent struct {
// contains filtered or unexported fields
}
func Stopwatch ¶
func Stopwatch(start time.Time) *StopwatchComponent
Stopwatch creates a new stopwatch component that starts at the given time.
func (*StopwatchComponent) Body ¶
func (c *StopwatchComponent) Body(context.Context) glint.Component