mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 03:34:12 +01:00
Fix for issues with generating diagrams using the cli: default style for clusters and fixes for autoscaling side effects
This commit is contained in:
@@ -26,16 +26,18 @@ var w;
|
||||
module.exports.draw = function (text, id) {
|
||||
gantt.yy.clear();
|
||||
gantt.parse(text);
|
||||
|
||||
var elem = document.getElementById(id);
|
||||
w = elem.parentElement.offsetWidth;
|
||||
|
||||
console.log('id='+id,' w='+w);
|
||||
console.log(elem.parentElement);
|
||||
|
||||
if (typeof w === 'undefined') {
|
||||
w = 1200;
|
||||
}
|
||||
|
||||
if(typeof conf.useWidth !== 'undefined'){
|
||||
w = conf.useWidth;
|
||||
}
|
||||
|
||||
var taskArray = gantt.yy.getTasks();
|
||||
|
||||
// Set height based on number of tasks
|
||||
@@ -83,6 +85,10 @@ module.exports.draw = function (text, id) {
|
||||
|
||||
|
||||
makeGant(taskArray, w, h);
|
||||
if(typeof conf.useWidth !== 'undefined'){
|
||||
elem.setAttribute('width', w);
|
||||
|
||||
}
|
||||
|
||||
var title = svg.append("text")
|
||||
.text(gantt.yy.getTitle())
|
||||
|
||||
Reference in New Issue
Block a user