MCPcopy Index your code
hub / github.com/bsipos/thist

github.com/bsipos/thist @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
34 symbols 78 edges 6 files 32 documented · 94%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Documentation Go Report Card

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?

Core symbols most depended-on inside this repo

mean
called by 4
util.go
absFloats
called by 4
util.go
AutoLabel
called by 4
util.go
buildBins
called by 3
hist.go
NormCounts
called by 3
hist.go
updatePrecision
called by 3
hist.go
updateInfo
called by 2
hist.go
updateMoments
called by 2
hist.go

Shape

Function 22
Method 11
Struct 1

Languages

Go100%

Modules by API surface

util.go13 symbols
hist.go13 symbols
plot.go3 symbols
examples/basic.go2 symbols
bar.go2 symbols
img.go1 symbols

For agents

$ claude mcp add thist \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact