I implemented a Link extending joint.dia.Link.extend, also based on joint.shapes.bpmn.Flow.
What happens is that when I call openAsPNG function on Firefox it works fine, but when this link is in the model, nothing appears. Also openAsSVG works all right with the link.
Am I missing something? I'll post the code bellow.
Hi,
I implemented a Link extending joint.dia.Link.extend, also based on joint.shapes.bpmn.Flow.
What happens is that when I call openAsPNG function on Firefox it works fine, but when this link is in the model, nothing appears. Also openAsSVG works all right with the link.
Am I missing something? I'll post the code bellow.
Thanks.
joint.shapes.molic.Link = joint.dia.Link.extend({ defaults: { type: "molic.Link", attrs: { '.marker-source': { d: 'M 0 0' }, '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z', fill: '#000000' }, '.connection': { 'stroke-dasharray': ' ', 'stroke-width': 1 }, '.connection-wrap': { style: '', onMouseOver: '', onMouseOut: '' } }, flowType: "Transição", speakTransition: "u: Speak \n Transition" }, initialize: function() { joint.dia.Link.prototype.initialize.apply(this, arguments); this.listenTo(this, 'change:flowType', this.onFlowTypeChange); this.listenTo(this, 'change:speakTransition', this.onSpeakTransitionChange); this.onFlowTypeChange(this, this.get('flowType')); this.onSpeakTransitionChange(); }, onSpeakTransitionChange: function() { this.set('labels', [{ position: .5, attrs: { text: {text: this.get('speakTransition') }}}]); }, onFlowTypeChange: function(cell, type) { var attrs; switch (type) { case 'Transição': attrs = {}; break; case 'Ruptura': attrs = { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z', fill: '#000' }, '.connection': { 'stroke-dasharray': '4,4' } }; break; default: throw "Link: Unknown Link Type: " + type; } cell.attr(_.merge({}, this.defaults.attrs, attrs)); } });