From ec7f53454fa056713556d5a7918c8ff1af2cc664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?= Date: Mon, 24 Jan 2022 19:34:34 +0100 Subject: [PATCH] mouseover hatches Fixed some typos. Changed mousemove for mouseover and moved the calling of the function tip from the each function to the original place at 519. The arrow function changed to one that tells the id. --- index.html | 294 +++++++++++++++++++++--------------------- modules/ui/editors.js | 12 +- 2 files changed, 153 insertions(+), 153 deletions(-) diff --git a/index.html b/index.html index 4331b7c4..c0f73e2f 100644 --- a/index.html +++ b/index.html @@ -148,153 +148,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4430,6 +4283,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/ui/editors.js b/modules/ui/editors.js index 47a891d4..0b647f78 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -413,10 +413,10 @@ function clearLegend() { function createPicker() { const pos = () => tip("Drag to change the picker position"); const cl = () => tip("Click to close the picker"); - const closePicker = () => contaiter.style("display", "none"); + const closePicker = () => container.style("display", "none"); - const contaiter = d3.select("body").append("svg").attr("id", "pickerContainer").attr("width", "100%").attr("height", "100%"); - contaiter + const container = d3.select("body").append("svg").attr("id", "pickerContainer").attr("width", "100%").attr("height", "100%"); + container .append("rect") .attr("x", 0) .attr("y", 0) @@ -425,7 +425,7 @@ function createPicker() { .attr("opacity", 0.2) .on("mousemove", cl) .on("click", closePicker); - const picker = contaiter + const picker = container .append("g") .attr("id", "picker") .call( @@ -507,16 +507,16 @@ function createPicker() { .attr("y", Math.floor(i / 14)*20 + 20 + (number * 2)) .attr("width", 16) .attr("height", 16) - .on("mousemove", () => tip("Click to fill with the hatching " + this.id)); }); colors .selectAll("rect") .on("click", pickerFillClicked) - .on("mousemove", () => tip("Click to fill with the color")); + .on("mouseover", () => tip("Click to fill with the color")); hatches .selectAll("rect") .on("click", pickerFillClicked) + .on("mouseover", function() { tip("Click to fill with the hatching " + this.id) }); // append box const bbox = picker.node().getBBox();