Skip to content

Commit

Permalink
Merge pull request #339 from NASA-IMPACT/feature/export-as-png
Browse files Browse the repository at this point in the history
Explicitely export to PNG
  • Loading branch information
nerik authored Nov 17, 2022
2 parents f8c0e20 + 4bc2842 commit 60a631b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/scripts/components/analysis/results/chart-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function ChartCard(props: ChartCardProps) {
<DropMenuItemButton
onClick={(e) => onExportClick(e, 'image')}
>
Image (JPG)
Image (PNG)
</DropMenuItemButton>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/common/chart/analysis/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default React.forwardRef<AnalysisChartRef, AnalysisChartProps>(
lineColors: props.colors
})
});
FileSaver.saveAs(chartImageUrl, `${name}.jpg`);
FileSaver.saveAs(chartImageUrl, `${name}.png`);
}
}),
[uniqueKeys, props.colors, altTitle]
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/components/common/chart/analysis/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 60a631b

Please sign in to comment.