Skip to content

Add viewBox to generated svg #2

@jvzsec

Description

@jvzsec

Hi, I think it would be a nice idea to add the viewBox attribute to the generated svg file because the tag is missing viewBox, height and width attributes (at least for the World map, which I believe could be the most used). A use case example is when rendering a HTML file with WeasyPrint to PDF that contains a svg from this package it shows blank, but modifying _to_svg function to include an arbitrary viewBox = "0 0 x y" it shows properly.

Maybe you could detect the dimensions of the base svg by checking its properties and then set up a default viewBox and/or default height and width attributes.

Btw, congrats for the amazing repo, it works pretty cool :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions