Skip to content

Commit

Permalink
fix(interactions): remove the option for pixelRatio with png snapshot (
Browse files Browse the repository at this point in the history
…#1431)

BREAKING CHANGE: The getPNGSnapshot function no longer has an option for pixelRatio
  • Loading branch information
rshen91 authored Nov 17, 2021
1 parent c5ea600 commit eebb069
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion packages/charts/api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ export class Chart extends React_2.Component<ChartProps, ChartState> {
// (undocumented)
getPNGSnapshot(options?: {
backgroundColor: string;
pixelRatio: number;
}): {
blobOrDataUrl: any;
browser: 'IE11' | 'other';
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/chart.snap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('test getPNGSnapshot in Chart class', () => {
it('should be called', () => {
const chart = new Chart({});
const spy = jest.spyOn(chart, 'getPNGSnapshot');
chart.getPNGSnapshot({ backgroundColor: 'white', pixelRatio: 1 });
chart.getPNGSnapshot({ backgroundColor: 'white' });

expect(spy).toBeCalled();
});
Expand Down
1 change: 0 additions & 1 deletion packages/charts/src/components/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export class Chart extends React.Component<ChartProps, ChartState> {
// eslint-disable-next-line unicorn/no-object-as-default-parameter
options = {
backgroundColor: Colors.Transparent.keyword,
pixelRatio: 2,
},
): {
blobOrDataUrl: any;
Expand Down
1 change: 0 additions & 1 deletion storybook/stories/interactions/17_png_export.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const Example = () => {
const snapshot = chartRef.current.getPNGSnapshot({
// you can set the background and pixel ratio for the PNG export
backgroundColor: 'white',
pixelRatio: 2,
});
if (!snapshot) {
return;
Expand Down

0 comments on commit eebb069

Please sign in to comment.