Welcome to SVGKit
|SVGKit (live demo, type tests) -- All you need to work with SVGs at the basic, browser-independent level. Create a new SVG at runtime. Load SVG data from a URL. Conveniently handle quirks of three ways SVG can be included in browsers: object, embed, and inline. Handle different browsers and different SVG engines. Has convenience functions for DOM manipulation ala MochiKit. It manages the internal SVG DOM objects: HTMLElement, SVGDocument, SVGElement|
|SVGEvent (live demo) -- Additions to the SVGKit object for event handling. In SVG it can be tricky to get from mouse coordinates to local coordinates. SVGEvent has routines to enable draggable items, rotatable items, and to prevent pan and zoom on items.|
|SVGCanvas (live demo, live demo 2, canvas extensions) -- Implements most of the Canvas API. Some SVG-specific additions can be added if you also include CanvasExtensions.js. Allows you to create an SVG more prodecurally rather than building it up with DOM manipulation (one of the disadvantages sighted by Vladimir Vukićević) The unimplimented parts of the Canvas API are things like "take what you've drawn so far, treat it like a bitmap, and run the following filter on it." Some of these are impossible in SVG as it stands, but will get better with SVG1.2.|
|SVGPlot (live demo, csv demo) -- A full plotting suite. It generates clean SVG in the browser that can be saved, sent back to server for conversion to PDF, PS, PNG, etc. Live updates via AJAX for real-time data like stocks or web stats. Allows multiple plots arranged on an SVG, multiple related or unrelated axes per plot, and control of styles. Originally I was going to write it in pure Canvas code so you could have either underneath, but things like text made it too frustrating. For a related but independent project, see PlotKit. We seem to have started around the same time, but he has a more production quality release.|
|SVGFontKit (font_test.svg) -- This is a hack to replace all SVG <text> and <tspan> elements that reference an embeded SVG font with references to the font's glyphs properly positioned and spaced. This hack is necesary because Firefox lacks support for SVG Fonts, and currently <text> elements are rendered and sized according to the rest of the web pages's fonts rather than pixel-perfectly anti-aliased as demanded the SVG spec seems to require.|
- Play with some of the examples online with the MochiKit interpreter SVG examples
- Download a release or use subversion to check out the most recent version.
- Using SVGKit in your own pages -- valid XHTML and served as XHTML, thing at the top for IE, explicitly include all of MochiKit.
MochiKit , Dojo, and other libraries.
I'm Jason Gallicchio, a physics graduate student at Harvard working on theoretical particle physics and cosmology. I developed this as a graphics and plotting interface for my mostly Java-Applet educational site BrainFlux.org and also for the web interface to our Optical SETI experiment. I looked into SVG and played around with Batik a bit. Then one of my research groups implemented a full web app using Python, TurboGears, and MochiKit. We wanted to interactively pull data out of a web page and plot it. Also we wanted a Google Maps type interface for stars. I started working on this in January 2006 off and on.
Things I want to do with it
- SVGWidgets -- Buttons, sliders, textboxes, etc. to make a web app more like a desktop app (or a whole desktop environment), perhaps using GNOME SVG widgets.
- Plot Interactivity -- create and edit plots, smarter zooming, selecting data, position legend, click to edit title, select colors with GUI, etc.
- Realtime plots -- stocks, web logs, ... -- add additional data points without having to re-render everything.
- Plots from a database -- interactively select data to plot and plot options. WikiDatabase where people can add and view structured data like http://swivel.com/
- Interactive math/physics educational stuff like Compass & Ruler
- Clean up the SVG that SVGCanvas and SVGPlot generate and make the code run faster. These are sometimes at odds. For example, should it spend time factoring out common styles to an enclosing group?
- MochiKit 1.4 or higher
- SVG-supporting Browser: Firefox 1.5+, Opera 9+, Internet Explorer 6+ with Adobe SVG plugin.
Open Source License
- SVGKit is licensed under the MIT license (least restrictive of the BSD-style licenses). It is GPL-compatible.
Projects that Use SVGKit
- Batik - An excellent and complete Java framework: viewer, rasterizer, font converter
- Editors: Inkscape, GLIPS Graffiti, Sodipodi,
- Flame Project - IDE for making Flash-like multimedia content
- Toolkits: Amanith, SVGDraw for Python, Perl SVG,
- W3C's standard Python Languate Gindings for SVG
Adobe's Plugin is way ahead of Firefox in terms of a completeness, speed, and interface features (like zooming, viewing the SVG in its own window, and viewing the SVG source.)
Fonts are a huge problem. The SVG spec is written so that you can embed a font and use it so you get precise alignment and pixel-perfect anti-aliased rendering. When you're rendering axis labels, I query the exact dimensions of the resulting text for optimal placement. None of this works (very well) in Firefox yet. Unline TrueType, SVG fonts don't support hinting (the mechanism that says "render the resolution independent path for the letter A ten pixels high, but then flip the following pixels because it'll look better that way). SVG creation programs have to manually lay out glyphs and will never have great low-resolution output.
give it .wav and .mp3 files to play, and be able to generate raw
wav or mp3 data programatically and send it to be played (for a Fourier
synthesis program, for example.)