Skip to content

Commit

Permalink
Use string interpolation to construct heatmap string
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Mar 22, 2024
1 parent 047fede commit 5833428
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/thyme/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ class Heatmap {
/*
Construct heatmap SVG
*/
let pointsStr = "0," + maxHeight + " ";
let pointsStr = `0,${maxHeight} `;
for (let x = 0; x < pixels.length; x++) {
pointsStr += x + "," + (maxHeight - amplitude * pixels[x]) + " ";
pointsStr += `${x},${maxHeight - amplitude * pixels[x]} `;
}
pointsStr += "" + width + "," + maxHeight;
pointsStr += `${width},${maxHeight}`;

const heatmapStr = `<svg width="${(width - stickOutWidthOneSided - thresh)}"
height="${maxHeight}">
Expand Down

0 comments on commit 5833428

Please sign in to comment.