mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Fix for problem with text definitions being overridden by empty strings.
This commit is contained in:
parent
f55336259b
commit
c23a185b98
@ -38,8 +38,9 @@
|
||||
</div>
|
||||
<div class="mermaid">
|
||||
a[Lasa bok]-->b;
|
||||
b-->c(Vidar)|Klocka;
|
||||
b{Fundera}-->d(Bjarke)|Lego;
|
||||
b{Fundera}-->c(Vidar)|Klocka;
|
||||
b-->d(Bjarke)|Lego;
|
||||
style a background:#aaa;
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -21,7 +21,7 @@ define(['parser/graph','parser/mermaid'],function(graph,parser){
|
||||
g.setNode(vertice.id, { label: verticeText,rx:5,ry:5 });
|
||||
}else{
|
||||
if(vertice.type==='diamond'){
|
||||
g.setNode(vertice.id, {shape: "house", label: verticeText,rx:0,ry:0 });
|
||||
g.setNode(vertice.id, {shape: "house", label: verticeText,rx:0,ry:0,style: "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;" });
|
||||
}else{
|
||||
g.setNode(vertice.id, { label: verticeText,rx:0,ry:0 });
|
||||
}
|
||||
|
@ -6,13 +6,14 @@ define('parser/graph',function() {
|
||||
var edges = [];
|
||||
var graph = {
|
||||
addVertex: function (id, text, type, style) {
|
||||
console.log('Got node ' + id + ' ' + type + ' ' + text + ' styles: ' + JSON.stringify(style));
|
||||
if(typeof vertices[id] === 'undefined'){
|
||||
vertices[id]={id:id, styles:[]};
|
||||
}
|
||||
if(typeof text !== undefined){
|
||||
if(typeof text !== 'undefined'){
|
||||
vertices[id].text = text;
|
||||
}
|
||||
if(typeof type !== undefined){
|
||||
if(typeof type !== 'undefined'){
|
||||
vertices[id].type = type;
|
||||
}
|
||||
if(typeof style !== 'undefined'){
|
||||
@ -23,7 +24,6 @@ define('parser/graph',function() {
|
||||
});
|
||||
}
|
||||
}
|
||||
//console.log('Got node ' + id + ' ' + type + ' ' + text + ' styles: ' + JSON.stringify(style));
|
||||
},
|
||||
getVertices:function(){
|
||||
return vertices;
|
||||
|
Loading…
x
Reference in New Issue
Block a user