mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 10:36:43 +02:00
Add support for changing the length of edges
Resolves #637, resolves #1495. The syntax for edges is extended to allow for extra dashes/equals signs/dots (depending on the edge type). Each added character increases the length of the edge by one rank level, as follows: Length | 1 | 2 | 3 | ------------------|:------:|:-------:|:--------:| Normal | `---` | `----` | `-----` | Normal with arrow | `-->` | `--->` | `---->` | Thick | `===` | `====` | `=====` | Thick with arrow | `==>` | `===>` | `====>` | Dotted | `-.-` | `-..-` | `-...-` | Dotted with arrow | `-.->` | `-..->` | `-...->` | This features leverages the `minlen` property exposed by Dagre which was not previously available when using Mermaid.
This commit is contained in:
@@ -696,4 +696,22 @@ describe('Flowchart', () => {
|
||||
{ }
|
||||
);
|
||||
});
|
||||
|
||||
it('35: should honor minimum edge length as specified by the user', () => {
|
||||
imgSnapshotTest(
|
||||
`graph TD
|
||||
L1 --- L2
|
||||
L2 --- C
|
||||
M1 ---> C
|
||||
R1 .-> R2
|
||||
R2 <.-> C
|
||||
C -->|Label 1| E1
|
||||
C -- Label 2 ---> E2
|
||||
C ----> E3
|
||||
C -----> E4
|
||||
C ======> E5
|
||||
`,
|
||||
{ }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user