mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 10:36:43 +02:00
New release
This commit is contained in:
@@ -42,9 +42,13 @@ var page = webpage.create()
|
||||
}
|
||||
, log = logger(options.verbose)
|
||||
|
||||
// If no css is suuplied make sure a fixed witdth is given to the gant renderer
|
||||
if(phantom.args[3] !== ''){
|
||||
options.ganttConfig.useWidth = 1200;
|
||||
}
|
||||
|
||||
console.log('options');
|
||||
console.log(phantom.args.length);
|
||||
//console.log('options');
|
||||
//console.log(options.css);
|
||||
|
||||
page.content = [
|
||||
'<html>'
|
||||
@@ -68,9 +72,7 @@ files.forEach(function(file) {
|
||||
, oParser = new DOMParser()
|
||||
, oDOM
|
||||
, svgContent
|
||||
, allElements
|
||||
|
||||
console.log('Gantconfig: '+options.ganttConfig);
|
||||
, allElements;
|
||||
|
||||
// this JS is executed in this statement is sandboxed, even though it doesn't
|
||||
// look like it. we need to serialize then unserialize the svgContent that's
|
||||
@@ -102,7 +104,7 @@ files.forEach(function(file) {
|
||||
}
|
||||
|
||||
if (options.svg) {
|
||||
var serialize = new XMLSerializer()
|
||||
var serialize = new XMLSerializer();
|
||||
fs.write(
|
||||
options.outputDir + fs.separator + filename + '.svg'
|
||||
, serialize.serializeToString(oDOM)
|
||||
@@ -239,13 +241,22 @@ function executeInPage(data) {
|
||||
document.body.appendChild(sc)
|
||||
}else{
|
||||
console.log('NO gantt config');
|
||||
sc = document.createElement("script")
|
||||
scContent = document.createTextNode('mermaid.ganttConfig = {useWidth:1200};')
|
||||
sc.appendChild(scContent)
|
||||
|
||||
document.body.appendChild(sc)
|
||||
}
|
||||
|
||||
|
||||
mermaid.initialize({
|
||||
sequenceDiagram:{useMaxWidth:false}
|
||||
});
|
||||
mermaid.init();
|
||||
|
||||
svg = document.querySelector('svg')
|
||||
svgValue = xmlSerializer.serializeToString(svg)
|
||||
|
||||
//console.log(document.body.outerHTML);
|
||||
|
||||
return svgValue
|
||||
}
|
||||
|
Reference in New Issue
Block a user