SnapSVG for Java

SnapSVG is a very decent JavaScript library for rendering and animations. With great delight the DukeScript project announces immediate availability of the library for all Java users!

Check the javadoc for detailed description. Use following code to add the SnapSVG into your DukeScript application:

Paper s = Exports.Snap("#demo");
Element bigCircle =, 150, 100);
    "fill", "#bada55",
    "stroke", "#000",
    "strokeWidth", 5

Element smallCircle =, 150, 70);
Element discs = Element.$as(,, 150, 70)));
    "fill", "#fff"

    "mask", discs

smallCircle.animate(values("r", 50), 1000);

See the example in our Definitely Typed Java libraries project. Enjoy SVG!