bramp / js-sequence-diagrams

Draws simple SVG sequence diagrams from textual representation of the diagram
https://bramp.github.io/js-sequence-diagrams/
BSD 2-Clause "Simplified" License
7.81k stars 1.08k forks source link

Hand-drawn lines can overlap text, become less readable. #147

Closed Billiam closed 7 years ago

Billiam commented 8 years ago
a->b: This is difficult to read
a->b: This line is significantly longer than the one which appears above.

example diagram

As sequence text length increases, the maximum vertical range for the swoop in hand drawn lines also increases.

At the lengths above, that line can run right through the line text. At even longer lengths, the line can appear above it's associated text.

mnot commented 8 years ago

In Raphael.fn.wobble, try a lower divisor; e.g.,

var wobble = Math.sqrt( (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) / 30;

instead of

var wobble = Math.sqrt( (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) / 15;
bramp commented 7 years ago

Thanks for the feedback. I've actually reworked the wobble a little, capping how much it can wobble. Going over text should no longer be a problem:

screen shot 2016-12-27 at 5 15 34 pm