diff --git a/README.md b/README.md
index ef9cc006..01d4b79f 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ The 2D graph displays hue/chroma graph and the 1D graph displays lightness. You
- [x] Reduce the visual impact of the axes and labels by making them transparent gray. Set the colors, made them adaptive, set the luminance flip to .3 (50% visually)
- [x] Flip the Y axis (zero at the bottom)
-- [ ] Make the labels integers for CIELAB
+- [x] Make the labels integers for CIELAB
- [x] Make the axis scale sliders less visualy prominent.
- [ ] Consider removing the axis sliders, replace them with zoom controls in the same panel as the background color selection. Changing these values is rare, they don't need to take up so much UX space.
- [ ] The 2D graph should always be a centered hue/chroma graph. CIELAB and CIELCH would therefore use the same graph. Leave the LAB vs LCH distinction for slider based editing.
@@ -59,12 +59,12 @@ To raise the sliders, you need to click on one of the examples that are displaye
- [ ] Eval response options
- [ ] higher card. vis examples
- [ ] Distribute radially
-- [ ] Rearrange some of the colors in the color area eg make rg on xy and b on z etc
-- [ ] "opposing color" to "Convert selection to opposing"
+- [?] Rearrange some of the colors in the color area eg make rg on xy and b on z etc
- [ ] Insert color theory options, eg insert opposing, inserting analogous color, etc, mine from the adobe picker
- [ ] NTH: Rest of basic geometry manipulations: flip (horizontal, vertical), scale
- [ ] Examples held as assets somewhere that are downloaded rather than components (for consistency)
- [ ] Labels, tooltips, etc
+- [x] "opposing color" to "Convert selection to opposing"
- [x] Meta: figure out all the other features in maureen's setup
- [x] order as diverging
- [x] Make it possible to ignore / dismiss lints
diff --git a/src/components/ColorScatterPlot.svelte b/src/components/ColorScatterPlot.svelte
index 9b6d3cf4..4a822272 100644
--- a/src/components/ColorScatterPlot.svelte
+++ b/src/components/ColorScatterPlot.svelte
@@ -9,10 +9,9 @@
import { makeExtents, deDup, toggleElement } from "../lib/utils";
import navStore from "../stores/nav-store";
import { scaleLinear } from "d3-scale";
- import DoubleRangeSlider from "../components/DoubleRangeSlider.svelte";
- import VerticalDoubleRangeSlider from "../components/VerticalDoubleRangeSlider.svelte";
import simulate_cvd from "../lib/blindness";
import ColorScatterPlotXyGuides from "./ColorScatterPlotXYGuides.svelte";
+ import ColorScatterPlotZGuide from "./ColorScatterPlotZGuide.svelte";
export let scatterPlotMode: "moving" | "looking";
@@ -38,7 +37,11 @@
const margin = { top: 15, right: 15, bottom: 15, left: 15 };
const plotWidth = width - margin.left - margin.right;
const plotHeight = height - margin.top - margin.bottom;
- let extents = { x: [0, 1], y: [0, 1], z: [0, 1] };
+ $: extents = {
+ x: $navStore.xZoom,
+ y: $navStore.yZoom,
+ z: $navStore.zZoom,
+ };
$: pickedColors = focusedColors.map((x) => colors[x].toChannels());
$: selectionExtents = makeExtents(pickedColors);
$: xPos = xScale(selectionExtents.x[0] - 7.5);
@@ -58,13 +61,27 @@
$: xRange = config.xDomain;
$: domainXScale = scaleLinear().domain([0, 1]).range(xRange);
$: xScale = scaleLinear()
- .domain([domainXScale(extents.x[0]), domainXScale(extents.x[1])])
+ .domain([
+ xRange[0] > xRange[1]
+ ? domainXScale(extents.x[1])
+ : domainXScale(extents.x[0]),
+ xRange[0] > xRange[1]
+ ? domainXScale(extents.x[0])
+ : domainXScale(extents.x[1]),
+ ])
.range([0, plotWidth]);
$: yRange = config.yDomain;
$: domainYScale = scaleLinear().domain([0, 1]).range(yRange);
$: yScale = scaleLinear()
- .domain([domainYScale(extents.y[0]), domainYScale(extents.y[1])])
+ .domain([
+ yRange[0] > yRange[1]
+ ? domainYScale(extents.y[1])
+ : domainYScale(extents.y[0]),
+ yRange[0] > yRange[1]
+ ? domainYScale(extents.y[0])
+ : domainYScale(extents.y[1]),
+ ])
.range([0, plotHeight]);
$: zRange = config.zDomain;
@@ -72,7 +89,6 @@
$: zScale = scaleLinear()
.domain([domainLScale(extents.z[0]), domainLScale(extents.z[1])])
.range([0, plotHeight]);
- $: [zMin, zMax] = zScale.domain();
let dragging: false | { x: number; y: number } = false;
let dragBox: false | { x: number; y: number } = false;
@@ -223,18 +239,6 @@
onFocusedColorsChange([...newFocusedColors]);
}
- $: zPoints = {
- top: {
- y: zScale.range()[0] + 15,
- label: `${config.zChannel.toUpperCase()}: ${zScale
- .domain()[0]
- .toFixed(1)}`,
- },
- bottom: {
- y: zScale.range()[1] - 5,
- label: zScale.domain()[1].toFixed(1),
- },
- };
// $: axisColor = bg.luminance() > 0.5 ? "gray" : "white";
$: luminance = bg.toChroma().luminance();
$: axisColor = luminance > 0.4 ? "#00000022" : "#ffffff55";
@@ -249,19 +253,17 @@
-