mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 05:19:58 +02:00
#5237 Updated configuration schema for elk layout
This commit is contained in:
@@ -465,8 +465,8 @@ export const render = async (data4Layout: LayoutData, svg, element, algorithm) =
|
|||||||
layoutOptions: {
|
layoutOptions: {
|
||||||
'elk.hierarchyHandling': 'INCLUDE_CHILDREN',
|
'elk.hierarchyHandling': 'INCLUDE_CHILDREN',
|
||||||
'elk.algorithm': algorithm,
|
'elk.algorithm': algorithm,
|
||||||
'nodePlacement.strategy': data4Layout.config['elk.nodePlacement.strategy'],
|
'nodePlacement.strategy': data4Layout.config.elk.nodePlacementStrategy,
|
||||||
'elk.layered.mergeEdges': data4Layout.config['elk.mergeEdges'],
|
'elk.layered.mergeEdges': data4Layout.config.elk.mergeEdges,
|
||||||
'elk.direction': 'DOWN',
|
'elk.direction': 'DOWN',
|
||||||
'spacing.baseValue': 30,
|
'spacing.baseValue': 30,
|
||||||
// 'spacing.nodeNode': 40,
|
// 'spacing.nodeNode': 40,
|
||||||
|
@@ -88,16 +88,18 @@ export interface MermaidConfig {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
maxEdges?: number;
|
maxEdges?: number;
|
||||||
|
elk?: {
|
||||||
/**
|
/**
|
||||||
* Elk specific option that allows edges to share path where it convenient. It can make for pretty diagrams but can also make it harder to read the diagram.
|
* Elk specific option that allows edges to share path where it convenient. It can make for pretty diagrams but can also make it harder to read the diagram.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
'elk.mergeEdges'?: boolean;
|
mergeEdges?: boolean;
|
||||||
/**
|
/**
|
||||||
* Elk specific option affecting how nodes are placed.
|
* Elk specific option affecting how nodes are placed.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
'elk.nodePlacement.strategy'?: 'SIMPLE' | 'NETWORK_SIMPLEX' | 'LINEAR_SEGMENTS' | 'BRANDES_KOEPF';
|
nodePlacementStrategy?: 'SIMPLE' | 'NETWORK_SIMPLEX' | 'LINEAR_SEGMENTS' | 'BRANDES_KOEPF';
|
||||||
|
};
|
||||||
darkMode?: boolean;
|
darkMode?: boolean;
|
||||||
htmlLabels?: boolean;
|
htmlLabels?: boolean;
|
||||||
/**
|
/**
|
||||||
|
@@ -20,6 +20,10 @@ const config: RequiredDeep<MermaidConfig> = {
|
|||||||
// Set, even though they're `undefined` so that `configKeys` finds these keys
|
// Set, even though they're `undefined` so that `configKeys` finds these keys
|
||||||
// TODO: Should we replace these with `null` so that they can go in the JSON Schema?
|
// TODO: Should we replace these with `null` so that they can go in the JSON Schema?
|
||||||
deterministicIDSeed: undefined,
|
deterministicIDSeed: undefined,
|
||||||
|
elk: {
|
||||||
|
mergeEdges: false,
|
||||||
|
nodePlacementStrategy: 'SIMPLE',
|
||||||
|
},
|
||||||
themeCSS: undefined,
|
themeCSS: undefined,
|
||||||
|
|
||||||
// add non-JSON default config values
|
// add non-JSON default config values
|
||||||
|
@@ -100,12 +100,15 @@ properties:
|
|||||||
type: integer
|
type: integer
|
||||||
default: 500
|
default: 500
|
||||||
minimum: 0
|
minimum: 0
|
||||||
elk.mergeEdges:
|
elk:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
mergeEdges:
|
||||||
description: |
|
description: |
|
||||||
Elk specific option that allows edges to share path where it convenient. It can make for pretty diagrams but can also make it harder to read the diagram.
|
Elk specific option that allows edges to share path where it convenient. It can make for pretty diagrams but can also make it harder to read the diagram.
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
elk.nodePlacement.strategy:
|
nodePlacementStrategy:
|
||||||
description: |
|
description: |
|
||||||
Elk specific option affecting how nodes are placed.
|
Elk specific option affecting how nodes are placed.
|
||||||
type: string
|
type: string
|
||||||
|
Reference in New Issue
Block a user