This is an unofficial package that lets you efficiently use plotly.js inside your Svelte or SvelteKit app.
- Install using
yarn add svelte-plotly.jsornpm install svelte-plotly.js. - Use in your app
<script lang="ts">
import Plot from 'svelte-plotly.js';
const data = [
{
x: [1, 2, 3, 4, 5],
y: [1, 2, 4, 8, 16]
}
];
</script>
<Plot
{data}
layout={{
margin: { t: 0 }
}}
fillParent='width'
debounce={250}
/>- add autosizing
- add debouncing
- add event redirecting
- add unit tests
- add SSR rendering to an image