mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-21 06:59:36 +02:00
removes cy.then and magic value
Co-authored-by: Pranav Mishra <mishrap@dickinson.edu>
This commit is contained in:
@@ -103,7 +103,6 @@ section Checkout from website
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should maintain sufficient space between legend and diagram when legend labels are longer', () => {
|
it('should maintain sufficient space between legend and diagram when legend labels are longer', () => {
|
||||||
cy.then(() => {
|
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`journey
|
`journey
|
||||||
title Web hook life cycle
|
title Web hook life cycle
|
||||||
@@ -121,7 +120,6 @@ section Checkout from website
|
|||||||
`,
|
`,
|
||||||
{ journey: { useMaxWidth: true } }
|
{ journey: { useMaxWidth: true } }
|
||||||
);
|
);
|
||||||
});
|
|
||||||
|
|
||||||
let LabelEndX, diagramStartX;
|
let LabelEndX, diagramStartX;
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ function drawActorLegend(diagram) {
|
|||||||
|
|
||||||
const textElement = svgDraw.drawText(diagram, labelData);
|
const textElement = svgDraw.drawText(diagram, labelData);
|
||||||
const textLength = textElement.node().getBBox().width;
|
const textLength = textElement.node().getBBox().width;
|
||||||
if (textLength > maxWidth) {
|
if (textLength > maxWidth && textLength > conf?.leftMargin) {
|
||||||
maxWidth = textLength;
|
maxWidth = textLength;
|
||||||
}
|
}
|
||||||
yPos += 20;
|
yPos += 20;
|
||||||
@@ -90,7 +90,7 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
drawActorLegend(diagram);
|
drawActorLegend(diagram);
|
||||||
leftMargin = conf.leftMargin + maxWidth - 22.328125;
|
leftMargin = conf.leftMargin + maxWidth;
|
||||||
bounds.insert(0, 0, leftMargin, Object.keys(actors).length * 50);
|
bounds.insert(0, 0, leftMargin, Object.keys(actors).length * 50);
|
||||||
drawTasks(diagram, tasks, 0);
|
drawTasks(diagram, tasks, 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user