Skip to content

Commit

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

const THEME_SIZE = 8;
const THEME_COLOR_LIMIT = 8;

let branchPos = {};
let commitPos = {};
Expand Down Expand Up @@ -124,7 +124,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 @@ -140,7 +140,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 @@ -189,7 +189,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 @@ -203,7 +203,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 @@ -217,7 +217,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 @@ -447,7 +447,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 @@ -477,7 +477,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 ae53850

Please sign in to comment.