Skip to content

Commit 9bef7ac

Browse files
authored
SSR chart images (#813)
* Initial progress * Add more examples and docs * Support passing background color as query param * Fix SSR image support Grid, Axis, and Rule. Add tests. General improvements * fix `pnpm check` * Prerender chart API endpoints for Cloudflare compatibility and document edge runtime limitations * Skip url.searchParams during prerendering to avoid SvelteKit build error * Fix geo chart server-side rendering by converting GeoState projection from $effect.pre to $derived.by * cleanup old changes.md * Add geo SSR image example * Add Sankey, Tree, and Treemap examples * Improve treemap example (text/clip) * Use `workspace:*` instead of `next` for `examples/*` projects to make sure `pnpm build:examples` is always using up to date library * fix: improve compatibility with UnoCSS Svelte scoped preprocessing * Remove unneeded changeset * Reduce changeset level for stroke/fill improvements
1 parent e974a50 commit 9bef7ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2897
-814
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'layerchart': patch
3+
---
4+
5+
feat: Add `stroke` and `fill` props to `Axis` and `Grid` for explicit color control (useful for SSR where CSS variables are unavailable)

.changeset/quiet-rabbits-listen.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'layerchart': patch
3+
---
4+
5+
fix: improve compatibility with UnoCSS Svelte scoped preprocessing
6+
7+
- Remove TypeScript-only `as` assertions from exported Svelte markup in core mark components so preprocessors that parse markup expressions as plain JavaScript can consume packaged components without failing
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'layerchart': minor
3+
---
4+
5+
feat: Add `renderChart()` to `layerchart/server` for server-side chart-to-image rendering (PNG/JPEG)

changes.md

Lines changed: 0 additions & 197 deletions
This file was deleted.

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@layerstack/svelte-table": "1.0.1-next.18",
3939
"@layerstack/tailwind": "2.0.0-next.21",
4040
"@layerstack/utils": "2.0.0-next.18",
41+
"@napi-rs/canvas": "^0.1.97",
4142
"@shikijs/transformers": "^4.0.2",
4243
"@sveltejs/adapter-cloudflare": "^7.2.8",
4344
"@sveltejs/kit": "^2.55.0",

0 commit comments

Comments
 (0)