Re: WebMathematica and SVG graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg117925] Re: WebMathematica and SVG graphics
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Mon, 4 Apr 2011 06:32:08 -0400 (EDT)
- References: <in3uun$hq1$1@smc.vnet.net>
Am 01.04.2011 09:30, schrieb Eduardo: > Hi, > > I have some Mathematica plots with interactive features like Tooltip > and Mouseover which I'm trying to reproduce in a web environment using > WebMathematica. From the documentation it is not clear how far one can > go. Exporting a ListPlot with Mouseover effects drops the interactive > component when it is rendered as a GIF or SVG. > > One approach I am trying is to write the plot as SVG and then use > Mathematicas XML capabilities to insert the Mouseover in the SVG. > Apparently in version 5.0 there was a function > XML`SVG`GraphicsToSymbolicSVG which returned the SVG code, but in 8.0 > I can only find Export[] in SVG format. So my questions are: > > 1) Is there a better way to do this, getting interactive plot features > like Mouseover into a web graphics format? > 2) If SVG is the way to go, is there a package in 8.0 that can help > (like XML`SVG` in 5.0) > 3) If not, is there a way to Export the SVG to an in memory variable > for further processing, rather than to a file? > > Any pointers a greatly appreciated. Why do you think that XML`SVG`GraphicsToSymbolicSVG does not work anymore? I just tried it (using the full name with all contexts and without loading any package) with 8.0.1 on Windows and it worked alright: XML`SVG`GraphicsToSymbolicSVG[Plot[x^4, {x, 0, 1}]] Alternatively, you could also use something like this, which would not rely on undocumented features: ImportString[ExportString[Plot[x^4, {x, 0, 1}], "SVG"], "XML"] I have no suggestions for other formats or techniques to create web grahpics formats, but it might be worthwhile to explore since I found the above to be relatively slow even for simple plots... hth, albert