Created
January 2, 2020 20:27
-
-
Save mhkeller/296e4040fdc62209ae34e4fa6e911428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { LayerCake, Svg, calcExtents, flatten } from 'layercake'; | |
import { tweened } from 'svelte/motion'; | |
import * as eases from 'svelte/easing'; | |
import Line from '../../components/Line.svelte'; | |
export let data; | |
export let shared; | |
const y = tweened(undefined, { | |
duration: 300, | |
easing: eases.cubicInOut | |
}); | |
$: y.set(shared ? [0, 100] : get_extents(data)); | |
</script> | |
<LayerCake | |
padding={{ top: 2, right: 6, bottom: 2, left: 6 }} | |
x={'x'} | |
y={'y'} | |
{data} | |
y_scale={y} | |
> | |
<Svg> | |
<Line | |
stroke={'#000'} | |
/> | |
</Svg> | |
</LayerCake> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment