From 707d6a44ef8818dc2d3745bfc12d998ba299ab26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Ant=C3=B4nio=20Siqueira?= Date: Tue, 1 Dec 2020 17:43:13 -0300 Subject: [PATCH] Cast color stop offset to number Will parse the offset to number so heatmap.js can be used with local jest tests (canvas node implementation). closes #330 --- src/renderer/canvas2d.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/canvas2d.js b/src/renderer/canvas2d.js index 259c8d14..e86cfe40 100644 --- a/src/renderer/canvas2d.js +++ b/src/renderer/canvas2d.js @@ -11,7 +11,7 @@ var Canvas2dRenderer = (function Canvas2dRendererClosure() { var gradient = paletteCtx.createLinearGradient(0, 0, 256, 1); for (var key in gradientConfig) { - gradient.addColorStop(key, gradientConfig[key]); + gradient.addColorStop(+key, gradientConfig[key]); } paletteCtx.fillStyle = gradient;