mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
fixed rendering
This commit is contained in:
parent
887e5803d8
commit
3168084cf5
@ -35,7 +35,7 @@ const state = new ImperativeState<GitGraphState>(() => ({
|
||||
branchConfig: new Map([[mainBranchName, { name: mainBranchName, order: mainBranchOrder }]]),
|
||||
branches: new Map([[mainBranchName, null]]),
|
||||
currBranch: mainBranchName,
|
||||
direction: 'TB',
|
||||
direction: 'LR',
|
||||
seq: 0,
|
||||
options: {},
|
||||
}));
|
||||
|
@ -15,6 +15,11 @@ import type {
|
||||
|
||||
const populate = (ast: GitGraph) => {
|
||||
populateCommonDb(ast, db);
|
||||
// @ts-ignore: this wont exist if the direction is not specified
|
||||
if (ast.dir) {
|
||||
// @ts-ignore: this wont exist if the direction is not specified
|
||||
db.setDirection(ast.dir);
|
||||
}
|
||||
for (const statement of ast.statements) {
|
||||
parseStatement(statement);
|
||||
}
|
||||
@ -46,9 +51,7 @@ const parseCommit = (commit: CommitAst) => {
|
||||
const id = commit.id;
|
||||
const message = commit.message ?? '';
|
||||
const tags = commit.tags ?? undefined;
|
||||
log.info(`Commit type`, commit.type);
|
||||
const type = commit.type !== undefined ? commitType[commit.type] : 0;
|
||||
log.info(`Commit: ${id} ${message} ${type}`);
|
||||
db.commit(message, id, type, tags);
|
||||
};
|
||||
|
||||
|
@ -29,7 +29,6 @@ entry GitGraph:
|
||||
'gitGraph' Direction? ':'?
|
||||
NEWLINE*
|
||||
(
|
||||
Options?
|
||||
NEWLINE*
|
||||
(TitleAndAccessibilities |
|
||||
statements+=Statement |
|
||||
@ -48,9 +47,6 @@ Statement
|
||||
Direction:
|
||||
dir=('LR' | 'TB' | 'BT');
|
||||
|
||||
Options:
|
||||
'options' '{' rawOptions+=STRING* '}' EOL;
|
||||
|
||||
Commit:
|
||||
'commit'
|
||||
(
|
||||
|
Loading…
x
Reference in New Issue
Block a user