Merge pull request #1967 from mermaid-js/1966_journey_padding

Journet diagrams handling of right margin
This commit is contained in:
Knut Sveidqvist 2021-04-01 08:52:26 +02:00 committed by GitHub
commit 1b3971d6da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ export const draw = function(text, id) {
drawActorLegend(diagram);
bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);
console.log(bounds);
drawTasks(diagram, tasks, 0);
const box = bounds.getBounds();
@ -103,6 +103,7 @@ export const draw = function(text, id) {
const extraVertForTitle = title ? 70 : 0;
diagram.attr('viewBox', `${box.startx} -25 ${width} ${height + extraVertForTitle}`);
diagram.attr('preserveAspectRatio', 'xMinYMin meet');
diagram.attr('height', height + extraVertForTitle + 25);
};
export const bounds = {