mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Removing random label for merge commits
This commit is contained in:
parent
bbac11a4b8
commit
3ccf027f42
@ -181,23 +181,25 @@ const drawCommits = (svg, commits, modifyGraph) => {
|
|||||||
if (modifyGraph) {
|
if (modifyGraph) {
|
||||||
const px=4;
|
const px=4;
|
||||||
const py=2;
|
const py=2;
|
||||||
const labelBkg = gLabels.insert('rect')
|
if(commit.type !== commitType.MERGE) {
|
||||||
.attr('class', 'commit-label-bkg');
|
const labelBkg = gLabels.insert('rect')
|
||||||
|
.attr('class', 'commit-label-bkg');
|
||||||
|
|
||||||
const text = gLabels.append('text')
|
const text = gLabels.append('text')
|
||||||
.attr('x', pos)
|
.attr('x', pos)
|
||||||
.attr('y', y + 25)
|
.attr('y', y + 25)
|
||||||
.attr('class', 'commit-label')
|
.attr('class', 'commit-label')
|
||||||
.text(commit.id);
|
.text(commit.id);
|
||||||
let bbox = text.node().getBBox();
|
let bbox = text.node().getBBox();
|
||||||
console.log(bbox);
|
|
||||||
// Now we have the label, lets position the background
|
// Now we have the label, lets position the background
|
||||||
labelBkg
|
labelBkg
|
||||||
.attr('x', pos + 10 - bbox.width / 2 - py)
|
.attr('x', pos + 10 - bbox.width / 2 - py)
|
||||||
.attr('y', y + 13.5)
|
.attr('y', y + 13.5)
|
||||||
.attr('width', bbox.width + 2 * py)
|
.attr('width', bbox.width + 2 * py)
|
||||||
.attr('height', bbox.height + 2 * py);
|
.attr('height', bbox.height + 2 * py);
|
||||||
text.attr('x', pos + 10 - bbox.width / 2);
|
text.attr('x', pos + 10 - bbox.width / 2);
|
||||||
|
}
|
||||||
if(commit.tag) {
|
if(commit.tag) {
|
||||||
const rect = gLabels.insert('polygon');
|
const rect = gLabels.insert('polygon');
|
||||||
const hole = gLabels.append('circle');
|
const hole = gLabels.append('circle');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user