canvas-heatmap
Advanced tools
Comparing version 1.2.22 to 1.2.23
{ | ||
"name": "canvas-heatmap", | ||
"version": "1.2.22", | ||
"version": "1.2.23", | ||
"description": "Interactive heatmap, capable of displaying 1,000,000+ data points using canvas and d3. ", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -57,4 +57,4 @@ import { | ||
const context = addCanvas(div, options); | ||
const svg = addSVG(div, options); | ||
const context = addCanvas(div, options); | ||
@@ -204,2 +204,3 @@ timeFormatDefaultLocale(languageOptions(options.language)); | ||
{ name: "tooltip", default: true, verify: verifyBool }, | ||
{ name: "levels", default: false, verify: verifyBool }, | ||
{ name: "title", default: false, verify: verifyString }, | ||
@@ -375,3 +376,3 @@ { name: "zMin", default: false, verify: verifyNumber }, | ||
.style("pointer-events", "none") | ||
.style("z-index", 0) | ||
.style("z-index", -1) | ||
.style("position", "absolute") | ||
@@ -623,4 +624,18 @@ .style("left", left) | ||
var lang = languageOptions(options.language) | ||
// Add vertical point identifier | ||
var vpi = svg | ||
.append("g") | ||
.style("opacity", 0) | ||
.attr("id", "xline_" + div); | ||
if (options.levels) | ||
vpi | ||
.append("line") | ||
.attr("y1", 0) | ||
.attr("y2", options.canvasHeight) | ||
.style("stroke-width", 1) | ||
.style("stroke", "white") | ||
.style("fill", "none"); | ||
var lang = languageOptions(options.language); | ||
zoombox.on("mousemove", (event) => { | ||
@@ -678,2 +693,3 @@ try { | ||
.style("opacity", 1); | ||
select("#zpointer_" + div) | ||
@@ -691,3 +707,28 @@ .attr( | ||
if (options.hover) options.hover({ mousex: xi, mousey: yi, idx }); | ||
// Add vertical point identifier | ||
if (options.levels) { | ||
vpi.selectAll("circle").remove(); | ||
for (var yp of process.y) { | ||
if (yAxis.ax(yp) >= 0 && yAxis.ax(yp) <= options.canvasHeight) { | ||
vpi | ||
.append("circle") | ||
.attr("cy", yAxis.ax(yp)) | ||
.attr("r", 2) | ||
.style("fill", "white"); | ||
} | ||
} | ||
vpi | ||
.attr( | ||
"transform", | ||
"translate(" + | ||
xAxis.ax(process.x[xi]) + | ||
options.marginLeft + | ||
10 + | ||
",0)" | ||
) | ||
.style("opacity", 0.7); | ||
} | ||
} catch (e) { | ||
vpi.style("opacity", 0); | ||
tooltip.style("opacity", 0); | ||
@@ -700,4 +741,5 @@ select("#zpointer_" + div).style("opacity", 0); | ||
zoombox.on("mouseout", () => { | ||
tooltip.style("opacity", 0); | ||
select("#zpointer_" + div).style("opacity", 0); | ||
vpi.style("opacity", 0); | ||
tooltip.style("opacity", 1); | ||
select("#zpointer_" + div).style("opacity", 1); | ||
if (options.hover) options.hover({ mousex: false, mousey: false }); | ||
@@ -704,0 +746,0 @@ }); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
930095
7937