Skip to content

Commit

Permalink
example(arrow-alignment): add self ref alignment (#231)
Browse files Browse the repository at this point in the history
This demostrates #229. The arrows are visibly misaligned when the self
referece circle is bigger than default. They are misaligned all the time
actually but it's not really visible with smaller circumference.
  • Loading branch information
Thomaash authored Nov 18, 2019
1 parent 1e5d9eb commit 71b2c43
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions examples/network/edgeStyles/arrowAlignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,25 @@
id: 10 * i + 1,
label: type,
x: 0,
y: i * 50
y: i * 60
},
{
id: 10 * i + 2,
label: type,
x: 800,
y: i * 50
y: i * 60
},
{
id: 10 * i + 3,
label: type,
x: 1000,
y: i * 60
},
{
id: 10 * i + 4,
label: type,
x: 1200 + (i % 5) * 250,
y: 200 + Math.floor(i / 5) * 5 * 50
}
]);
edges.add([
Expand All @@ -85,6 +97,27 @@
middle: { enabled: true, scaleFactor },
to: { enabled: true, scaleFactor }
}
},
{
from: 10 * i + 3,
to: 10 * i + 3,
smooth: { type },
arrows: {
from: { enabled: true, scaleFactor },
middle: { enabled: true, scaleFactor },
to: { enabled: true, scaleFactor }
}
},
{
from: 10 * i + 4,
to: 10 * i + 4,
smooth: { type },
selfReferenceSize: 100,
arrows: {
from: { enabled: true, scaleFactor },
middle: { enabled: true, scaleFactor },
to: { enabled: true, scaleFactor }
}
}
]);
});
Expand Down

0 comments on commit 71b2c43

Please sign in to comment.