SVG Extensions
From Svg wiki
Not every SVG viewer is 100% conformant to the Spec. Sometimes this is a matter of missing features, and sometimes of proprietary extensions. These are not necessarily bad, since they do lead to innovation and may be added to the official Spec at some later point, or adopted by other implementations (as is the case with getURL() and postURL()). However, it is important to know that these features are nonstandard, especially in consideration of Cross-Platform Authoring. In addition to viewer implementation extensions, there are third-party custom extensions available as script libraries.
Contents |
Script API Extensions
Adobe
These are script binding extensions available only with the Adobe SVG Viewer. They were posted by PeterSorotokin on the Adobe SVG Forums.
Adobe SVG Viewer provides accessors for all DOM attributes, i.e one can set attribute a.foo with a.setFoo(value) and get its value with a.getFoo(). While not strictly standard these accessors work everywhere, including script engines that do not provide a way to expose JavaScript attributes (i.e. Netscape on Mac).
For additional information, see Adobe Extensions and http://groups.yahoo.com/group/svg-developers/files/SVGViewerExtensions.pdf
Attribute instanceName
Synopsis:
string instanceName
Read-write variable that identifies this particular instance of the viewer. You can then search for this instance from any other instance (that comes from the same domain) using findInstanceByName method. This is similar to HTML frame name.
Attribute defaultAntialias
Synopsis:
boolean defaultAntialias
Attribute innerWidth
Synopsis:
readonly long innerWidth
The width of the viewer's window in pixels. Some people recommended that you use accessor method getInnerWidth() for this attribute, but others argue you should simply use innerWidth.
Attribute innerHeight
Synopsis:
readonly long innerHeight
The height of the viewer's window in pixels. Some people recommended that you use accessor method getInnerHeight() for this attribute, but others argue you should simply use innerHeight.
Method findInstanceByName
Synopsis:
viewer::Window findInstanceByName(string instanceName)
Searches list of all active SVG viewer instances from the same domain by name. SVG viewer can assign its instance name using instanceName variable.
Script-Based Functionality Extensions
This describes extensions that you can use to do stuff not natively supported by SVG or a specific implementation.
importNode()
ASV3.0 doesn't support importNode(). With this script you can add basic importNode() functionality to ASV.
XML-RPC from Adobe SVG Viewer
Using this script you can make XML-RPC, http://www.xmlrpc.org calls from ASV3.0. Use this to post data to backend, get stock quotes in real-time or something else.
Another XML-RPC client implimentation and more
With JavaScript o lait you can make calls to XML-RPC services as if you call an object's method in. The library also includes some other features like: importNode, xml parsing, getURL, postURL wrappers, modules, easyer class generation, etc.
See also SVG Wishlist.
