0.0.9 • Published 2 years ago

@aknakos/sveltekit-plotly v0.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Simple plotly wrapper for svelte

Simple implementation of a wrapper for plotly.js which works with sveltekit. I made this to easily reuse the logic, but feel free to copy the code in the .svelte file to customize however you want and/or if you don't want to install a dependency only for this.

Usage:

<script>
	import ResizableDiv from '@aknakos/sveltekit-resizable-div';
	import { PlotlyLib } from '@aknakos/sveltekit-plotly/store'; //optional

    let reloadPlot = 0; //change this to force reload the plot
    let loaded; // use this to know when the plot is fully loaded

    function onUnhover(){};//unhover event
    function onHover(){};//hover event

    $: $PlotlyLib.Fx.unhover(??);// use the store's PlotlyLib to use the plotly library as you wish for any custom things

</script>

<div>
    <Plotly
        id='id'
        data={[{x:[1,2,3], y:[2,1,3]}]}
        layout={}
        config={}
        on:hover={onHover}
        on:unhover={onUnhover}
        bind:loaded
        {reloadPlot}
    >
    Loading plotly..
    </Plotly>
</div>
0.0.9

2 years ago

0.0.3

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago