thist

A go package for generating online histograms and plotting them in the terminal and PDFs

Github星跟蹤圖

thist - a go package for calculating online histograms with plotting to the terminal and images

Documentation
Go Report Card

Check out the watch subcommands from the csvtk and seqkit tools to see the code in action.

Example

package main

import (
        "fmt"
        "github.com/bsipos/thist"
        "math/rand"
        "time"
)

// randStream return a channel filled with endless normal random values
func randStream() chan float64 {
        c := make(chan float64)
        go func() {
                for {
                        c <- rand.NormFloat64()
                }
        }()
        return c
}

func main() {
        // create new histogram
        h := thist.NewHist(nil, "Example histogram", "auto", -1, true)
        c := randStream()

        i := 0
        for {
                // add data point to hsitogram
                h.Update(<-c)
                if i%50 == 0 {
                        // draw histogram
                        fmt.Println(h.Draw())
                        time.Sleep(time.Second)
                }
                i++
        }
}

demo video

TODO

  • Add more details on online histogram generation.
  • Add separate object for online estimation of moments.
  • Maybe add tcell as a back-end?

主要指標

概覽
名稱與所有者bsipos/thist
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2019-06-05 10:21:06
推送於2022-02-20 22:29:33
最后一次提交2020-03-21 14:50:11
發布數1
最新版本名稱v1.0.0 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數106
關注者數1
派生數11
提交數36
已啟用問題?
問題數2
打開的問題數1
拉請求數0
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?