Creating an SVG Symbol Library: JAVASCRIPT BASICS & EXAMPLES
Applied within the Adobe SVG Viewer(ASV 3.03) and Internet Explorer Environment (IE6/7/8)

The dynamic SVG symbol is the primary component of database-driven graphics. When SVG is used to build symbols it is not just another pretty face among graphic file formats: It contains extreme dynamic capabilities. The attributes of each element in a symbol are fully accessible to customize it to fit many applications. However, to fully take advantage of SVG's capabilities requires a programmed interface to build and deploy the library. The examples present a tool to address this requirement.

Basic Requirement : Symbols are built with their centers at the origin(0,0)
This allows the symbols to be easily located, sized, rotated, and skewed, thereby usable in multible applications.

USING JAVASCRIPT TO CREATE AND DEPLOY AN SVG SYMBOL LIBRARY
Last Updated: 02/26/2009

SVG SYMBOL BASICS - Typically a symbol is comprised of a bunch of individual elements. The elements will be packaged within an SVG symbol element and then deployed in an application via use elements. Firstly, however each element must be individually created and arranged for the symbol element. The examples will show methods to build and arrange the elements for the symbol. Choosing the example will 'run' the example function, show the related javascript code, and its resultant svg source.

SYMBOL LIBRARY APPLICATIONS - The symbols in the library will be deployed in various example applications. Also, the features of the library tool will be demonstrated. The applications will request and customize symbols and use elements. The symbol library is an XML file, with SVG element structure, that is accessed by each application. Choosing the example will 'run' the example function, show the related javascript code, and its resultant svg source.

MEET THE PLAYERS - To simplify the examples, a few SVG elements have been created and named. Firstly, there's Librarian, otherwise known as the SVG document. The Root SVG element is Library. The main group is called Symbol. Residing within Symbol are its elements, Bubble, Box, Oval and Spider (circle, rect, ellipse and path). Associated with the elements is their a bounding box, called Ghost. Also, there is a special area called Collections, where good stuff happens.

Javascript Functions
 
SVG Source
width: px. height: px.
Use Size: %
(drag/drop at border )Open Symbol Library Tool(drag/drop at border )

Author's Note: The code herein attempts to concisely present an example or concept, without regard to error trapping, other validation clutter, or wigetry ;). All code in these examples can be used without restrictions.

Author:© Francis Hemsher /