The script produced by CanvasGraphics2D uses "setTransform". This seems to make it impossible to use the "ctx.scale()" method to easily dynamically scale a graphic. If you try this, only a some of the graphic is scaled, but after the absolute "setTranform()" method call , "scale()" gets reset.

In general it would be nice if a script could be produced that could be easily manipulated by some other externally provided java script.

Can you clarify exactly how you want to apply the scaling? We are using a test suite to ensure that the transformations on our Graphics2D implementations are giving the same results as the reference implementation, so I'd like to understand whether we have a bug for a particular combination of transforms or if the scaling you want to perform on the CanvasGraphics2D would break the behavior expected for Graphics2D.

Earlier I considered having the script generated by CanvasGraphics2D use width ('w') and height ('h') variables and do all drawing relative to these values - this would at least give the possibility to resize the chart nicely. I didn't do that yet, since if you need to be able to scale the chart then the SVGGraphics2D class is probably a better solution.

What I was hoping to do was to generate one SVG script, and then draw the graphic twice, once as a thumbnail, and then if this thumbnail was clicked to draw a full scale plot. The SVG files are quite large, and so creating two size versions would be inefficient.