From 4bc2842cc3151562dc40bbfe0fca1d1f619722f0 Mon Sep 17 00:00:00 2001 From: Erik Escoffier Date: Thu, 17 Nov 2022 14:27:22 +0100 Subject: [PATCH] Explicitely export to PNG --- app/scripts/components/analysis/results/chart-card.tsx | 2 +- app/scripts/components/common/chart/analysis/index.tsx | 2 +- app/scripts/components/common/chart/analysis/utils.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/components/analysis/results/chart-card.tsx b/app/scripts/components/analysis/results/chart-card.tsx index a47520eb6..84269c46c 100644 --- a/app/scripts/components/analysis/results/chart-card.tsx +++ b/app/scripts/components/analysis/results/chart-card.tsx @@ -157,7 +157,7 @@ export default function ChartCard(props: ChartCardProps) { onExportClick(e, 'image')} > - Image (JPG) + Image (PNG)
  • diff --git a/app/scripts/components/common/chart/analysis/index.tsx b/app/scripts/components/common/chart/analysis/index.tsx index feac037f9..aa502c1e6 100644 --- a/app/scripts/components/common/chart/analysis/index.tsx +++ b/app/scripts/components/common/chart/analysis/index.tsx @@ -56,7 +56,7 @@ export default React.forwardRef( lineColors: props.colors }) }); - FileSaver.saveAs(chartImageUrl, `${name}.jpg`); + FileSaver.saveAs(chartImageUrl, `${name}.png`); } }), [uniqueKeys, props.colors, altTitle] diff --git a/app/scripts/components/common/chart/analysis/utils.ts b/app/scripts/components/common/chart/analysis/utils.ts index 2d80734de..681e1f9e9 100644 --- a/app/scripts/components/common/chart/analysis/utils.ts +++ b/app/scripts/components/common/chart/analysis/utils.ts @@ -157,8 +157,8 @@ function drawOnCanvas({ legendHeight ); - const jpg = c.toDataURL('image/jpg'); - return jpg; + const png = c.toDataURL(); + return png; } function loadImageWithPromise(url: string) {