mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-10 10:59:51 +02:00
vert is now a copy of milestone tag
This commit is contained in:
@@ -284,6 +284,14 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
0.5 * theBarHeight
|
0.5 * theBarHeight
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (d.vert) {
|
||||||
|
return (
|
||||||
|
timeScale(d.startTime) +
|
||||||
|
theSidePad +
|
||||||
|
0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) -
|
||||||
|
0.5 * theBarHeight
|
||||||
|
);
|
||||||
|
}
|
||||||
return timeScale(d.startTime) + theSidePad;
|
return timeScale(d.startTime) + theSidePad;
|
||||||
})
|
})
|
||||||
.attr('y', function (d, i) {
|
.attr('y', function (d, i) {
|
||||||
@@ -295,6 +303,9 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
if (d.milestone) {
|
if (d.milestone) {
|
||||||
return theBarHeight;
|
return theBarHeight;
|
||||||
}
|
}
|
||||||
|
if (d.vert) {
|
||||||
|
return theBarHeight;
|
||||||
|
}
|
||||||
return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
|
return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
|
||||||
})
|
})
|
||||||
.attr('height', theBarHeight)
|
.attr('height', theBarHeight)
|
||||||
@@ -354,6 +365,9 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
if (d.milestone) {
|
if (d.milestone) {
|
||||||
taskClass = ' milestone ' + taskClass;
|
taskClass = ' milestone ' + taskClass;
|
||||||
}
|
}
|
||||||
|
if (d.vert) {
|
||||||
|
taskClass = ' vert ' + taskClass;
|
||||||
|
}
|
||||||
|
|
||||||
taskClass += secNum;
|
taskClass += secNum;
|
||||||
|
|
||||||
@@ -381,6 +395,13 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
if (d.milestone) {
|
if (d.milestone) {
|
||||||
endX = startX + theBarHeight;
|
endX = startX + theBarHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (d.vert) {
|
||||||
|
startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
|
||||||
|
}
|
||||||
|
if (d.vert) {
|
||||||
|
endX = startX + theBarHeight;
|
||||||
|
}
|
||||||
const textWidth = this.getBBox().width;
|
const textWidth = this.getBBox().width;
|
||||||
|
|
||||||
// Check id text width > width of rectangle
|
// Check id text width > width of rectangle
|
||||||
@@ -406,6 +427,9 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
if (d.milestone) {
|
if (d.milestone) {
|
||||||
endX = startX + theBarHeight;
|
endX = startX + theBarHeight;
|
||||||
}
|
}
|
||||||
|
if (d.vert) {
|
||||||
|
endX = startX + theBarHeight;
|
||||||
|
}
|
||||||
const textWidth = this.getBBox().width;
|
const textWidth = this.getBBox().width;
|
||||||
|
|
||||||
let classStr = '';
|
let classStr = '';
|
||||||
@@ -445,6 +469,10 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
taskType += ' milestoneText';
|
taskType += ' milestoneText';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (d.vert) {
|
||||||
|
taskType += ' vertText';
|
||||||
|
}
|
||||||
|
|
||||||
// Check id text width > width of rectangle
|
// Check id text width > width of rectangle
|
||||||
if (textWidth > endX - startX) {
|
if (textWidth > endX - startX) {
|
||||||
if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
||||||
|
Reference in New Issue
Block a user