terezka / elm-charts

Create SVG charts in Elm.
https://www.elm-charts.org
BSD 3-Clause "New" or "Revised" License
711 stars 67 forks source link

Change Svg sizing to responsive #38

Closed arcmode closed 7 years ago

arcmode commented 7 years ago

Hello.

Thanks for sharing this library!

This patch just implements what @jwillem pointed as the simplest solution in #14 .

It's a big change to users since a sized wrapper should be required for the plot to not take the entire container. I think one of the best parts of Svg is the responsiveness and vector-ish approach, so in my opinion it makes sense to have a responsive behavior at the Svg side and delegate the absolute sizing to users.

If you want I can make this patch as an addition instead of a change so backwards compatibility is preserved.

Also if you want I can try to replace "size" by a viewbox attribute.

What do you think?

terezka commented 7 years ago

Thanks for the PR! I think it also makes sense. I have merged it (into a release branch) and will release it with some more changes over the weekend (hopefully!).