In JointJS how can I position the label on top instead of center. Some thing like this:
So in coding:
var r1 = new joint.shapes.basic.Rect({
position: { x: 20, y: 20 },
size: { width: 200, height: 200 },
attrs: { rect: { fill: '#E74C3C' }, text: { text: 'Parent' } } // I want to position text on top.
});

You can use the
ref-yattribute, e.g.Edit:
refXis part of the "special attributes" group. List of all attributes can be found here: http://resources.jointjs.com/docs/jointjs/v2.0/joint.html#dia.attributesit's also possible to define custom attributes:
Either global special attributes - extending the
joint.dia.attributesnamespace (attr lineStyle):or a special attribute for the particular shape (attribute d):