Skip to content

Commit

Permalink
rename const name
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalarbain committed Aug 1, 2022
1 parent 81ff441 commit 91e369a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/diagrams/git/gitGraphRenderer.js
Expand Up @@ -15,7 +15,7 @@ const commitType = {
CHERRY_PICK: 4,
};

const THEME_SIZE = 8;
const THEME_COLOR_LIMIT = 8;

let branchPos = {};
let commitPos = {};
Expand Down Expand Up @@ -122,7 +122,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
'commit ' +
commit.id +
' commit-highlight' +
(branchPos[commit.branch].index % THEME_SIZE) +
(branchPos[commit.branch].index % THEME_COLOR_LIMIT) +
' ' +
typeClass +
'-outer'
Expand All @@ -138,7 +138,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
'commit ' +
commit.id +
' commit' +
(branchPos[commit.branch].index % THEME_SIZE) +
(branchPos[commit.branch].index % THEME_COLOR_LIMIT) +
' ' +
typeClass +
'-inner'
Expand Down Expand Up @@ -187,7 +187,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
circle.attr('r', commit.type === commitType.MERGE ? 9 : 10);
circle.attr(
'class',
'commit ' + commit.id + ' commit' + (branchPos[commit.branch].index % THEME_SIZE)
'commit ' + commit.id + ' commit' + (branchPos[commit.branch].index % THEME_COLOR_LIMIT)
);
if (commit.type === commitType.MERGE) {
const circle2 = gBullets.append('circle');
Expand All @@ -201,7 +201,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
' ' +
commit.id +
' commit' +
(branchPos[commit.branch].index % THEME_SIZE)
(branchPos[commit.branch].index % THEME_COLOR_LIMIT)
);
}
if (commit.type === commitType.REVERSE) {
Expand All @@ -215,7 +215,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
' ' +
commit.id +
' commit' +
(branchPos[commit.branch].index % THEME_SIZE)
(branchPos[commit.branch].index % THEME_COLOR_LIMIT)
);
}
}
Expand Down Expand Up @@ -445,7 +445,7 @@ const drawArrow = (svg, commit1, commit2, allCommits) => {
const arrow = svg
.append('path')
.attr('d', lineDef)
.attr('class', 'arrow arrow' + (colorClassNum % THEME_SIZE));
.attr('class', 'arrow arrow' + (colorClassNum % THEME_COLOR_LIMIT));
};

const drawArrows = (svg, commits) => {
Expand Down Expand Up @@ -475,7 +475,7 @@ const drawBranches = (svg, branches) => {
const gitGraphConfig = getConfig().gitGraph;
const g = svg.append('g');
branches.forEach((branch, index) => {
let adjustIndexForTheme = index % THEME_SIZE;
let adjustIndexForTheme = index % THEME_COLOR_LIMIT;

const pos = branchPos[branch.name].pos;
const line = g.append('line');
Expand Down

0 comments on commit 91e369a

Please sign in to comment.