Skip to content

Commit

Permalink
fix export
Browse files Browse the repository at this point in the history
  • Loading branch information
qpincon committed Dec 11, 2023
1 parent 83ec8d0 commit 6f633b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/svg/contourMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions src/svg/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(() => {
Expand Down

0 comments on commit 6f633b3

Please sign in to comment.