Thanks a lot, Roman, I followed the first diamond solution, and it worked. I liked the charm !!
this is for anyone who wants to make a diamond mold using joint.js, I added the following to joint.js
joint.shapes.basic.Diamond = joint.shapes.basic.Generic.extend({ markup: '<g class="rotatable"><g class="scalable"><rect/></g><text/></g>', defaults: joint.util.deepSupplement({ type: 'basic.Rect', attrs: { 'rect': { fill: '#FFFFFF', stroke: 'black', width: 1, height: 1,transform: 'rotate(45)' }, 'text': { 'font-size': 14, text: '', 'ref-x': .5, 'ref-y': .5, ref: 'rect', 'y-alignment': 'middle', 'x-alignment': 'middle', fill: 'black', 'font-family': 'Arial, helvetica, sans-serif' } } }, joint.shapes.basic.Generic.prototype.defaults) });
And for its implementation, as shown below,
var diamond = new joint.shapes.basic.Diamond({ position: { x: 100, y: 100 }, size: { width: 100, height: 100 }, attrs: { diamond: { width: 100, height: 30 } } }); diamond.attr({ rect: { fill: '#cccccc', 'stroke-width': 2, stroke: 'black' }, text: { text: 'Diamond', fill: '#3498DB', 'font-size': 18, 'font-weight': 'bold', 'font-variant': 'small-caps', 'text-transform': 'capitalize' } });