PR comments

This commit is contained in:
Muhammad Faisal Bin Arba'in
2022-06-24 01:15:39 +08:00
parent 91e369a840
commit 846531363e

View File

@@ -119,13 +119,9 @@ const drawCommits = (svg, commits, modifyGraph) => {
circle.attr('width', 20); circle.attr('width', 20);
circle.attr( circle.attr(
'class', 'class',
'commit ' + `commit ${commit.id} commit-highlight${
commit.id + branchPos[commit.branch].index % THEME_COLOR_LIMIT
' commit-highlight' + } ${typeClass}-outer`
(branchPos[commit.branch].index % THEME_COLOR_LIMIT) +
' ' +
typeClass +
'-outer'
); );
gBullets gBullets
.append('rect') .append('rect')
@@ -135,13 +131,9 @@ const drawCommits = (svg, commits, modifyGraph) => {
.attr('width', 12) .attr('width', 12)
.attr( .attr(
'class', 'class',
'commit ' + `commit ${commit.id} commit${
commit.id + branchPos[commit.branch].index % THEME_COLOR_LIMIT
' commit' + } ${typeClass}-inner`
(branchPos[commit.branch].index % THEME_COLOR_LIMIT) +
' ' +
typeClass +
'-inner'
); );
} else if (commit.type === commitType.CHERRY_PICK) { } else if (commit.type === commitType.CHERRY_PICK) {
gBullets gBullets
@@ -149,21 +141,21 @@ const drawCommits = (svg, commits, modifyGraph) => {
.attr('cx', x) .attr('cx', x)
.attr('cy', y) .attr('cy', y)
.attr('r', 10) .attr('r', 10)
.attr('class', 'commit ' + commit.id + ' ' + typeClass); .attr('class', `commit ${commit.id} ${typeClass}`);
gBullets gBullets
.append('circle') .append('circle')
.attr('cx', x - 3) .attr('cx', x - 3)
.attr('cy', y + 2) .attr('cy', y + 2)
.attr('r', 2.75) .attr('r', 2.75)
.attr('fill', '#fff') .attr('fill', '#fff')
.attr('class', 'commit ' + commit.id + ' ' + typeClass); .attr('class', `commit ${commit.id} ${typeClass}`);
gBullets gBullets
.append('circle') .append('circle')
.attr('cx', x + 3) .attr('cx', x + 3)
.attr('cy', y + 2) .attr('cy', y + 2)
.attr('r', 2.75) .attr('r', 2.75)
.attr('fill', '#fff') .attr('fill', '#fff')
.attr('class', 'commit ' + commit.id + ' ' + typeClass); .attr('class', `commit ${commit.id} ${typeClass}`);
gBullets gBullets
.append('line') .append('line')
.attr('x1', x + 3) .attr('x1', x + 3)
@@ -171,7 +163,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
.attr('x2', x) .attr('x2', x)
.attr('y2', y - 5) .attr('y2', y - 5)
.attr('stroke', '#fff') .attr('stroke', '#fff')
.attr('class', 'commit ' + commit.id + ' ' + typeClass); .attr('class', `commit ${commit.id} ${typeClass}`);
gBullets gBullets
.append('line') .append('line')
.attr('x1', x - 3) .attr('x1', x - 3)
@@ -179,7 +171,7 @@ const drawCommits = (svg, commits, modifyGraph) => {
.attr('x2', x) .attr('x2', x)
.attr('y2', y - 5) .attr('y2', y - 5)
.attr('stroke', '#fff') .attr('stroke', '#fff')
.attr('class', 'commit ' + commit.id + ' ' + typeClass); .attr('class', `commit ${commit.id} ${typeClass}`);
} else { } else {
const circle = gBullets.append('circle'); const circle = gBullets.append('circle');
circle.attr('cx', x); circle.attr('cx', x);
@@ -187,7 +179,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_COLOR_LIMIT) `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');
@@ -196,12 +188,9 @@ const drawCommits = (svg, commits, modifyGraph) => {
circle2.attr('r', 6); circle2.attr('r', 6);
circle2.attr( circle2.attr(
'class', 'class',
'commit ' + `commit ${typeClass} ${commit.id} commit${
typeClass + branchPos[commit.branch].index % THEME_COLOR_LIMIT
' ' + }`
commit.id +
' commit' +
(branchPos[commit.branch].index % THEME_COLOR_LIMIT)
); );
} }
if (commit.type === commitType.REVERSE) { if (commit.type === commitType.REVERSE) {
@@ -210,12 +199,9 @@ const drawCommits = (svg, commits, modifyGraph) => {
.attr('d', `M ${x - 5},${y - 5}L${x + 5},${y + 5}M${x - 5},${y + 5}L${x + 5},${y - 5}`) .attr('d', `M ${x - 5},${y - 5}L${x + 5},${y + 5}M${x - 5},${y + 5}L${x + 5},${y - 5}`)
.attr( .attr(
'class', 'class',
'commit ' + `commit ${typeClass} ${commit.id} commit${
typeClass + branchPos[commit.branch].index % THEME_COLOR_LIMIT
' ' + }`
commit.id +
' commit' +
(branchPos[commit.branch].index % THEME_COLOR_LIMIT)
); );
} }
} }
@@ -475,7 +461,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_COLOR_LIMIT; const 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');