Updated conf handling

Added initialize function
Moved genric configuration as clonseCssStyles till conf root
Added parse funtion to the mermaidAPI api
This commit is contained in:
knsv
2015-06-07 09:21:19 +02:00
parent 55fa62d9c0
commit 08fa19bc83
18 changed files with 427 additions and 608 deletions

View File

@@ -72,7 +72,7 @@ exports.addVertices = function (vert, g) {
}
var labelTypeStr = '';
if(global.mermaid.htmlLabels) {
if(conf.htmlLabels) {
labelTypeStr = 'html';
} else {
verticeText = verticeText.replace(/<br>/g, "\n");
@@ -176,7 +176,7 @@ exports.addEdges = function (edges, g) {
else {
var edgeText = edge.text.replace(/<br>/g, "\n");
if(typeof edge.style === 'undefined'){
if (global.mermaid.htmlLabels){
if (conf.htmlLabels){
g.setEdge(edge.start, edge.end,{labelType: "html",style: style, labelpos:'c', label: '<span style="background:#e8e8e8">'+edge.text+'</span>', arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
}else{
g.setEdge(edge.start, edge.end,{labelType: "text", style: "stroke: #333; stroke-width: 1.5px;fill:none", labelpos:'c', label: edgeText, arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
@@ -448,7 +448,6 @@ exports.draw = function (text, id,isDot) {
//te.text(subGraphs[subGraphs.length-i-1].title);
te.text(subG.title);
console.log('Setting subg - '+i+' to title '+subGraphs[pos].title);
}
}
}