2024-09-29 18:27:50 +00:00
|
|
|
//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{} {
|
2024-10-03 21:42:50 +00:00
|
|
|
exports := js.Global().Get("Object").New()
|
2024-09-29 18:27:50 +00:00
|
|
|
exports.Set("Hist", js.FuncOf(src.HistPlot))
|
2024-09-30 17:12:28 +00:00
|
|
|
exports.Set("Plot", js.FuncOf(src.Plot))
|
2024-10-03 21:42:50 +00:00
|
|
|
return exports
|
2024-09-29 18:27:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
c := make(chan struct{}, 0)
|
|
|
|
js.Global().Set("__InitPlotExports", js.FuncOf(InitPlotExports))
|
|
|
|
<-c
|
|
|
|
}
|