From e17e307e5a772447f7c871b85dd5cb72218091d9 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Wed, 9 Jun 2021 18:25:35 +0200 Subject: [PATCH] Increase puppeteer viewport width for resizing (#374) --- source/app/metrics/utils.mjs | 1 + source/templates/classic/image.svg | 2 +- source/templates/repository/image.svg | 4 ++-- source/templates/terminal/image.svg | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs index 788407cf..e21dfc5a 100644 --- a/source/app/metrics/utils.mjs +++ b/source/app/metrics/utils.mjs @@ -313,6 +313,7 @@ export const svg = { //Render through browser and resize height console.debug("metrics/svg/resize > loading svg") const page = await svg.resize.browser.newPage() + page.setViewport({width:980, height:980}) page.on("console", ({_text:text}) => console.debug(`metrics/svg/resize > puppeteer > ${text}`)) await page.setContent(rendered, {waitUntil:["load", "domcontentloaded", "networkidle2"]}) console.debug("metrics/svg/resize > loaded svg successfully") diff --git a/source/templates/classic/image.svg b/source/templates/classic/image.svg index 419cfad7..80406cfe 100644 --- a/source/templates/classic/image.svg +++ b/source/templates/classic/image.svg @@ -17,9 +17,9 @@ Last updated <%= meta.generated %> <% if ((config.timezone?.name)&&(!config.timezone?.error)) { %>(timezone <%= config.timezone.name %>)<% } %> with lowlighter/metrics@<%= meta.version %> <% } %> -
+ diff --git a/source/templates/repository/image.svg b/source/templates/repository/image.svg index c24a5bc3..5ae88790 100644 --- a/source/templates/repository/image.svg +++ b/source/templates/repository/image.svg @@ -30,7 +30,7 @@ <% } %> - - + + \ No newline at end of file diff --git a/source/templates/terminal/image.svg b/source/templates/terminal/image.svg index 2e46eb1e..69ac2f66 100644 --- a/source/templates/terminal/image.svg +++ b/source/templates/terminal/image.svg @@ -56,8 +56,8 @@ Last generated: <%= meta.generated %> <%# -%> <% } -%> - +