mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-12-09 05:54:07 +01:00
Merge branch 'develop' into feature/field-classifier
This commit is contained in:
@@ -56,7 +56,7 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].startLeft = startEdgeLabelLeft;
|
||||
setTerminalWidth(fo, bbox);
|
||||
setTerminalWidth(fo, edge.startLabelLeft);
|
||||
}
|
||||
if (edge.startLabelRight) {
|
||||
// Create the actual text element
|
||||
@@ -72,7 +72,7 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].startRight = startEdgeLabelRight;
|
||||
setTerminalWidth(fo, bbox);
|
||||
setTerminalWidth(fo, edge.startLabelRight);
|
||||
}
|
||||
if (edge.endLabelLeft) {
|
||||
// Create the actual text element
|
||||
@@ -89,7 +89,7 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].endLeft = endEdgeLabelLeft;
|
||||
setTerminalWidth(fo, bbox);
|
||||
setTerminalWidth(fo, edge.endLabelLeft);
|
||||
}
|
||||
if (edge.endLabelRight) {
|
||||
// Create the actual text element
|
||||
@@ -106,14 +106,14 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].endRight = endEdgeLabelRight;
|
||||
setTerminalWidth(fo, bbox);
|
||||
setTerminalWidth(fo, edge.endLabelRight);
|
||||
}
|
||||
};
|
||||
|
||||
function setTerminalWidth(fo, box) {
|
||||
function setTerminalWidth(fo, value) {
|
||||
if (getConfig().flowchart.htmlLabels && fo) {
|
||||
fo.style.width = box.width;
|
||||
fo.style.height = box.height;
|
||||
fo.style.width = value.length * 9 + 'px';
|
||||
fo.style.height = '12px';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ export const positionEdgeLabel = (edge, paths) => {
|
||||
let y = edge.y;
|
||||
if (path) {
|
||||
// debugger;
|
||||
const pos = utils.calcTerminalLabelPosition(0, 'start_left', path);
|
||||
const pos = utils.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_left', path);
|
||||
x = pos.x;
|
||||
y = pos.y;
|
||||
}
|
||||
@@ -153,7 +153,11 @@ export const positionEdgeLabel = (edge, paths) => {
|
||||
let y = edge.y;
|
||||
if (path) {
|
||||
// debugger;
|
||||
const pos = utils.calcTerminalLabelPosition(0, 'start_right', path);
|
||||
const pos = utils.calcTerminalLabelPosition(
|
||||
edge.arrowTypeStart ? 10 : 0,
|
||||
'start_right',
|
||||
path
|
||||
);
|
||||
x = pos.x;
|
||||
y = pos.y;
|
||||
}
|
||||
@@ -165,7 +169,7 @@ export const positionEdgeLabel = (edge, paths) => {
|
||||
let y = edge.y;
|
||||
if (path) {
|
||||
// debugger;
|
||||
const pos = utils.calcTerminalLabelPosition(0, 'end_left', path);
|
||||
const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_left', path);
|
||||
x = pos.x;
|
||||
y = pos.y;
|
||||
}
|
||||
@@ -177,7 +181,7 @@ export const positionEdgeLabel = (edge, paths) => {
|
||||
let y = edge.y;
|
||||
if (path) {
|
||||
// debugger;
|
||||
const pos = utils.calcTerminalLabelPosition(0, 'end_right', path);
|
||||
const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_right', path);
|
||||
x = pos.x;
|
||||
y = pos.y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user