Fix for subgraphs

This commit is contained in:
knsv 2015-03-22 18:36:17 +01:00
parent 0ed5a01756
commit c966aad496
7 changed files with 18 additions and 7 deletions

View File

@ -26317,6 +26317,9 @@ exports.addSubGraph = function (list, title) {
return a.filter(function(item) {
var type = typeof item;
if(item===' '){
return false;
}
if(type in prims)
return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true);
else
@ -26327,7 +26330,6 @@ exports.addSubGraph = function (list, title) {
var subG = [];
subG = uniq(subG.concat.apply(subG,list));
//console.log(subG);
subGraphs.push({nodes:subG,title:title});
};

File diff suppressed because one or more lines are too long

View File

@ -26285,6 +26285,9 @@ exports.addSubGraph = function (list, title) {
return a.filter(function(item) {
var type = typeof item;
if(item===' '){
return false;
}
if(type in prims)
return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true);
else
@ -26295,7 +26298,6 @@ exports.addSubGraph = function (list, title) {
var subG = [];
subG = uniq(subG.concat.apply(subG,list));
//console.log(subG);
subGraphs.push({nodes:subG,title:title});
};

File diff suppressed because one or more lines are too long

View File

@ -223,6 +223,9 @@ exports.addSubGraph = function (list, title) {
return a.filter(function(item) {
var type = typeof item;
if(item===' '){
return false;
}
if(type in prims)
return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true);
else
@ -233,7 +236,6 @@ exports.addSubGraph = function (list, title) {
var subG = [];
subG = uniq(subG.concat.apply(subG,list));
//console.log(subG);
subGraphs.push({nodes:subG,title:title});
};

View File

@ -348,7 +348,7 @@ describe('when parsing ',function(){
});
it('should handle subgraphs',function(){
var res = flow.parser.parse('graph TD\nA-->B\nsubgraph myTitle\nc-->d\nend\n');
var res = flow.parser.parse('graph TD\nA-->B\nsubgraph myTitle\n\n c-->d \nend\n');
var vert = flow.parser.yy.getVertices();
var edges = flow.parser.yy.getEdges();

View File

@ -112,7 +112,12 @@
end
</div>
<div class="mermaid2">graph TB
<div class="mermaid">graph TB
subgraph one
a1-->a2
end
</div>
<div class="mermaid">graph TB
subgraph one
a1-->a2
end