mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 13:29:40 +02:00
Lint fixes
This commit is contained in:
@@ -49,21 +49,21 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
const startLabelElement = createLabel(edge.startLabelLeft, edge.labelStyle);
|
||||
const startEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals');
|
||||
const inner = startEdgeLabelLeft.insert('g').attr('class', 'inner');
|
||||
fo=inner.node().appendChild(startLabelElement);
|
||||
fo = inner.node().appendChild(startLabelElement);
|
||||
const slBox = startLabelElement.getBBox();
|
||||
inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');
|
||||
if (!terminalLabels[edge.id]) {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].startLeft = startEdgeLabelLeft;
|
||||
setTerminalWidth(fo,bbox);
|
||||
setTerminalWidth(fo, bbox);
|
||||
}
|
||||
if (edge.startLabelRight) {
|
||||
// Create the actual text element
|
||||
const startLabelElement = createLabel(edge.startLabelRight, edge.labelStyle);
|
||||
const startEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals');
|
||||
const inner = startEdgeLabelRight.insert('g').attr('class', 'inner');
|
||||
fo=startEdgeLabelRight.node().appendChild(startLabelElement);
|
||||
fo = startEdgeLabelRight.node().appendChild(startLabelElement);
|
||||
inner.node().appendChild(startLabelElement);
|
||||
const slBox = startLabelElement.getBBox();
|
||||
inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');
|
||||
@@ -72,15 +72,14 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].startRight = startEdgeLabelRight;
|
||||
setTerminalWidth(fo,bbox);
|
||||
|
||||
setTerminalWidth(fo, bbox);
|
||||
}
|
||||
if (edge.endLabelLeft) {
|
||||
// Create the actual text element
|
||||
const endLabelElement = createLabel(edge.endLabelLeft, edge.labelStyle);
|
||||
const endEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals');
|
||||
const inner = endEdgeLabelLeft.insert('g').attr('class', 'inner');
|
||||
fo=inner.node().appendChild(endLabelElement);
|
||||
fo = inner.node().appendChild(endLabelElement);
|
||||
const slBox = endLabelElement.getBBox();
|
||||
inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');
|
||||
|
||||
@@ -90,7 +89,7 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].endLeft = endEdgeLabelLeft;
|
||||
setTerminalWidth(fo,bbox);
|
||||
setTerminalWidth(fo, bbox);
|
||||
}
|
||||
if (edge.endLabelRight) {
|
||||
// Create the actual text element
|
||||
@@ -98,7 +97,7 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
const endEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals');
|
||||
const inner = endEdgeLabelRight.insert('g').attr('class', 'inner');
|
||||
|
||||
fo=inner.node().appendChild(endLabelElement);
|
||||
fo = inner.node().appendChild(endLabelElement);
|
||||
const slBox = endLabelElement.getBBox();
|
||||
inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');
|
||||
|
||||
@@ -107,15 +106,14 @@ export const insertEdgeLabel = (elem, edge) => {
|
||||
terminalLabels[edge.id] = {};
|
||||
}
|
||||
terminalLabels[edge.id].endRight = endEdgeLabelRight;
|
||||
setTerminalWidth(fo,bbox);
|
||||
|
||||
setTerminalWidth(fo, bbox);
|
||||
}
|
||||
};
|
||||
|
||||
function setTerminalWidth(fo, box){
|
||||
if(getConfig().flowchart.htmlLabels && fo){
|
||||
fo.style.width=box.width;
|
||||
fo.style.height=box.height;
|
||||
function setTerminalWidth(fo, box) {
|
||||
if (getConfig().flowchart.htmlLabels && fo) {
|
||||
fo.style.width = box.width;
|
||||
fo.style.height = box.height;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user