
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
a framework for mostly-reusable graphics with svelte
🍰 See examples 🍰 Read the guide 🍰 API docs 🍰 View the Component Gallery 🍰 Try the starter template
Works with Svelte 3 through 5. Note the library itself does not use runes but it is compatible with Svelte 5. This will change in future versions.
All of the examples use Rune syntax but the Svelte 3 and Svelte 4 versions are still available at the documentation archive.
npm install --save layercake
<script>
// The library provides a main wrapper component
// and a bunch empty layout components...
import { LayerCake, Svg, Html, Canvas } from 'layercake';
// ...that you fill with your own chart components,
// that live inside your project and which you
// can copy and paste from here as starting points.
import AxisX from './components/AxisX.svelte';
import AxisY from './components/AxisY.svelte';
import Line from './components/Line.svelte';
import Scatter from './components/Scatter.svelte';
import Labels from './components/Labels.svelte';
const data = [
{ x: 0, y: 1 },
{ x: 1, y: 2 },
{ x: 2, y: 3 }
];
</script>
<style>
.chart-container {
width: 100%;
height: 500px;
}
</style>
<div class="chart-container">
<LayerCake
x='x'
y='y'
{data}
>
<Svg>
<AxisX/>
<AxisY/>
<Line color='#f0c'/>
</Svg>
<Canvas>
<Scatter color='#0fc'/>
</Canvas>
<Html>
<Labels/>
</Html>
</LayerCake>
</div>
MIT
9.0.0
2025-07-24
Breaking changes
title
prop on Svg
and ScaledSvg
layout components is renamed to titleText
to avoid conflicting with the title
snippet namespace. https://github.com/mhkeller/layercake/pull/271title
snippet for those components now creates the outer <title>
tag for you. Previously, the slot was blank and you had to write your own <title>
wrapper. https://github.com/mhkeller/layercake/pull/271fallback
slot on Canvas
and Webgl
layout components was removed. The fallback
text prop is sufficient. https://github.com/mhkeller/layercake/pull/271extents
prop is deprecated https://github.com/mhkeller/layercake/pull/243FAQs
graphics framework for sveltejs
The npm package layercake receives a total of 8,859 weekly downloads. As such, layercake popularity was classified as popular.
We found that layercake demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.