mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
Centered Title function and changed rendering order for Elk flowchart to find Boundingbox
This commit is contained in:
parent
c08f927d60
commit
5e966d60b0
@ -949,6 +949,7 @@ export const draw = async function (text, id, _version, diagObj) {
|
||||
log.info('after layout', JSON.stringify(graph, null, 2));
|
||||
const g = await elk.layout(graph);
|
||||
drawNodes(0, 0, g.children, svg, subGraphsEl, diagObj, 0);
|
||||
utils.insertTitle(svg, 'flowchartTitleText', conf.titleTopMargin, diagObj.db.getDiagramTitle());
|
||||
log.info('after layout', g);
|
||||
g.edges?.map((edge) => {
|
||||
insertEdge(edgesEl, edge, edge.edgeData, diagObj, parentLookupDb, id);
|
||||
|
@ -829,7 +829,7 @@ export const insertTitle = (
|
||||
parent
|
||||
.append('text')
|
||||
.text(title)
|
||||
.attr('x', bounds.x + bounds.width / 2)
|
||||
.attr('x', '50%')
|
||||
.attr('y', -titleTopMargin)
|
||||
.attr('class', cssClass);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user