Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1369 > unrolled thread

WebMathematica and SVG graphics

Started byEduardo <eduzea@gmail.com>
First post2011-04-01 07:30 +0000
Last post2011-04-05 10:41 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  WebMathematica and SVG graphics Eduardo <eduzea@gmail.com> - 2011-04-01 07:30 +0000
    Re: WebMathematica and SVG graphics Albert Retey <awnl@gmx-topmail.de> - 2011-04-04 10:32 +0000
      Re: WebMathematica and SVG graphics Alexey <lehin.p@gmail.com> - 2011-04-05 10:41 +0000

#1369 — WebMathematica and SVG graphics

FromEduardo <eduzea@gmail.com>
Date2011-04-01 07:30 +0000
SubjectWebMathematica and SVG graphics
Message-ID<in3uun$hq1$1@smc.vnet.net>
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.

Thanks and regards,

Eduardo Zea




[toc] | [next] | [standalone]


#1462

FromAlbert Retey <awnl@gmx-topmail.de>
Date2011-04-04 10:32 +0000
Message-ID<inc6n2$10o$1@smc.vnet.net>
In reply to#1369
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

[toc] | [prev] | [next] | [standalone]


#1473

FromAlexey <lehin.p@gmail.com>
Date2011-04-05 10:41 +0000
Message-ID<inerlf$j4m$1@smc.vnet.net>
In reply to#1462
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@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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web