Closed boulabiar closed 2 years ago
Oh, interesting use case!
It will not work with the raw HTML because it might miss the relevant CSS stylings because they are referenced via classes only. I used the following workflow to get a bit further:
The generated HTML I used with the tool you posted and got this:
Not perfect yet but I hope you get the idea so you can iterate on the approach. Let me know how it works out for you.
Thanks for your quick answer!
I want to generate svg because then it's very easy to zoom into a part of it or even animate that motion. I want to do it programmatically in an automated manner.
I still wasn't able to get a self contained svg output, because the file is rendered ok only on the page, but once loaded into an svg editor like inkscape, everything goes back broken. I think everything has to do with css styling while svg prefers to have simple objects so that it can be portable.
An alternative approach could be to render the HTML as a PDF and convert that to SVG.
Did the following on macOS:
This is the actual SVG:
Gist: https://gist.github.com/walterra/876b9b5b7537111c47719e7a5cd1a610#file-viking-timeline-svg
It's not picking up all text styles correctly but it gets pretty close.
Closing, feel free to reopen should you have more questions.
Thanks for building this great library! I want to ask whether there are way to have svg output of the milestones ? I tried using https://htmlsvg.netlify.app/ to convert the html element into svg, but the output is broken.