Firstly, I did not know about this js tool. Looks awsome.
Coming back to the solution, a change is needed for Raphael.js in order to make this work.
I an referring to the uncompressed source file here.
At line number 78 there is a property called availableAttrs which lists all the possible attributes that can be set using attr() function. change that property to include class with a default value like below:
availableAttrs = {
blur: 0,
"clip-rect": "0 0 1e9 1e9",
cursor: "default",
cx: 0,
cy: 0,
fill: "#fff",
"fill-opacity": 1,
font: '10px "Arial"',
"font-family": '"Arial"',
"font-size": "10",
"font-style": "normal",
"font-weight": 400,
gradient: 0,
height: 0,
href: "http://raphaeljs.com/",
opacity: 1,
path: "M0,0",
r: 0,
rotation: 0,
rx: 0,
ry: 0,
scale: "1 1",
src: "",
stroke: "#000",
"stroke-dasharray": "",
"stroke-linecap": "butt",
"stroke-linejoin": "butt",
"stroke-miterlimit": 0,
"stroke-opacity": 1,
"stroke-width": 1,
target: "_blank",
"text-anchor": "middle",
title: "Raphael",
translation: "0 0",
width: 0,
x: 0,
y: 0,
class:""
},
Once this change is done class attributes can be assigned using attr function.
P.S: Please check the licensing terms before changing the script and using it.