我为jointJS创建新的,我需要使用JointJS创建自定义形状,我尝试使用矩形创建菱形形状,使其高度和宽度相同,然后旋转45度如下,JointJS创建自定义形状,钻石,六角形
var diamond = new joint.shapes.basic.Rect({
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'
}
});
diamond.rotate(45);
然而,目前在矩形内的文字也被旋转,任何想法我如何能继续....我也需要创建一个标签六角...任何帮助将非常感激...
在此先感谢,
Mayuri