var group = paper.set(); // var path = paper.path("M35 60 L35 90"); var content = paper.rect(0, 0, 90, 30, 10).attr({fill: "orange", cursor: "move"}).draggable.enable(); var text = paper.text(0, 0, "Hello").attr({'text-anchor': 'start', "font-size":14, cursor: "move", width:90, height: 40, "background-color":"#545455"}).draggable.enable(); group.push(content); group.push(text); var cBox = content.getBBox(); var tBox = text.getBBox(); text.translate((cBox.width-tBox.width)/2,(cBox.height-tBox.height)/2+8); group.translate(Math.random() * 350, Math.random() * 380); content.node.onclick = function () { content.attr("fill", "red"); }; text.node.onclick = function () { content.attr("fill", "red");}; var casa = prompt('new name?'); text.attr({text: casa}); var group = paper.set(); // var c1 = paper.path("M35 60 L35 90"); var c2 = paper.rect(50, 10, 50, 50,10); var c3 = paper.text(35, 35, "Hello").attr({"font-size":12}); group.push(c2); group.push(c3); var eltext = paper.set(); el = paper.ellipse(0, 0, 30, 20); text = paper.text(0, 0, "ellipse").attr({fill: '#ff0000'}) eltext.push(el); eltext.push(text); eltext.translate(50,50);