Work in progress

This commit is contained in:
Knut Sveidqvist
2020-10-15 17:49:39 +02:00
parent 0f9da18cbe
commit 6df9bf36e5
7 changed files with 764 additions and 139 deletions

View File

@@ -0,0 +1,21 @@
import { getConfig } from '../../config';
export default (dir, _branches, _commits) => { // eslint-disable-line
const config = getConfig().gitGraph;
const branches = [];
const commits = [];
for (let i = 0; i < _branches.length; i++) {
const branch = Object.assign({}, _branches[i]);
if (dir === 'TB' || dir === 'BT') {
branch.x = config.branchOffset * i;
branch.y = -1;
} else {
branch.y = config.branchOffset * i;
branch.x = -1;
}
branches.push(branch);
}
return { branches, commits };
};