chart
One chart spec, two agreeing renderers: a pure-Go SSR SVG (chart/ssr — the page works with JavaScript off) and a sandboxed Observable Plot frame that hydrates it into an interactive chart. The Go tick algorithm is a line-for-line port of d3-array's ticks, so server and client axis labels agree exactly; an e2e agreement test compares both SVGs on awkward ranges. Canonical doc is {type, series[], axes, options} (chart-v1) covering line/bar/area/scatter with axes, legend and title; the data lives in the doc, capped at 10,000 total points across at most 12 series.
v0.1.0sandboxed iframe
Install and mount
go get github.com/DonaldMurillo/gofastr-plugins@v0.5.0
import "github.com/DonaldMurillo/gofastr-plugins/chart"
app.RegisterPlugin(chart.New())Isolation
Runs in an opaque-origin iframe
The frame never gets allow-same-origin, so it cannot reach host cookies, the database, or the host DOM. It talks to the host only over the versioned postMessage bridge, limited to the capabilities listed below.
Manifest
- Plugin version
- 0.1.0
- Framework compat
- >=0.28.0
- Isolation
- sandbox-iframe-opaque
- Sandbox tokens
- allow-scripts
- Capabilities
- document:read, document:write, theme:read
- Optional capabilities
- none
- CSP additions
- none
- Route prefix
/__gofastr/plugin/chart- Entry
/__gofastr/plugin/chart/chart.html- Schema
- chart-v1
- Min height
- 360px
- Docs
- docs/chart.md