source-map-explorer
source-map-explorer copied to clipboard
Output image
It'd be useful to be able to output an image, preferrably SVG. I could generate it as part of my build, and include the image in my README.
Interesting idea. Do you know of any SVG treemap libraries for node? On Mon, Nov 16, 2015 at 4:14 AM Daniel Perez Alvarez < [email protected]> wrote:
It'd be useful to be able to output an image, preferrably SVG. I could generate it as part of my build, and include the image in my README.
— Reply to this email directly or view it on GitHub https://github.com/danvk/source-map-explorer/issues/24.
I'm wondering if you could get webtreemap to run on a virtual DOM inside a node process using jsdom...
People seem to be using that approach with d3: https://github.com/gregjopa/d3-server-side-demo
Yeah, but then you'd have to convert the DOM to SVG as well. I'd be happy to look at a PR that implemented SVG output in some way.
Ah, webtreemap doesn't output SVG... Would you be open to switching to d3 if I got it working?
I'd be open to it. @martine, any thoughts?
Just as an FYI, the current treemap is interactive. I wouldn't want to lose the interactivity if we moved to D3.
Yup, understood. I may give it a whirl this weekend.
Also FWIW, the webtreemap DOM is pretty simple. Converting it to SVG directly using jsdom might be easier.
Ok, I'll look into that first.
I wonder if you could use an SVG foreignObject with a canvas to render HTML: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas
On Mon, Nov 16, 2015 at 8:18 AM, Daniel Perez Alvarez < [email protected]> wrote:
Ok, I'll look into that first.
— Reply to this email directly or view it on GitHub https://github.com/danvk/source-map-explorer/issues/24#issuecomment-157085540 .
@unindented Is there any outcome of your investigation?
@cornips I never dedicated the time to get this working... 😢