Skip to content

Commit fad6676

Browse files
authored
Merge pull request #6715 from Syn3ugar/feature/timelineRenderer-conf
fix: update leftMargin value
2 parents 5f6f511 + 637680d commit fad6676

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/wild-areas-lick.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'mermaid': patch
3+
---
4+
5+
fix(timeline): fix loading `leftMargin` from config
6+
7+
The `timeline.leftMargin` config value should now correctly control the size of the left margin, instead of being ignored.

packages/mermaid/src/diagrams/timeline/timelineRenderer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ interface TimelineTask {
2828
export const draw = function (text: string, id: string, version: string, diagObj: Diagram) {
2929
//1. Fetch the configuration
3030
const conf = getConfig();
31-
// @ts-expect-error - wrong config?
32-
const LEFT_MARGIN = conf.leftMargin ?? 50;
31+
const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
3332

3433
log.debug('timeline', diagObj.db);
3534

0 commit comments

Comments
 (0)