[READ-ONLY] Mirror of https://github.com/probablykasper/starchart. GitHub star history graph starchart.kasper.space
chart github github-api github-star graph history star star-history stargazers stars
0

Configure Feed

Select the types of activity you want to include in your feed.

Exclude hidden lines from tooltip

Kasper (Mar 3, 2023, 1:04 PM +0100) 7583167e c55384cb

+8 -10
-3
src/routes/Chart.svelte
··· 57 57 chart.deleteLine(line) 58 58 chart.save() 59 59 }} 60 - onVisibleChange={(visible) => { 61 - line.instance.applyOptions({ visible }) 62 - }} 63 60 /> 64 61 {/each} 65 62 </div>
+7 -7
src/routes/Label.svelte
··· 7 7 export let line: Line 8 8 $: hex = hexColors[line.color] 9 9 export let onDelete: () => void 10 - let visible = true 11 - export let onVisibleChange: (visible: boolean) => void 12 10 </script> 13 11 14 12 <!-- svelte-ignore a11y-no-noninteractive-tabindex --> ··· 17 15 style:--color-1={hex} 18 16 style:--color-2={hex + '77'} 19 17 in:scale={{ duration: 200, easing: cubicOut, start: 0.75, opacity: 0 }} 20 - class:hidden={!visible} 18 + class:hidden={line.hidden} 21 19 tabindex="0" 22 20 on:keydown={(e) => { 23 21 if (e.key === ' ' || e.key === 'Enter') { 24 - visible = !visible 25 - onVisibleChange(visible) 22 + line.hidden = !line.hidden 23 + line.instance.applyOptions({ visible: !line.hidden }) 24 + e.preventDefault() 26 25 } else if (e.key === 'Backspace' || e.key === 'Delete') { 27 26 onDelete() 27 + e.preventDefault() 28 28 } 29 29 }} 30 30 > ··· 33 33 class="name" 34 34 tabindex="-1" 35 35 on:click={() => { 36 - visible = !visible 37 - onVisibleChange(visible) 36 + line.hidden = !line.hidden 37 + line.instance.applyOptions({ visible: !line.hidden }) 38 38 }} 39 39 > 40 40 {line.name}
+1
src/routes/chart.ts
··· 21 21 export interface Line extends LineBase { 22 22 instance: ISeriesApi<'Area'> 23 23 deleted: boolean 24 + hidden?: boolean 24 25 } 25 26 26 27 type LineJson = {