78
5.3 SVG
SVG is a language for describing two dimensional graphics in XML. Like MathML it is an official recommendation
of  the  W3C,  http://www.w3.org/Graphics/SVG/.  It  provides  a  number  of  benefits  for  users  of  webMathematica.
First,  since it is  a vector based  format  the  results often  have  a  higher quality  than is  typically the case with image
formats.  This  is very  much the  case when considering  print output. Secondly,  for many  types of  image,  the actual
file size is often quite small especially compared with image formats. Thirdly, it supports a number of dynamic and
interactive features. Mathematica can generate SVG from graphics and this section will give some examples of web
usage  involving  SVG.  One  thing  to  be  noted  is  that  any  examples  will  require  that  your  browser  supports  SVG.
Ways to do this include the use of the Amaya browser, http://www.w3.org/Amaya/, which provides native support,
or the Adobe plug in, http://www.adobe.com/svg.
A utility package is provided with webMathematica that supports adding the necessary tags to hook into the Adobe
plug in. This section will give some simple examples of the use of this package with webMathematica.
5.3.1 Plotting with SVG
The source for this example  is in webMathematica/Examples/SVG/Plot.jsp. It is closely  related to the
basic example, Plot.jsp. If you installed webMathematica as described 
above
, you should be able to connect to
this  JSP  via  http://localhost:8080/webMathematica/Examples/SVG/Plot.jsp.  (You  may  have  some  other  URL  for
accessing your server.)
An extract of the source follows.
Get["MSP SVG "];
Enter a function: 
   " MSPValue[ $$fun,  "Sin[x]^2"]  "
> 
Enter a number: 
   "  MSPValue[ $$x1,  "10"]  "> 


 
MSPBlock[ {$$fun, $$x1},
SVGShow[ Plot[$$fun, {x,0,$$x1}]]] 
 

 
This  is  very  similar  to  the  basic  example  
Plot.jsp
.  The  differences  between  the  two  are  the  loading  of  the  SVG
support package  and the use of the SVG plotting function SVGShow. If this  works correctly, you may wish to use
some of the features that the Adobe plug in provides.
 .
<





New Page 1








Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service

 

Our web partners:  Jsp Web Hosting  Unlimited Web Hosting  Cheapest Web Hosting  Java Web Hosting  Web Templates  Best Web Templates  Web Design Templates  Interland Web Hosting  Cheap Web Hosting  Filemaker Web Hosting  Tomcat Web Hosting  Quality Web Hosting  Best Web Hosting  Mac Web Hosting

 
 

Virtualwebstudio. Business web hosting division of Vision Web Hosting Inc. All rights reserved

Comcast Web Hosting