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.8k stars 1.08k forks source link

Small refactor to separate signal layout building #211

Open ziluvatar opened 5 years ago

ziluvatar commented 5 years ago

I'm working adding "Opt" support (and "alt" support after that). In my work in progress I found I will need to create the concept of "nested block" where signals inside "Opt" element will make it grow accordingly.

In order to progress towards that I had to refactor the signal layout processing to make it run once for the whole diagram and another per each nested block (which holds its signals).

I wanted to create this PR to separate that refactor from the change so it is easier to follow the upcoming changes. If I detect other refactor/changes that I can separate to have smaller PRs then I'll do it (unless in case @bramp you'd rather like the whole change at once).

I could have refactored it further or cleaner, I guess we can decide that once "Opt" is supported and before starting with the "Alt" one.

alexrjs commented 5 years ago

@ziluvatar ... Cool sh*t... Tried out the gh_pages branch... Your refactoring worked fine for me... The bloated bower components are a little downer, but guess thats just a little cleanup in the Makefile to make it slimmer... Great work, anyhow... Thanks for sharing... Hope you make opt and alt work, cause that would be a nice addition... Since @bramp seems to have abandoned the support... Sorry, can't help with coding, just a user of this awesome tool... ;-)
/A