r-spatial / leafpop

Include Tables, Images and Graphs in Leaflet Popups
Other
113 stars 15 forks source link

Size issue in SVG graphs #25

Closed becarioprecario closed 2 years ago

becarioprecario commented 3 years ago

Hi,

I believe that the conversion factor from pixels to inches is wrong in leafpop:::popupSVGraph. I was using this function but leaflet shown about 2/3 of the image. After changing the pixel-to-inch conversion factor from 72 to 96 I get the right scale in my plots.

Best,

Virgilio

codyevers commented 3 years ago

I can confirm this as well. The width and height in the svg tag appear to be incorrectly tagged with 'pt' unit. I can fix the scaling issue if I manually change these units (i.e., 300pt to 300px) using Chrome's development tools. I have not been able to locate where in the code can be resolved however.

KingaHill commented 2 years ago

Can someone provide more detail about how to work around this issue? I am experiencing the same sizing problem with "svg" and am not sure how to adjust that conversion.

tim-salabim commented 2 years ago

@KingaHill Can you please try again? The above commit should fix this.

KingaHill commented 2 years ago

It works when I download the development version @tim-salabim. Thank you!

tim-salabim commented 2 years ago

Thanks, closing here then