#962 Set text color for flowchart link labels according to linkStyle definitions

This commit is contained in:
Marc Faber
2020-02-02 22:59:59 +01:00
parent 4d5ecc5518
commit c95adfaf74
4 changed files with 44 additions and 14 deletions

View File

@@ -512,7 +512,7 @@ describe('Flowchart', () => {
);
});
it('24.1: Keep node label text (if already defined) when a style is applied', () => {
it('24: Keep node label text (if already defined) when a style is applied', () => {
imgSnapshotTest(
`graph LR
A(( )) -->|step 1| B(( ))
@@ -524,7 +524,7 @@ describe('Flowchart', () => {
{ flowchart: { htmlLabels: false } }
);
});
it('24.2: Handle link click events (link, anchor, mailto, other protocol, script)', () => {
it('25: Handle link click events (link, anchor, mailto, other protocol, script)', () => {
imgSnapshotTest(
`graph TB
TITLE["Link Click Events<br>(click the nodes below)"]
@@ -544,11 +544,13 @@ it('24.2: Handle link click events (link, anchor, mailto, other protocol, script
);
});
it('25: Set node text color according to style when html labels are enabled', () => {
it('26: Set text color of nodes and links according to styles when html labels are enabled', () => {
imgSnapshotTest(
`graph LR
A[red<br>text] --> B(blue<br>text)
C[/red<br/>text/] --> D{blue<br/>text}
A[red<br>text] -->|red<br>text| B(blue<br>text)
C[/red<br/>text/] -->|blue<br/>text| D{blue<br/>text}
linkStyle 0 color:red;
linkStyle 1 stroke:DarkGray,stroke-width:2px,color:#0000ff
style A color:red;
style B color:blue;
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000
@@ -560,11 +562,13 @@ it('24.2: Handle link click events (link, anchor, mailto, other protocol, script
);
});
it('26: Set node text color according to style when html labels are disabled', () => {
it('27: Set text color of nodes and links according to styles when html labels are disabled', () => {
imgSnapshotTest(
`graph LR
A[red<br>text] --> B(blue<br>text)
C[/red<br/>text/] --> D{blue<br/>text}
A[red<br>text] -->|red<br>text| B(blue<br>text)
C[/red<br/>text/] -->|blue<br/>text| D{blue<br/>text}
linkStyle 0 color:red;
linkStyle 1 stroke:DarkGray,stroke-width:2px,color:#0000ff
style A color:red;
style B color:blue;
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000