Skip to content

Commit

Permalink
fixed rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Fulbright authored and Austin Fulbright committed Jul 27, 2024
1 parent 887e580 commit 3168084
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/git/gitGraphAst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
}));
Expand Down
7 changes: 5 additions & 2 deletions packages/mermaid/src/diagrams/git/gitGraphParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
};

Expand Down
4 changes: 0 additions & 4 deletions packages/parser/src/language/gitGraph/gitGraph.langium
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ entry GitGraph:
'gitGraph' Direction? ':'?
NEWLINE*
(
Options?
NEWLINE*
(TitleAndAccessibilities |
statements+=Statement |
Expand All @@ -48,9 +47,6 @@ Statement
Direction:
dir=('LR' | 'TB' | 'BT');

Options:
'options' '{' rawOptions+=STRING* '}' EOL;

Commit:
'commit'
(
Expand Down

0 comments on commit 3168084

Please sign in to comment.