From 6f633b3cbbc58dbed0b44ceaa76446976e714dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Pin=C3=A7on?= Date: Mon, 11 Dec 2023 17:03:01 +0100 Subject: [PATCH] fix export --- src/svg/contourMethods.js | 2 +- src/svg/export.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/svg/contourMethods.js b/src/svg/contourMethods.js index 0e2e6e5..2a07432 100644 --- a/src/svg/contourMethods.js +++ b/src/svg/contourMethods.js @@ -7,7 +7,7 @@ import { appendGlow } from './svgDefs'; // Using encodeURIComponent() as replacement function // allows to keep result code readable -// should be in svg.js, but wif we import, the toString method on function will not work properly +// should be in svg.js, but if we import, the toString method on function will not work properly function encodeSVGDataImage(data) { const symbols = /[\r\n%#()<>?[\\\]^`{|}]/g; if (data.indexOf(`http://www.w3.org/2000/svg`) < 0) { diff --git a/src/svg/export.js b/src/svg/export.js index fa6580c..5872448 100644 --- a/src/svg/export.js +++ b/src/svg/export.js @@ -421,7 +421,6 @@ async function exportSvg(svg, width, height, tooltipDefs, chosenCountries, zones let finalScript = ` (function() { ${encodeSVGDataImageStr} - ${imageFromSpecialGElemStr} function duplicateContours(svgElem, transition=false) { Array.from(svgElem.querySelectorAll('.contour-to-dup')).forEach(el => { if (!el.hasAttribute('filter-name')) return; @@ -444,7 +443,7 @@ async function exportSvg(svg, width, height, tooltipDefs, chosenCountries, zones function gElemsToImages(transition=false) { const toTransformToImg = mapElement.querySelectorAll('g[image-class]'); toTransformToImg.forEach(gElem => { - const image = imageFromSpecialGElem(gElem); + const image = ${imageFromSpecialGElemStr}(gElem); gElem.parentNode.append(image); if (transition) { setTimeout(() => {