mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 03:49:43 +02:00
removed function to get rem in px since config schema now has maxLabelWidth
Co-authored-by: Shahir Ahmed <ahmeds@dickinson.edu>
This commit is contained in:
@@ -21,10 +21,6 @@ function drawActorLegend(diagram) {
|
|||||||
maxWidth = 0;
|
maxWidth = 0;
|
||||||
let yPos = 60;
|
let yPos = 60;
|
||||||
|
|
||||||
const getRemInPx = (rem) => {
|
|
||||||
return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.keys(actors).forEach((person) => {
|
Object.keys(actors).forEach((person) => {
|
||||||
const colour = actors[person].color;
|
const colour = actors[person].color;
|
||||||
const circleData = {
|
const circleData = {
|
||||||
@@ -41,8 +37,8 @@ function drawActorLegend(diagram) {
|
|||||||
const tempText = diagram.append('text').attr('visibility', 'hidden').text(person);
|
const tempText = diagram.append('text').attr('visibility', 'hidden').text(person);
|
||||||
const textWidth = tempText.node().getBBox().width;
|
const textWidth = tempText.node().getBBox().width;
|
||||||
tempText.remove();
|
tempText.remove();
|
||||||
let configObject = getConfig().journey;
|
const journeyConfigObject = getConfig().journey;
|
||||||
const maxLineLength = getRemInPx(15);
|
const maxLineLength = journeyConfigObject.maxLabelWidth;
|
||||||
let lines = [];
|
let lines = [];
|
||||||
|
|
||||||
if (textWidth > maxLineLength) {
|
if (textWidth > maxLineLength) {
|
||||||
|
Reference in New Issue
Block a user