mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
#5237 Support for composit states
This commit is contained in:
commit
0c36248073
@ -18,6 +18,7 @@ import {
|
|||||||
DIVIDER_TYPE,
|
DIVIDER_TYPE,
|
||||||
CSS_DIAGRAM,
|
CSS_DIAGRAM,
|
||||||
} from './stateCommon.js';
|
} from './stateCommon.js';
|
||||||
|
import utils from '../../utils.js';
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
const conf: Record<string, any> = {};
|
const conf: Record<string, any> = {};
|
||||||
@ -87,7 +88,7 @@ export const draw = async function (text: string, id: string, _version: string,
|
|||||||
|
|
||||||
data4Layout.type = diag.type;
|
data4Layout.type = diag.type;
|
||||||
data4Layout.layoutAlgorithm = 'dagre-wrapper';
|
data4Layout.layoutAlgorithm = 'dagre-wrapper';
|
||||||
// data4Layout.layoutAlgorithm = 'elk';
|
//data4Layout.layoutAlgorithm = 'elk';
|
||||||
data4Layout.skin = 'roughjs';
|
data4Layout.skin = 'roughjs';
|
||||||
data4Layout.direction = DIR;
|
data4Layout.direction = DIR;
|
||||||
data4Layout.nodeSpacing = conf.nodeSpacing || 50;
|
data4Layout.nodeSpacing = conf.nodeSpacing || 50;
|
||||||
@ -97,6 +98,12 @@ export const draw = async function (text: string, id: string, _version: string,
|
|||||||
console.log('REF1:', data4Layout);
|
console.log('REF1:', data4Layout);
|
||||||
await render(data4Layout, svg, element);
|
await render(data4Layout, svg, element);
|
||||||
const padding = 8;
|
const padding = 8;
|
||||||
|
utils.insertTitle(
|
||||||
|
element,
|
||||||
|
'statediagramTitleText',
|
||||||
|
conf.titleTopMargin,
|
||||||
|
diag.db.getDiagramTitle()
|
||||||
|
);
|
||||||
setupViewPortForSVG(svg, padding, CSS_DIAGRAM, conf.useMaxWidth);
|
setupViewPortForSVG(svg, padding, CSS_DIAGRAM, conf.useMaxWidth);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user