diff --git a/examples/tree-of-life/src/index.ts b/examples/tree-of-life/src/index.ts index 7852a1106..edb96b0a8 100644 --- a/examples/tree-of-life/src/index.ts +++ b/examples/tree-of-life/src/index.ts @@ -203,15 +203,15 @@ class Branch extends dia.Link { // The `organicStroke` attribute is used to set the `d` attribute of the `` element. // It works similarly to the `connection` attribute of JointJS. organicStroke: { - qualify: function () { - return this.model.isLink(); - }, set: function ( _value: any, _refBBox: g.Rect, _node: SVGElement, attrs: attributes.NativeSVGAttributes ) { + if (!this.model.isLink()) { + throw new Error('The `organicStroke` attribute can only be used with links.'); + } // The path of the link as returned by the `connector`. const path = this.getConnection(); const segmentSubdivisions = this.getConnectionSubdivisions();