From 74ab170fa9d38c389839c09a6bfc46b5d4d23d45 Mon Sep 17 00:00:00 2001 From: Andrew Michael McNutt Date: Mon, 22 Jan 2024 14:16:41 -0800 Subject: [PATCH] fix example outline, ensure tooltip stays where you put it --- src/components/Example.svelte | 2 +- src/components/Tooltip.svelte | 13 ++++++++++--- src/lib/charts.ts | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/Example.svelte b/src/components/Example.svelte index ab4f2d54..e4bc11aa 100644 --- a/src/components/Example.svelte +++ b/src/components/Example.svelte @@ -21,7 +21,7 @@ bg: string ) { const numInUse = countNumberOfExamplesInUse(example); - let svg = example.replace("SaLmOn", bg); + let svg = example.replace("rebekkablue", bg); // .replace("]*\sheight="([^"]*)"/)) { svg = svg.replace(" { x.removeEventListener("click", onClick); + // remove select-none class + const newClass = x.getAttribute("class").replace("select-none", ""); + x.setAttribute("class", newClass); }); } function toggle() { @@ -35,6 +39,8 @@ document.querySelectorAll(query).forEach((x) => { x.addEventListener("click", onClick); + const newClass = x.getAttribute("class") + " select-none"; + x.setAttribute("class", newClass); }); } $: topString = boundingBox @@ -49,9 +55,10 @@ } } $: { - if (allowDrag && $configStore.tooltipXY) { - topString = $configStore.tooltipXY[1]; - leftString = $configStore.tooltipXY[0]; + if (tooltipOpen && allowDrag && $configStore.tooltipXY?.length) { + const [x, y] = $configStore.tooltipXY; + topString = y; + leftString = x; } } diff --git a/src/lib/charts.ts b/src/lib/charts.ts index f2706a43..f60848b0 100644 --- a/src/lib/charts.ts +++ b/src/lib/charts.ts @@ -35,7 +35,7 @@ export function buildTheme(pal: Palette): any { const basicColor = pal.background.luminance() > 0.5 ? "#000000" : "#ffffff"; // const secondLevelElementColor = "#605E5C"; // const backgroundColor = pal.background.toHex(); - const backgroundColor = "SaLmOn"; + const backgroundColor = "rebekkablue"; // const backgroundSecondaryColor = "#C8C6C4"; return {