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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?