-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_gen.go
More file actions
40 lines (35 loc) · 1.33 KB
/
Copy pathapp_gen.go
File metadata and controls
40 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//go:build js && wasm
// +build js,wasm
// Code generated by guix. DO NOT EDIT.
package main
import (
"github.com/gaarutyunov/guix/pkg/runtime"
"syscall/js"
)
type App struct {
app *runtime.App
}
func NewApp() *App {
c := &App{}
return c
}
func (c *App) BindApp(app *runtime.App) {
c.app = app
}
func (c *App) Render() *runtime.VNode {
return func() *runtime.VNode {
chartData := GetVisibleChartData()
dataChan := InitChartDataChannel()
return runtime.Div(runtime.ID("app"), runtime.Class("chart-container"), runtime.TabIndex(0), runtime.H1(runtime.Class("title"), runtime.Text("Bitcoin Price Chart (Binance Data)")), runtime.P(runtime.Class("subtitle"), runtime.Text("WebGPU-powered candlestick chart with viewport scrolling (~100 candles visible)")), runtime.Canvas(runtime.ID("chart-canvas"), runtime.Width(1200), runtime.Height(700), runtime.GPUChart(NewBitcoinChart(chartData, dataChan))), runtime.Div(runtime.Class("info"), runtime.P(runtime.Text("This chart demonstrates Guix's WebGPU charting capabilities with live Binance data.")), runtime.P(runtime.Text("Data: Bitcoin hourly OHLCV candles. Use mouse wheel, arrow keys, or touch to scroll horizontally."))))
}()
}
func (c *App) Mount(parent js.Value) {
runtime.Mount(c.Render(), parent)
}
func (c *App) Unmount() {
}
func (c *App) Update() {
if c.app != nil {
c.app.Update()
}
}