mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +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 }]]),
|
branchConfig: new Map([[mainBranchName, { name: mainBranchName, order: mainBranchOrder }]]),
|
||||||
branches: new Map([[mainBranchName, null]]),
|
branches: new Map([[mainBranchName, null]]),
|
||||||
currBranch: mainBranchName,
|
currBranch: mainBranchName,
|
||||||
direction: 'TB',
|
direction: 'LR',
|
||||||
seq: 0,
|
seq: 0,
|
||||||
options: {},
|
options: {},
|
||||||
}));
|
}));
|
||||||
|
@ -15,6 +15,11 @@ import type {
|
|||||||
|
|
||||||
const populate = (ast: GitGraph) => {
|
const populate = (ast: GitGraph) => {
|
||||||
populateCommonDb(ast, db);
|
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) {
|
for (const statement of ast.statements) {
|
||||||
parseStatement(statement);
|
parseStatement(statement);
|
||||||
}
|
}
|
||||||
@ -46,9 +51,7 @@ const parseCommit = (commit: CommitAst) => {
|
|||||||
const id = commit.id;
|
const id = commit.id;
|
||||||
const message = commit.message ?? '';
|
const message = commit.message ?? '';
|
||||||
const tags = commit.tags ?? undefined;
|
const tags = commit.tags ?? undefined;
|
||||||
log.info(`Commit type`, commit.type);
|
|
||||||
const type = commit.type !== undefined ? commitType[commit.type] : 0;
|
const type = commit.type !== undefined ? commitType[commit.type] : 0;
|
||||||
log.info(`Commit: ${id} ${message} ${type}`);
|
|
||||||
db.commit(message, id, type, tags);
|
db.commit(message, id, type, tags);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ entry GitGraph:
|
|||||||
'gitGraph' Direction? ':'?
|
'gitGraph' Direction? ':'?
|
||||||
NEWLINE*
|
NEWLINE*
|
||||||
(
|
(
|
||||||
Options?
|
|
||||||
NEWLINE*
|
NEWLINE*
|
||||||
(TitleAndAccessibilities |
|
(TitleAndAccessibilities |
|
||||||
statements+=Statement |
|
statements+=Statement |
|
||||||
@ -48,9 +47,6 @@ Statement
|
|||||||
Direction:
|
Direction:
|
||||||
dir=('LR' | 'TB' | 'BT');
|
dir=('LR' | 'TB' | 'BT');
|
||||||
|
|
||||||
Options:
|
|
||||||
'options' '{' rawOptions+=STRING* '}' EOL;
|
|
||||||
|
|
||||||
Commit:
|
Commit:
|
||||||
'commit'
|
'commit'
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user