61 Commits

Author SHA1 Message Date
Ivan Danilov
61249b0887 Fixed SequenceDiagram over note horizontal position
Previous expression with noteWidth does not make sense as noteWidth is
not used in case of note over two participants - forceWidth is used
instead. It tried to be symmetrical over cases A,B and B,A but failed.

Can be seen with messages over conf.width size (cannot reproduce in the
live editor as it seems to use not the last version where the code
does not use noteWidth).

The changed code explicitly calculates which of the actors is the
"left" one and starts rendering half margin to the left of its cetral
line.
2020-05-13 21:50:25 -07:00
Danny Shemesh
862f20ef20 Added cypress e2e tests for suggested improvements
This commits adds e2e tests for the suggested improvements.
I've went over the generated screenshots and they look good to me.
2020-04-23 18:31:22 +03:00
Danny Shemesh
5c902001b9 Merge branch 'develop' of github.com:mermaid-js/mermaid into develop 2020-04-23 17:08:25 +03:00
Danny Shemesh
5f6887b316 Sequence diagram fixes & improvements
This commit fixes some bugs, and I believe, improves upon the current
implementation.

In no particular order, it adds:

1. Control over note font size, family and alignment (now defaults to
center)
2. Dynamic actor resizing - actor's width will now scale if its
description is bigger than the static configured width
3. Dynamic actor margins - the margin between actors will now be
dynamically calculated by taking into account the width of connecting
messages or notes
4. Fixed a small visual annoyance where a loop arrow would intersect
with the text it loops on
5. Fixed a bug where if global config -> fontFamily wasn't defined, it
would override the actorFontFamily with an undefined
6. Removed some stale / commented out code
7. Added missing config variables to the global config object in mermaidAPI.js
8. Added messageFontSize, messageFontFamily to control message (non-note)
font settings
9. Memoized the actor widths in a pre-calculation that takes notes and
signals lengths into account
10. Removed redundant console.log lines
11. Extracted out actor width & margin calculation to getMaxMessageWidthPerActor, and
calculateActorMargins
2020-04-23 16:50:00 +03:00
Danny Shemesh
197d006860 Extracted out the commonly used line break regex
This commit extract the commonly used /br\s*\/?>/gi regex to common.js,
in order to keep the code more DRY.
2020-04-23 07:55:28 +03:00
Danny Shemesh
49f8aac6a9 Fixed outdated doc strings
This commit fixes some outdated docstrings, replacing the description
and @params where necessary.
2020-04-23 07:55:09 +03:00
Danny Shemesh
22dd50a047 Extracted out the commonly used line break regex
This commit extract the commonly used /br\s*\/?>/gi regex to common.js,
in order to keep the code more DRY.
2020-04-23 07:20:47 +03:00
Marc Faber
fc70a8e145 #1271 Fix autonumber positioning in sequence diagrams with multiline texts 2020-04-04 21:53:31 +02:00
Raphael Medaer
cbdb2e6e6f
Align left/center/right multiline messages 2020-03-24 22:17:11 +01:00
Raphael Medaer
d409da2201
Multiline sequence message
This commit allow user to write multiline messages in sequence diagram.
For instance:

```
sequenceDiagram
	Alice->>+John: Hello John<br>How are you?<br>I mean...<br>Are you OK today?
	Alice->>+John: John, can you hear me?
	John-->>-Alice: Hi Alice, I can hear you!<br>Keep calm!<br>I'm there.
	John-->>-Alice: And I feel great!
```
2020-03-24 18:26:56 +01:00
GDFaber
94ace2348f
Revert "Multiline comments" 2020-02-29 21:32:20 +01:00
Erik Ellingsen
e62027b73c Multiline comments 2020-02-27 00:02:25 +01:00
Knut Sveidqvist
f8137ea7c1 #1257 Adding the autonumber keyword + tests and docs 2020-02-16 15:26:08 +01:00
Knut Sveidqvist
d9318c5af3 #1205 Adding parsing exception for then an inactive participant is inactivated 2020-01-15 20:27:31 +01:00
Gene Wood
b4f9dd46a9
Add tests for <br \t> case
This adds tests for the case where
* multiple pieces of whitespace are used
* one of those whitespace characters is a tab
2019-12-23 08:52:15 -08:00
Gene Wood
3abd77a1e6
Extend the br tag regex
This extends the `br` tag regex to accommodate an arbitrary amount of
any type of whitespace instead of a single space character, which holds
more closely to the HTML spec[1]

This extends the fix to #702 added in #1153

