Split embedded and standalone chart surfaces

This commit is contained in:
Mikhail Chusavitin
2026-03-15 21:41:38 +03:00
parent df91e24fea
commit 5ce37f9997
15 changed files with 1039 additions and 86 deletions

View File

@@ -4,30 +4,41 @@
The package is intended to be embedded by other Go applications.
Expected package shape:
Current package shape:
- `viewer.RenderHTML(snapshot []byte) ([]byte, error)`
- `viewer.NewHandler(...) http.Handler`
- `viewer.NewHandler(viewer.HandlerOptions{...}) http.Handler`
- `viewer.NewStandaloneHandler(viewer.HandlerOptions{...}) http.Handler`
Exact signatures may change during implementation, but the integration model is fixed:
Integration model:
- embedding app provides the JSON
- chart renders HTML
- embedded mode does not own snapshot selection UI
- standalone mode may provide a local upload screen on `GET /`
## Expected Runtime Endpoints
These endpoints are expected for the standalone binary only:
- `GET /` - viewer page
- `POST /render` - accept one Reanimator JSON payload and return rendered HTML or JSON render result
- `GET /` - upload page
- `POST /render` - accept one Reanimator JSON payload and return rendered HTML
- `GET /healthz` - basic process health
Embedded handler endpoints:
- `GET /` - empty viewer shell with no upload controls
- `POST /render` - accept one Reanimator JSON payload and return rendered HTML
- `GET /healthz` - basic process health
- `GET /static/...` - embedded static assets
## UI Route Rules
- No multi-product navigation
- No upload wizard with preview/confirm/execute stages
- No collector/API-connect workflow
- No background job polling API
- Embedded mode must not force a file picker into host applications
## Response Rules