This demo shows how to export the current view of the FoamTree visualization to the SVG format
using the drawTo() method.
The drawTo() method draws the complete visualization to the Context2D
you provide. There are a number of Context2D implementations, such as
svgcanvas, that capture the
drawing calls and expose the corresponding SVG elements.
svgcanvas
and calls the drawTo() method to get the SVG representation of the visualization.
groupLabelMinFontSize option to 0 to ensure
that all labels are drawn.
<a download> pointing
at a Blob URL of the serialized SVG.
svgcanvas implementation
materializes the hierarchy of context transformations directly into the coordinates of the
SVG shapes it creates. This causes the incorrect rendering of gradients if the viewport
is zoomed and/or panned.