[1]: http://www.w3.org/TR/REC-xml/#sec-starttags
2019-12-23 08:02:11 -08:00
Marc Faber
233520b797 #702 improve handling of different "br" tag notations for multiline texts in sequence diagrams 2019-12-21 20:39:32 +01:00
Knut Sveidqvist
a5cc1e804b #1031 Adding stricter code checks 2019-10-27 15:24:56 +01:00
Sakis bal
153b3322a6 Small gramatical mistake 2019-10-21 12:38:01 -04:00
Knut Sveidqvist
53bdfee057 #989 Font configuration 2019-10-12 16:53:21 +02:00
Eduardas Michelsonas
1cba50266e #755 Linting fixes + merge 2019-10-08 14:25:29 +02:00
edumicse
ae7852d9b9
Merge branch 'master' into feature/755_handling_br_in_sequence_diagram 2019-10-08 14:18:55 +02:00
knsv
ad5669b523 #931 Aligning code standard 2019-09-12 12:55:10 -07:00
knsv
f2a6ba80b5 #931 Aligning code standard 2019-09-12 12:54:59 -07:00
Eduardas Michelsonas
c6efddee87 #755 lint fixes 2019-08-28 20:13:37 +02:00
Eduardas Michelsonas
f6377e6125 #755 2019-08-28 20:09:45 +02:00
Alexander Sage
cfea52f570 chore: integrate jison into webpack build 2019-08-03 15:05:43 -07:00
Alexander Sage
8f6d148481 chore: added test for background rect dimensions 2019-07-23 21:28:48 -07:00
Alexander Sage
671a892b52 fix: removed it.only 2019-07-23 21:08:33 -07:00
Alexander Sage
5c25c5563a chore: Added e2e snapshot tests 2019-07-23 21:07:01 -07:00
Alexander Sage
8b05eeaa59 chore: Added unit tests around drawBackgroundRect and drawRect 2019-07-23 19:15:54 -07:00
Alexander Sage
1b001cf1e8 chore: Added unit tests around drawBackgroundRect and drawRect 2019-07-23 19:11:31 -07:00
Alexander Sage
c8091c61c0 feat: sequence diagram background rect 2019-07-22 22:47:49 -07:00
IOrlandoni
e93cc85e9b Trimming whitespace after participant id 2019-07-14 11:51:20 -04:00
Knut Sveidqvist
5fd803d479 Fix merge changes for pr 722 and issue #782 2019-06-30 16:14:59 +02:00
Knut Sveidqvist
4bb0da0ce6 Merge of pull request #741 2019-06-29 10:41:44 +02:00
Adam Wulf
24600355c8 Merge remote-tracking branch 'origin/master' into flow/trapezoid 2019-06-25 22:36:13 -05:00
Jonathan Newnham
c1d252afe0 fix dark theme loop labels not visible
* fix loop label text forced to black, ignoring styles
* fix styles that were being ignored
2019-05-14 11:23:37 +10:00
Tyler Long
7d3578b31a
Merge pull request #721 from paulbland/right-angles
Add option for right angles
2018-12-18 14:04:19 +08:00
Tyler Long
2a0fcd99e4
Merge pull request #720 from paulbland/add-activation-class
Add nested activation classes
2018-12-18 13:39:18 +08:00
Tyler Long
9ecee6b163 Generate jison files 2018-12-17 17:31:22 +08:00
Casey Watson
2fc5745c58 Support Multi-line Actor Descriptions
- Add support for <br/> delimiter in actor descriptions.
- Add actorFontFamily and actorFontSize options to sequence diagram.
- Change default actor description font from times to sans.

Fix #384 #702 #755
2018-11-26 11:49:33 -07:00
Bland, Paul
06aa4a5c07 prevent deeply nested activations from calling classes that don't exist (by limiting to 3) 2018-08-29 14:24:42 -04:00
Bland, Paul
80c7c9a86e added ability to style nested activations 2018-08-24 11:56:28 -04:00
Bland, Paul
0fdddfe548 make default sequence numbers a little smaller 2018-08-23 14:30:47 -04:00
Bland, Paul
42d66fd3d9 tweak for lint 2018-08-23 11:53:04 -04:00
Bland, Paul
ae8dde981b make path a bit wider 2018-08-22 15:30:12 -04:00
Bland, Paul
228b832bed moved hard-coded fill and stroke colors from svgDraw.js to scss files, and added defaults to all themes 2018-08-22 10:22:50 -04:00
Bland, Paul
8035572fac make default node number a little smaller 2018-08-17 13:37:44 -04:00
Bland, Paul
7fcccb4ab2 fixing formatting for lint 2018-08-17 11:07:04 -04:00