shortcuts/plot/main.go
2024-09-30 19:12:28 +02:00

24 lines
420 B
Go

//go:build js && wasm
// +build js,wasm
package main
import (
"l12.xyz/x/shortcuts/plot/src"
"syscall/js"
)
func InitPlotExports(this js.Value, args []js.Value) interface{} {
exports := args[0]
exports.Set("Hist", js.FuncOf(src.HistPlot))
exports.Set("Plot", js.FuncOf(src.Plot))
return nil
}
func main() {
c := make(chan struct{}, 0)
js.Global().Set("__InitPlotExports", js.FuncOf(InitPlotExports))
<-c
}