Skip to content

Commit

Permalink
#5237 Elk spacing tweak and fix for fonthandling in directives
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed May 23, 2024
1 parent 47776e3 commit 8d23b68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/mermaid-layout-elk/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export const render = async (data4Layout, svg, element, algorithm) => {
'elk.algorithm': algorithm,
'nodePlacement.strategy': 'NETWORK_SIMPLEX',

'spacing.nodeNode': 70,
'spacing.nodeNode': 20,
'spacing.nodeNodeBetweenLayers': 25,
'spacing.edgeNode': 10,
'spacing.edgeNodeBetweenLayers': 20,
Expand Down
5 changes: 4 additions & 1 deletion packages/mermaid/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ export const addDirective = (directive: MermaidConfig) => {

// If the directive has a fontFamily, but no themeVariables, add the fontFamily to the themeVariables
if (directive.fontFamily && (!directive.themeVariables || !directive.themeVariables.fontFamily)) {
directive.themeVariables = { fontFamily: directive.fontFamily };
directive.themeVariables = {
...directive.themeVariables,
fontFamily: directive.fontFamily,
};
}

directives.push(directive);
Expand Down

0 comments on commit 8d23b68

Please sign in to comment.