mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 10:49:38 +02:00
Merge pull request #4113 from mermaid-js/3192_invisible_edges
Adding the ability to use invisible edges
This commit is contained in:
@@ -670,6 +670,17 @@ title: Simple flowchart
|
||||
---
|
||||
flowchart TD
|
||||
A --> B
|
||||
`,
|
||||
{ titleTopMargin: 0 }
|
||||
);
|
||||
});
|
||||
it('3192: It should be possieble to render flowcharts with invisisble edges', () => {
|
||||
imgSnapshotTest(
|
||||
`---
|
||||
title: Simple flowchart with invisisble edges
|
||||
---
|
||||
flowchart TD
|
||||
A ~~~ B
|
||||
`,
|
||||
{ titleTopMargin: 0 }
|
||||
);
|
||||
|
@@ -391,6 +391,20 @@ flowchart LR
|
||||
A == text ==> B
|
||||
```
|
||||
|
||||
### An invisisble link
|
||||
|
||||
This can be a usefull tool in some instances where you want to alter the default positining of a node.
|
||||
|
||||
```mermaid-example
|
||||
flowchart LR
|
||||
A ~~~ B
|
||||
```
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A ~~~ B
|
||||
```
|
||||
|
||||
### Chaining of links
|
||||
|
||||
It is possible declare many links in the same line as per below:
|
||||
|
@@ -453,6 +453,9 @@ export const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph
|
||||
case 'thick':
|
||||
strokeClasses = 'edge-thickness-thick';
|
||||
break;
|
||||
case 'invisible':
|
||||
strokeClasses = 'edge-thickness-thick';
|
||||
break;
|
||||
default:
|
||||
strokeClasses = '';
|
||||
}
|
||||
|
@@ -677,6 +677,10 @@ const destructEndLink = (_str) => {
|
||||
stroke = 'thick';
|
||||
}
|
||||
|
||||
if (line[0] === '~') {
|
||||
stroke = 'invisible';
|
||||
}
|
||||
|
||||
let dots = countChar('.', line);
|
||||
|
||||
if (dots) {
|
||||
|
@@ -280,6 +280,11 @@ export const addEdges = function (edges, g, diagObj) {
|
||||
edgeData.pattern = 'solid';
|
||||
edgeData.style = 'stroke-width: 3.5px;fill:none;';
|
||||
break;
|
||||
case 'invisible':
|
||||
edgeData.thickness = 'invisible';
|
||||
edgeData.pattern = 'solid';
|
||||
edgeData.style = 'stroke-width: 0;fill:none;';
|
||||
break;
|
||||
}
|
||||
if (edge.style !== undefined) {
|
||||
const styles = getStylesFromArray(edge.style);
|
||||
|
@@ -121,6 +121,7 @@ that id.
|
||||
\s*[xo<]?\-\-+[-xo>]\s* return 'LINK';
|
||||
\s*[xo<]?\=\=+[=xo>]\s* return 'LINK';
|
||||
\s*[xo<]?\-?\.+\-[xo>]?\s* return 'LINK';
|
||||
\s*\~\~[\~]+\s* return 'LINK';
|
||||
\s*[xo<]?\-\-\s* return 'START_LINK';
|
||||
\s*[xo<]?\=\=\s* return 'START_LINK';
|
||||
\s*[xo<]?\-\.\s* return 'START_LINK';
|
||||
|
@@ -245,6 +245,15 @@ flowchart LR
|
||||
A == text ==> B
|
||||
```
|
||||
|
||||
### An invisisble link
|
||||
|
||||
This can be a usefull tool in some instances where you want to alter the default positining of a node.
|
||||
|
||||
```mermaid-example
|
||||
flowchart LR
|
||||
A ~~~ B
|
||||
```
|
||||
|
||||
### Chaining of links
|
||||
|
||||
It is possible declare many links in the same line as per below:
|
||||
|
Reference in New Issue
Block a user