[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.

Mobile tooltip support

Kasper (Mar 3, 2023, 12:21 PM +0100) c55384cb 7dc2dd2e

+7 -1
+7 -1
src/routes/Tooltip.svelte
··· 16 16 $: starScale = $chart.instance.priceScale('right') 17 17 $: timeScale = $chart.instance.timeScale() 18 18 19 - function onMouseMove(e: MouseEvent) { 19 + function onTouchMove() { 20 + left = 10 21 + top = 10 22 + } 23 + function onMouseMove(e: { clientX: number; clientY: number }) { 20 24 const bounds = $chart.container.getBoundingClientRect() 21 25 const x = e.clientX - bounds.left 22 26 const y = e.clientY - bounds.top ··· 31 35 } 32 36 } 33 37 $chart.container.addEventListener('mousemove', onMouseMove) 38 + $chart.container.addEventListener('touchmove', onTouchMove) 34 39 onDestroy(() => { 35 40 $chart.container.removeEventListener('mousemove', onMouseMove) 41 + $chart.container.removeEventListener('touchmove', onTouchMove) 36 42 }) 37 43 38 44 /** Binary search */