mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 10:36:43 +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: {
|
||||
'elk.hierarchyHandling': 'INCLUDE_CHILDREN',
|
||||
'elk.algorithm': algorithm,
|
||||
'nodePlacement.strategy': data4Layout.config['elk.nodePlacement.strategy'],
|
||||
'elk.layered.mergeEdges': data4Layout.config['elk.mergeEdges'],
|
||||
'nodePlacement.strategy': data4Layout.config.elk.nodePlacementStrategy,
|
||||
'elk.layered.mergeEdges': data4Layout.config.elk.mergeEdges,
|
||||
'elk.direction': 'DOWN',
|
||||
'spacing.baseValue': 30,
|
||||
// 'spacing.nodeNode': 40,
|
||||
|
@@ -88,16 +88,18 @@ export interface MermaidConfig {
|
||||
*
|
||||
*/
|
||||
maxEdges?: number;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Elk specific option affecting how nodes are placed.
|
||||
*
|
||||
*/
|
||||
'elk.nodePlacement.strategy'?: 'SIMPLE' | 'NETWORK_SIMPLEX' | 'LINEAR_SEGMENTS' | 'BRANDES_KOEPF';
|
||||
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.
|
||||
*
|
||||
*/
|
||||
mergeEdges?: boolean;
|
||||
/**
|
||||
* Elk specific option affecting how nodes are placed.
|
||||
*
|
||||
*/
|
||||
nodePlacementStrategy?: 'SIMPLE' | 'NETWORK_SIMPLEX' | 'LINEAR_SEGMENTS' | 'BRANDES_KOEPF';
|
||||
};
|
||||
darkMode?: boolean;
|
||||
htmlLabels?: boolean;
|
||||
/**
|
||||
|
@@ -20,6 +20,10 @@ const config: RequiredDeep<MermaidConfig> = {
|
||||
// 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?
|
||||
deterministicIDSeed: undefined,
|
||||
elk: {
|
||||
mergeEdges: false,
|
||||
nodePlacementStrategy: 'SIMPLE',
|
||||
},
|
||||
themeCSS: undefined,
|
||||
|
||||
// add non-JSON default config values
|
||||
|
@@ -100,21 +100,24 @@ properties:
|
||||
type: integer
|
||||
default: 500
|
||||
minimum: 0
|
||||
elk.mergeEdges:
|
||||
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.
|
||||
type: boolean
|
||||
default: false
|
||||
elk.nodePlacement.strategy:
|
||||
description: |
|
||||
Elk specific option affecting how nodes are placed.
|
||||
type: string
|
||||
enum:
|
||||
- SIMPLE
|
||||
- NETWORK_SIMPLEX
|
||||
- LINEAR_SEGMENTS
|
||||
- BRANDES_KOEPF
|
||||
default: SIMPLE
|
||||
elk:
|
||||
type: object
|
||||
properties:
|
||||
mergeEdges:
|
||||
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.
|
||||
type: boolean
|
||||
default: false
|
||||
nodePlacementStrategy:
|
||||
description: |
|
||||
Elk specific option affecting how nodes are placed.
|
||||
type: string
|
||||
enum:
|
||||
- SIMPLE
|
||||
- NETWORK_SIMPLEX
|
||||
- LINEAR_SEGMENTS
|
||||
- BRANDES_KOEPF
|
||||
default: SIMPLE
|
||||
darkMode:
|
||||
type: boolean
|
||||
default: false
|
||||
|
Reference in New Issue
Block a user