Fix for issue #271
This commit is contained in:
parent
8c8f5928f5
commit
cc8c5aecaf
|
@ -31626,7 +31626,7 @@ classes = {};
|
||||||
// Functions to be run after graph rendering
|
// Functions to be run after graph rendering
|
||||||
var funs = [];
|
var funs = [];
|
||||||
/**
|
/**
|
||||||
* Function called by parser when a node definition has been found
|
* Function called by parser when a node definition has been found.
|
||||||
* @param id
|
* @param id
|
||||||
* @param text
|
* @param text
|
||||||
* @param type
|
* @param type
|
||||||
|
@ -40322,7 +40322,7 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (classes[className].styles instanceof Array) {
|
if (classes[className].styles instanceof Array) {
|
||||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect { ' + classes[className].styles.join('; ') + '; }\n';
|
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -22121,7 +22121,7 @@ classes = {};
|
||||||
// Functions to be run after graph rendering
|
// Functions to be run after graph rendering
|
||||||
var funs = [];
|
var funs = [];
|
||||||
/**
|
/**
|
||||||
* Function called by parser when a node definition has been found
|
* Function called by parser when a node definition has been found.
|
||||||
* @param id
|
* @param id
|
||||||
* @param text
|
* @param text
|
||||||
* @param type
|
* @param type
|
||||||
|
@ -30817,7 +30817,7 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (classes[className].styles instanceof Array) {
|
if (classes[className].styles instanceof Array) {
|
||||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect { ' + classes[className].styles.join('; ') + '; }\n';
|
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31293,7 +31293,7 @@ classes = {};
|
||||||
// Functions to be run after graph rendering
|
// Functions to be run after graph rendering
|
||||||
var funs = [];
|
var funs = [];
|
||||||
/**
|
/**
|
||||||
* Function called by parser when a node definition has been found
|
* Function called by parser when a node definition has been found.
|
||||||
* @param id
|
* @param id
|
||||||
* @param text
|
* @param text
|
||||||
* @param type
|
* @param type
|
||||||
|
@ -39730,7 +39730,7 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (classes[className].styles instanceof Array) {
|
if (classes[className].styles instanceof Array) {
|
||||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect { ' + classes[className].styles.join('; ') + '; }\n';
|
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -21788,7 +21788,7 @@ classes = {};
|
||||||
// Functions to be run after graph rendering
|
// Functions to be run after graph rendering
|
||||||
var funs = [];
|
var funs = [];
|
||||||
/**
|
/**
|
||||||
* Function called by parser when a node definition has been found
|
* Function called by parser when a node definition has been found.
|
||||||
* @param id
|
* @param id
|
||||||
* @param text
|
* @param text
|
||||||
* @param type
|
* @param type
|
||||||
|
@ -30225,7 +30225,7 @@ var cloneCssStyles = function cloneCssStyles(svg, classes) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (classes[className].styles instanceof Array) {
|
if (classes[className].styles instanceof Array) {
|
||||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect { ' + classes[className].styles.join('; ') + '; }\n';
|
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -12,7 +12,7 @@ classes = {
|
||||||
// Functions to be run after graph rendering
|
// Functions to be run after graph rendering
|
||||||
var funs = [];
|
var funs = [];
|
||||||
/**
|
/**
|
||||||
* Function called by parser when a node definition has been found
|
* Function called by parser when a node definition has been found.
|
||||||
* @param id
|
* @param id
|
||||||
* @param text
|
* @param text
|
||||||
* @param type
|
* @param type
|
||||||
|
|
|
@ -108,7 +108,7 @@ var cloneCssStyles = function(svg, classes){
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (classes[className].styles instanceof Array) {
|
if (classes[className].styles instanceof Array) {
|
||||||
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect { ' + classes[className].styles.join('; ') + '; }\n';
|
embeddedStyles += '#' + svg.id.trim() + ' .' + className + '>rect, .' + className + '>polygon, .' + className + '>ellipse { ' + classes[className].styles.join('; ') + '; }\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,8 +190,8 @@ describe('when cloning CSS ', function () {
|
||||||
expect(stylesToArray(svg)).toEqual(['#mermaid-01 .node>rect { stroke:#ffffff; stroke-width:1.5px; }',
|
expect(stylesToArray(svg)).toEqual(['#mermaid-01 .node>rect { stroke:#ffffff; stroke-width:1.5px; }',
|
||||||
'.node { stroke: #eeeeee; }',
|
'.node { stroke: #eeeeee; }',
|
||||||
'.node-square { stroke: #bbbbbb; }',
|
'.node-square { stroke: #bbbbbb; }',
|
||||||
'#mermaid-01 .node-square>rect { fill:#eeeeee; stroke:#aaaaaa; }',
|
'#mermaid-01 .node-square>rect, .node-square>polygon, .node-square>ellipse { fill:#eeeeee; stroke:#aaaaaa; }',
|
||||||
'#mermaid-01 .node-circle>rect { fill:#444444; stroke:#111111; }'
|
'#mermaid-01 .node-circle>rect, .node-circle>polygon, .node-circle>ellipse { fill:#444444; stroke:#111111; }'
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../dist/mermaid.css"/>
|
||||||
|
<script src="../../dist/mermaid.js"></script>
|
||||||
|
<style>
|
||||||
|
.cluster {
|
||||||
|
fill: #fcac93;
|
||||||
|
rx:4px;
|
||||||
|
stroke: grey;
|
||||||
|
}
|
||||||
|
.cssClass > rect{
|
||||||
|
fill:#FF0000;
|
||||||
|
stroke:#FFFF00;
|
||||||
|
stroke-width:4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" href="../../dist/mermaid.forest.css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>classDef for circle and elipse</h1>
|
||||||
|
A node and D node should be green.
|
||||||
|
<div class="mermaid" id="i211">
|
||||||
|
graph LR;
|
||||||
|
A((start))-->B(step1);
|
||||||
|
B-->C[step2];
|
||||||
|
C-->D{step3};
|
||||||
|
D-->D2(-step3.5-);
|
||||||
|
D2-->E[end];
|
||||||
|
classDef green fill:#9f6,stroke:#333,stroke-width:1px;
|
||||||
|
class A,B,C,D,D2,E green;
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue