mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +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
|
||||
);
|
||||
}
|
||||
if (d.vert) {
|
||||
return (
|
||||
timeScale(d.startTime) +
|
||||
theSidePad +
|
||||
0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) -
|
||||
0.5 * theBarHeight
|
||||
);
|
||||
}
|
||||
return timeScale(d.startTime) + theSidePad;
|
||||
})
|
||||
.attr('y', function (d, i) {
|
||||
@@ -295,6 +303,9 @@ export const draw = function (text, id, version, diagObj) {
|
||||
if (d.milestone) {
|
||||
return theBarHeight;
|
||||
}
|
||||
if (d.vert) {
|
||||
return theBarHeight;
|
||||
}
|
||||
return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
|
||||
})
|
||||
.attr('height', theBarHeight)
|
||||
@@ -354,6 +365,9 @@ export const draw = function (text, id, version, diagObj) {
|
||||
if (d.milestone) {
|
||||
taskClass = ' milestone ' + taskClass;
|
||||
}
|
||||
if (d.vert) {
|
||||
taskClass = ' vert ' + taskClass;
|
||||
}
|
||||
|
||||
taskClass += secNum;
|
||||
|
||||
@@ -381,6 +395,13 @@ export const draw = function (text, id, version, diagObj) {
|
||||
if (d.milestone) {
|
||||
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;
|
||||
|
||||
// Check id text width > width of rectangle
|
||||
@@ -406,6 +427,9 @@ export const draw = function (text, id, version, diagObj) {
|
||||
if (d.milestone) {
|
||||
endX = startX + theBarHeight;
|
||||
}
|
||||
if (d.vert) {
|
||||
endX = startX + theBarHeight;
|
||||
}
|
||||
const textWidth = this.getBBox().width;
|
||||
|
||||
let classStr = '';
|
||||
@@ -445,6 +469,10 @@ export const draw = function (text, id, version, diagObj) {
|
||||
taskType += ' milestoneText';
|
||||
}
|
||||
|
||||
if (d.vert) {
|
||||
taskType += ' vertText';
|
||||
}
|
||||
|
||||
// Check id text width > width of rectangle
|
||||
if (textWidth > endX - startX) {
|
||||
if (endX + textWidth + 1.5 * conf.leftPadding > w) {
|
||||
|
Reference in New Issue
Block a user