fixed some features and added propper default direction

This commit is contained in:
Austin Fulbright
2024-07-26 23:28:07 -04:00
parent a386bd0b74
commit 887e5803d8
3 changed files with 3 additions and 2 deletions

View File

@@ -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: 'LR', direction: 'TB',
seq: 0, seq: 0,
options: {}, options: {},
})); }));

View File

@@ -46,6 +46,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}`); log.info(`Commit: ${id} ${message} ${type}`);
db.commit(message, id, type, tags); db.commit(message, id, type, tags);

View File

@@ -57,7 +57,7 @@ Commit:
'id:' id=STRING 'id:' id=STRING
|'msg:'? message=STRING |'msg:'? message=STRING
|'tag:' tags+=STRING |'tag:' tags+=STRING
|'type:' name=('NORMAL' | 'REVERSE' | 'HIGHLIGHT') |'type:' type=('NORMAL' | 'REVERSE' | 'HIGHLIGHT')
)* EOL; )* EOL;
Branch: Branch:
'branch' name=(ID|STRING) 'branch' name=(ID|STRING)