+
{#if exampleIdx === -1}
+ allowInteraction &&
focusStore.setColors(
dealWithFocusEvent(e, i, $focusStore.focusedColors)
)}
@@ -102,13 +104,14 @@
}`}
style={`${styleMap(colors[colorIdx])}`}
on:click|preventDefault|stopPropagation={(e) => {
- focusStore.setColors(
- dealWithFocusEvent(
- e,
- colorIdx,
- $focusStore.focusedColors
- )
- );
+ allowInteraction &&
+ focusStore.setColors(
+ dealWithFocusEvent(
+ e,
+ colorIdx,
+ $focusStore.focusedColors
+ )
+ );
}}
>
{/each}
@@ -125,9 +128,10 @@
}deg)`}
class="mr-2 w-16"
on:click|preventDefault|stopPropagation={(e) => {
- focusStore.setColors(
- dealWithFocusEvent(e, i, $focusStore.focusedColors)
- );
+ allowInteraction &&
+ focusStore.setColors(
+ dealWithFocusEvent(e, i, $focusStore.focusedColors)
+ );
}}
>
{color.toHex()}
diff --git a/src/lib/lints/max-colors.ts b/src/lib/lints/max-colors.ts
index efc7a664..1fec7e17 100644
--- a/src/lib/lints/max-colors.ts
+++ b/src/lib/lints/max-colors.ts
@@ -7,7 +7,7 @@ const lint: CustomLint = {
program: JSONToPrettyString({
// @ts-ignore
$schema: `${location.href}lint-schema.json`,
- "<": { left: { count: "colors" }, right: 10 },
+ "<": { left: { count: "colors" }, right: 11 },
}),
taskTypes: ["sequential", "diverging", "categorical"] as const,
level: "warning",
diff --git a/src/scatterplot/ColorScatterPlot.svelte b/src/scatterplot/ColorScatterPlot.svelte
index f2a9bee7..78ff7456 100644
--- a/src/scatterplot/ColorScatterPlot.svelte
+++ b/src/scatterplot/ColorScatterPlot.svelte
@@ -34,7 +34,7 @@
$: focusSet = new Set(focusedColors);
- let margin = { top: 15, right: 15, bottom: 15, left: 15 };
+ let margin = { top: 20, right: 15, bottom: 15, left: 15 };
$: plotWidth = width - margin.left - margin.right;
$: plotHeight = height - margin.top - margin.bottom;
$: extents = {
@@ -468,6 +468,17 @@
on:touchend|preventDefault={puttingEnd}
/>
{/if}
+
+
+ {#if typeof hoveredPoint !== "boolean"}
+
+
+ {hoveredPoint.toHex()}
+
+ {hoveredPoint.toPrettyString()}
+
+
+ {/if}