MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: WebMathematica and SVG graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117934] Re: WebMathematica and SVG graphics
  • From: Alexey <lehin.p at gmail.com>
  • Date: Tue, 5 Apr 2011 06:41:47 -0400 (EDT)
  • References: <in3uun$hq1$1@smc.vnet.net> <inc6n2$10o$1@smc.vnet.net>

Albert,

The slowness of the functions you mentioned is due to accessing web
site http://www.w3.org/. The first thing Mathematica does when
evaluating XML`SVG`GraphicsToSymbolicSVG or ImportString[..., "XML"]
is loading 37 small files from http://www.w3.org/Graphics/SVG/1.1/DTD/
directory. These files are loaded for the first time but in further
using the XML-related commands Mathematica checks for updates for
these files even during the same session. This is the reason for
absurd slowness of the functions mentioned. One way to avoid this is
to use local caching proxy server like HandyCache. I do not know
whether it is possible to do this inside Mathematica.

Alexey


Albert Retey <awnl at gmx-topmail.de> wrote:
> 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



  • Prev by Date: Re: PlotLegend and Show
  • Next by Date: Re: ProgressIndicator and ParallelTable problem :(
  • Previous by thread: Re: WebMathematica and SVG graphics
  • Next by thread: Re: WebMathematica and SVG graphics