fixed rendering

This commit is contained in:
Austin Fulbright 2024-07-27 00:03:59 -04:00
parent 887e5803d8
commit 3168084cf5
3 changed files with 6 additions and 7 deletions

View File

@ -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: {},
}));

View File

@ -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);
};

View File

@ -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'
(