mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 14:29:48 +02:00
Merge pull request #721 from paulbland/right-angles
Add option for right angles
This commit is contained in:
@@ -220,9 +220,13 @@ const drawMessage = function (elem, startx, stopx, verticalPos, msg) {
|
|||||||
|
|
||||||
let line
|
let line
|
||||||
if (startx === stopx) {
|
if (startx === stopx) {
|
||||||
line = g.append('path')
|
if (conf.rightAngles) {
|
||||||
.attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' +
|
line = g.append('path').attr('d', `M ${startx},${verticalPos} H ${startx + (conf.width / 2)} V ${verticalPos + 25} H ${startx}`)
|
||||||
(verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20))
|
} else {
|
||||||
|
line = g.append('path')
|
||||||
|
.attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' +
|
||||||
|
(verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20))
|
||||||
|
}
|
||||||
|
|
||||||
bounds.bumpVerticalPos(30)
|
bounds.bumpVerticalPos(30)
|
||||||
const dx = Math.max(textWidth / 2, 100)
|
const dx = Math.max(textWidth / 2, 100)
|
||||||
|
@@ -164,7 +164,12 @@ const config = {
|
|||||||
* **useMaxWidth** - when this flag is set the height and width is set to 100% and is then scaling with the
|
* **useMaxWidth** - when this flag is set the height and width is set to 100% and is then scaling with the
|
||||||
* available space if not the absolute space required is used
|
* available space if not the absolute space required is used
|
||||||
*/
|
*/
|
||||||
useMaxWidth: true
|
useMaxWidth: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **rightAngles** - this will display arrows that start and begin at the same node as right angles, rather than a curve
|
||||||
|
*/
|
||||||
|
rightAngles: false
|
||||||
},
|
},
|
||||||
|
|
||||||
/** ### gantt
|
/** ### gantt
|
||||||
|
Reference in New Issue
Block a user