Skip to content

Commit

Permalink
feat: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
pepper-nice committed Nov 8, 2022
1 parent 59d9ef3 commit 8763716
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 4 deletions.
Binary file modified __tests__/integration/snapshots/agesIntervalRadialStacked.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/airportsPointChoropleth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/countries50mWorldMap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/flarePointCirclePack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/gdpIntervalFlex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/gdpIntervalVarSize.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/haleChoroplethWorld.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/penguinsPointLink.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/populationIntervalRose.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/seattleWeatherPoint1d.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/integration/snapshots/unemploymentChoropleth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 20 additions & 4 deletions src/utils/size.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { G2ViewTree } from '../runtime';
import { G2View } from '../runtime';

type Size = {
width: number;
Expand Down Expand Up @@ -65,7 +65,7 @@ export function getChartSize(
/**
* @description Calculate the real canvas size by view options.
*/
export function getBBoxSize(options: G2ViewTree): Size {
export function getBBoxSize(options: G2View): Size {
const {
height,
width,
Expand All @@ -77,10 +77,26 @@ export function getBBoxSize(options: G2ViewTree): Size {
marginRight = 0,
marginTop = 0,
marginBottom = 0,
insetLeft = 0,
insetRight = 0,
insetTop = 0,
insetBottom = 0,
} = options;
const finalWidth =
width - paddingLeft - paddingRight - marginLeft - marginRight;
width -
paddingLeft -
paddingRight -
marginLeft -
marginRight -
insetLeft -
insetRight;
const finalHeight =
height - paddingTop - paddingBottom - marginTop - marginBottom;
height -
paddingTop -
paddingBottom -
marginTop -
marginBottom -
insetTop -
insetBottom;
return { width: finalWidth, height: finalHeight };
}

0 comments on commit 8763716

Please sign in to comment.