In every new created link in jointJS, over this link there is the default name "Name". How will I change it to my own name, e.x. the content of a var test ?
My link javascript code is the following:
//New Transition
this.paper = new joint.dia.Paper({
width: 1000,
height: 1000,
gridSize: 10,
model: this.graph,
defaultLink: new joint.dia.Link({
//Code alteration to mimic label functionality-adding labels:
attrs: {
'.marker-source': { d: 'M 10 0 L 0 5 L 10 10 z', transform: 'scale(0.001)' }, // scale(0)(0.001)' }, // scale(0) fails in Firefox
'.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' },
'.connection': { stroke: 'black' }
},
router: { name: 'manhattan' },
labels:[
{ position: 0.5, attrs: { text: { text: 'Name' } } }
]
}),