mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 11:59:39 +02:00
#1212 Class definition is not applied to flowchart nodes with links
This commit is contained in:
@@ -374,6 +374,7 @@ describe('Flowchart', () => {
|
|||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
`,
|
`,
|
||||||
{
|
{
|
||||||
listUrl: false,
|
listUrl: false,
|
||||||
@@ -409,7 +410,9 @@ describe('Flowchart', () => {
|
|||||||
click A "index.html#link-clicked" "link test"
|
click A "index.html#link-clicked" "link test"
|
||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;`,
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
|
`,
|
||||||
{ flowchart: { htmlLabels: false } }
|
{ flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
22
dist/index.html
vendored
22
dist/index.html
vendored
@@ -289,16 +289,17 @@ graph TB
|
|||||||
style 456ac9b0d15a8b7f1e71073221059886 fill:#f9f,stroke:#333,stroke-width:4px
|
style 456ac9b0d15a8b7f1e71073221059886 fill:#f9f,stroke:#333,stroke-width:4px
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
B --> C{{Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?}}
|
B --> C{{Let me think...<br />Do I want something for work,<br />something to spend every free second with,<br />or something to get around?}}
|
||||||
C -->|One| D[Laptop]
|
C -->|One| D[Laptop]
|
||||||
C -->|Two| E[iPhone]
|
C -->|Two| E[iPhone]
|
||||||
C -->|Three| F[Car]
|
C -->|Three| F[Car]
|
||||||
click A "index.html#link-clicked" "link test"
|
click A "index.html#link-clicked" "link test"
|
||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
@@ -312,6 +313,7 @@ class A someclass;
|
|||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph LR
|
graph LR
|
||||||
|
@@ -461,6 +461,7 @@ export const draw = function(text, id) {
|
|||||||
const node = d3.select('#' + id + ' [id="' + key + '"]');
|
const node = d3.select('#' + id + ' [id="' + key + '"]');
|
||||||
if (node) {
|
if (node) {
|
||||||
const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
||||||
|
link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));
|
||||||
link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
|
link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
|
||||||
link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
|
link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user