mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Setting better height
This commit is contained in:
parent
a18543862f
commit
f86bdd648a
@ -71,7 +71,7 @@ export const draw = function(text, id) {
|
|||||||
|
|
||||||
drawActorLegend(diagram);
|
drawActorLegend(diagram);
|
||||||
bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);
|
bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);
|
||||||
|
console.log(bounds);
|
||||||
drawTasks(diagram, tasks, 0);
|
drawTasks(diagram, tasks, 0);
|
||||||
|
|
||||||
const box = bounds.getBounds();
|
const box = bounds.getBounds();
|
||||||
@ -103,6 +103,7 @@ export const draw = function(text, id) {
|
|||||||
const extraVertForTitle = title ? 70 : 0;
|
const extraVertForTitle = title ? 70 : 0;
|
||||||
diagram.attr('viewBox', `${box.startx} -25 ${width} ${height + extraVertForTitle}`);
|
diagram.attr('viewBox', `${box.startx} -25 ${width} ${height + extraVertForTitle}`);
|
||||||
diagram.attr('preserveAspectRatio', 'xMinYMin meet');
|
diagram.attr('preserveAspectRatio', 'xMinYMin meet');
|
||||||
|
diagram.attr('height', height + extraVertForTitle + 25);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const bounds = {
|
export const bounds = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user