Skip to content

Commit 8558a53

Browse files
authored
refactor(dia.Link)!: remove smooth and manhattan attributes (#2438)
1 parent 8fbe4e0 commit 8558a53

File tree

13 files changed

+9
-30
lines changed

13 files changed

+9
-30
lines changed

packages/joint-core/demo/archive/fsa/src/fsa.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const EndState = joint.dia.Element.define('fsa.EndState', {
6060

6161
const Arrow = joint.dia.Link.define('fsa.Arrow', {
6262
attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }},
63-
smooth: true
6463
});
6564

6665
const shapes = {

packages/joint-core/demo/links/src/links.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var link5 = new joint.shapes.standard.Link({
123123
source: { x: 440, y: 100 },
124124
target: { x: 740, y: 100 },
125125
vertices: [{ x: 400, y: 140 }, { x: 550, y: 100 }, { x: 600, y: 140 }],
126-
smooth: true,
126+
connector: { name: 'smooth' },
127127
attrs: {
128128
line: {
129129
stroke: '#7c68fc',
@@ -242,7 +242,7 @@ var link8 = new joint.shapes.standard.ShadowLink({
242242
source: { x: 10, y: 280 },
243243
target: { x: 440, y: 280 },
244244
vertices: [{ x: 150, y: 350 }, { x: 300, y: 280 }],
245-
smooth: true,
245+
connector: { name: 'smooth' },
246246
markup: [{
247247
tagName: 'path',
248248
selector: 'shadow',

packages/joint-core/docs/demo/layout/DirectedGraph/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
return new joint.shapes.standard.Link({
6262
source: { id: parentElementLabel },
6363
target: { id: childElementLabel },
64-
smooth: true,
64+
connector: { name: 'smooth' },
6565
attrs: {
6666
line: {
6767
targetMarker: {

packages/joint-core/docs/src/joint/api/connectors/smooth.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,3 @@
33
<p>Example:</p>
44

55
<pre><code>link.connector('smooth');</code></pre>
6-
7-
<p>(<i>Deprecated</i>) For the purposes of backwards compatibility, the <code>'smooth'</code> connector may also be enabled by setting the <code>link.smooth</code> property to <code>true</code>.</p>
8-
9-
<pre><code>// deprecated
10-
link.set('smooth', true)</code></pre>

packages/joint-core/docs/src/joint/api/dia/Link/events.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<li><code>change:source</code> - triggered when the link changes its source</li>
44
<li><code>change:target</code> - triggered when the link changes its target</li>
55
<li><code>change:attrs</code> - triggered when the link changes its attributes</li>
6-
<li><code>change:smooth</code> - (deprecated) triggered when the link toggled interpolation </li>
7-
<li><code>change:manhattan</code> - (deprecated) triggered when the link toggled orthogonal routing</li>
6+
<li><code>change:connector</code> - triggered when the link changes its connector </li>
7+
<li><code>change:router</code> - triggered when the link changes its router</li>
88
<li><code>change:vertices</code> - triggered when the link changes its vertices array </li>
99
<li><code>change:z</code> - triggered when the link is moved in the z-level (<a href="#dia.Link.prototype.toFront">toFront</a> and <a href="#dia.Link.prototype.toBack">toBack</a>)</li>
1010
<li><code>transition:start</code> - triggered when a transition starts.</li>

packages/joint-core/docs/src/joint/api/dia/Link/prototype/connector.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<pre class="docs-method-signature"><code>link.connector()</code></pre>
22
<p>Return a shallow copy of the <code>connector</code> property of the link.</p>
33

4-
<p>For backwards compatibility, if there is no connector, the function also checks whether the legacy <code>smooth</code> property is set on the link and returns <code>{ name: smooth }</code> if it is.</p>
5-
64
<pre class="docs-method-signature"><code>link.connector(connector [, opt])</code></pre>
75
<p>Set the <code>connector</code> of the link.</p>
86

packages/joint-core/docs/src/joint/api/dia/Link/prototype/router.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<pre class="docs-method-signature"><code>link.router()</code></pre>
22
<p>Return a shallow copy of the <code>router</code> property of the link.</p>
33

4-
<p>For backwards compatibility, if there is no router, the function also checks whether the legacy <code>manhattan</code> property is set on the link and returns <code>{ name: orthogonal }</code> if it is.</p>
5-
64
<pre class="docs-method-signature"><code>link.router(router [, opt])</code></pre>
75
<p>Set the <code>router</code> of the link.</p>
86

packages/joint-core/docs/src/joint/api/routers/orthogonal.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,3 @@
1313
<pre><code>link.router('orthogonal', {
1414
padding: 10
1515
});</code></pre>
16-
17-
<p>(<i>Deprecated</i>) For the purposes of backwards compatibility, the <code>'orthogonal'</code> router can also be enabled by setting the <code>link.manhattan</code> property to <code>true</code>. Note that the meaning of <q>manhattan</q> in JointJS has changed over time.</p>
18-
19-
<pre><code>// deprecated
20-
link.set('manhattan', true);</code></pre>

packages/joint-core/src/connectors/jumpover.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ export const jumpover = function(sourcePoint, targetPoint, route, opt) { // esli
428428
if (overlapIndex > -1 && thisLine.containsPoint(linkLinesToTest[overlapIndex].end)) {
429429
// Remove the next segment because there will never be a jump
430430
linkLinesToTest.splice(overlapIndex + 1, 1);
431-
}
431+
}
432432
const lineIntersections = findLineIntersections(thisLine, linkLinesToTest);
433433
res.push.apply(res, lineIntersections);
434434
}

packages/joint-core/src/dia/Link.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ export const Link = Cell.extend({
215215
if (name === undefined) {
216216
var router = this.get('router');
217217
if (!router) {
218-
if (this.get('manhattan')) return { name: 'orthogonal' }; // backwards compatibility
219218
return null;
220219
}
221220
if (typeof router === 'object') return clone(router);
@@ -236,7 +235,6 @@ export const Link = Cell.extend({
236235
if (name === undefined) {
237236
var connector = this.get('connector');
238237
if (!connector) {
239-
if (this.get('smooth')) return { name: 'smooth' }; // backwards compatibility
240238
return null;
241239
}
242240
if (typeof connector === 'object') return clone(connector);

0 commit comments

Comments
 (0)