Hello,
I have created a couple of custom links with specialized marker-source or marker-target definitions. Here is an example of my links:
joint.shapes.gems.Input = joint.dia.Link.extend({
defaults: _.defaultsDeep({
type: 'app.InputLink',
router: {
name: 'manhattan'
},
connector: {
name: 'jumpover'
},
attrs: {
'.tool-options': {
'data-tooltip-class-name': 'small',
'data-tooltip': 'Click to open Inspector for this link',
'data-tooltip-position': 'left'
},
'.marker-source': {
d: "M 16 0 L 8 8 L 16 16 L 24 8 Z",
stroke: '#222138',
fill: '#222138',
transform: 'scale(1)'
},
'.marker-target': {
d: 'M 10 0 L 0 5 L 10 10 z',
stroke: 'transparent',
fill: '#222138',
transform: 'scale(1)'
},
'.connection': {
stroke: '#222138',
'stroke-dasharray': '0',
'stroke-width': 1
},
labels: [
{
position: 0.5,
attrs: {
text: {
text: '',
fill: '#f6f6f6',
'font-family': 'Maven Pro'
},
rect: {
stroke: '#7c68fc',
'stroke-width': 20,
rx: 2,
ry: 2
}
}
}
]
},
name: "",
num: ""
}, joint.dia.Link.prototype.defaults)
});
This is drawn just fine, as I add it on the graph after right-click event, but when upon refresh, I try to redo the graph from JSON (JSON.stringify(app.graph) and app.graph.fromJSON(JSON.parse(json)):
Uncaught Error: properties.markup is missing while the default render() implementation is used.
at child.renderMarkup (rappid.js:7835)
at child.render (rappid.js:7843)
at child.protoProps.render (rappid.js:4705)
at child.renderView (rappid.js:10781)
at index.js:2874
at index.js:3049
at Function.<anonymous> (index.js:3346)
at child.resetViews (rappid.js:10827)
at triggerEvents (backbone.js:369)
at triggerApi (backbone.js:355)
I can also add links with default target and source markup in the same method, and they render just fine on refresh as well, so there is something going wrong on my special shapes. What am I missing?
Thanks,
Riitta Hietaranta