webtreemap
webtreemap copied to clipboard
Calling `webtreemap.render` twice adds second `style` tag
Use case - render a different map on bundle select in drop-down. Like in https://github.com/danvk/source-map-explorer.
Maybe it's better to place css in a separate file?
Another solution - clear container
content
I think clearing the container content is the best option.
In the first version of webtreemap I had the CSS in a different file, but it becomes cumbersome to integrate into apps -- you end up needing to have the app copy and paste the CSS, which then means we can't make changes to the CSS across versions and so on. If you had any other ideas I'm open to them.
Separate CSS file worked just fine for my case. I already inject webtreemap js into HTML template anyway. We just paste content of webtreemap.js
into generated HTML file.
For now, clearing container should work as well.