/blocks

Simple numeric data visualization for Golang applications.

Primary LanguageGoDo What The F*ck You Want To Public LicenseWTFPL

blocks

Build Status Coverage

Package blocks implements interactive conversion from numeric data to the block chart. Inspired by spark.

Blocks Preview

Installation

$ go get -u github.com/zitryss/blocks

Example

package main

import (
	"time"

	"github.com/shirou/gopsutil/cpu"
	"github.com/zitryss/blocks"
)

func main() {
	b := blocks.New()
	b.SetSize(40)
	for {
		cpuLoad, _ := cpu.Percent(1*time.Second, false)
		b.Add(int(cpuLoad[0]))
		b.Draw()
	}
}