mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
rename const name
This commit is contained in:
@@ -15,7 +15,7 @@ const commitType = {
|
|||||||
CHERRY_PICK: 4,
|
CHERRY_PICK: 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
const THEME_SIZE = 8;
|
const THEME_COLOR_LIMIT = 8;
|
||||||
|
|
||||||
let branchPos = {};
|
let branchPos = {};
|
||||||
let commitPos = {};
|
let commitPos = {};
|
||||||
@@ -122,7 +122,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
'commit ' +
|
'commit ' +
|
||||||
commit.id +
|
commit.id +
|
||||||
' commit-highlight' +
|
' commit-highlight' +
|
||||||
(branchPos[commit.branch].index % THEME_SIZE) +
|
(branchPos[commit.branch].index % THEME_COLOR_LIMIT) +
|
||||||
' ' +
|
' ' +
|
||||||
typeClass +
|
typeClass +
|
||||||
'-outer'
|
'-outer'
|
||||||
@@ -138,7 +138,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
'commit ' +
|
'commit ' +
|
||||||
commit.id +
|
commit.id +
|
||||||
' commit' +
|
' commit' +
|
||||||
(branchPos[commit.branch].index % THEME_SIZE) +
|
(branchPos[commit.branch].index % THEME_COLOR_LIMIT) +
|
||||||
' ' +
|
' ' +
|
||||||
typeClass +
|
typeClass +
|
||||||
'-inner'
|
'-inner'
|
||||||
@@ -187,7 +187,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
circle.attr('r', commit.type === commitType.MERGE ? 9 : 10);
|
circle.attr('r', commit.type === commitType.MERGE ? 9 : 10);
|
||||||
circle.attr(
|
circle.attr(
|
||||||
'class',
|
'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) {
|
if (commit.type === commitType.MERGE) {
|
||||||
const circle2 = gBullets.append('circle');
|
const circle2 = gBullets.append('circle');
|
||||||
@@ -201,7 +201,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
' ' +
|
' ' +
|
||||||
commit.id +
|
commit.id +
|
||||||
' commit' +
|
' commit' +
|
||||||
(branchPos[commit.branch].index % THEME_SIZE)
|
(branchPos[commit.branch].index % THEME_COLOR_LIMIT)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (commit.type === commitType.REVERSE) {
|
if (commit.type === commitType.REVERSE) {
|
||||||
@@ -215,7 +215,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
' ' +
|
' ' +
|
||||||
commit.id +
|
commit.id +
|
||||||
' commit' +
|
' commit' +
|
||||||
(branchPos[commit.branch].index % THEME_SIZE)
|
(branchPos[commit.branch].index % THEME_COLOR_LIMIT)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -445,7 +445,7 @@ const drawArrow = (svg, commit1, commit2, allCommits) => {
|
|||||||
const arrow = svg
|
const arrow = svg
|
||||||
.append('path')
|
.append('path')
|
||||||
.attr('d', lineDef)
|
.attr('d', lineDef)
|
||||||
.attr('class', 'arrow arrow' + (colorClassNum % THEME_SIZE));
|
.attr('class', 'arrow arrow' + (colorClassNum % THEME_COLOR_LIMIT));
|
||||||
};
|
};
|
||||||
|
|
||||||
const drawArrows = (svg, commits) => {
|
const drawArrows = (svg, commits) => {
|
||||||
@@ -475,7 +475,7 @@ const drawBranches = (svg, branches) => {
|
|||||||
const gitGraphConfig = getConfig().gitGraph;
|
const gitGraphConfig = getConfig().gitGraph;
|
||||||
const g = svg.append('g');
|
const g = svg.append('g');
|
||||||
branches.forEach((branch, index) => {
|
branches.forEach((branch, index) => {
|
||||||
let adjustIndexForTheme = index % THEME_SIZE;
|
let adjustIndexForTheme = index % THEME_COLOR_LIMIT;
|
||||||
|
|
||||||
const pos = branchPos[branch.name].pos;
|
const pos = branchPos[branch.name].pos;
|
||||||
const line = g.append('line');
|
const line = g.append('line');
|
||||||
|
Reference in New Issue
Block a user