react-simple-maps icon indicating copy to clipboard operation
react-simple-maps copied to clipboard

How to remove the extra vertical padding?

Open bnbon opened this issue 4 years ago • 1 comments

Hi,

This component is great, but I am showing a standard projection and notice there is a large amount of vertical padding which is empty space; how would I reduce this so the canvas is only as big vertically as it needs to be to display all the countries.

Using the latest version and the latest react version.

Many thanks

bnbon avatar Apr 14 '20 21:04 bnbon

I ran into this too. Its confusing as the width and height arguments to ComposableMap do not actually specify the element's height and width. Instead it controls the zoom aspect to the element via the viewBox attribute. See:

https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute

I was able to remove the vertical whitespace by adjusting the height.

dpetzold avatar Aug 16 '20 20:08 dpetzold