mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 08:19:43 +02:00
Merge pull request #1379 from spopida/bug/1362_NaN_rendering_ERD
Change ERD fontSize config to an integer to prevent NaN errors
This commit is contained in:
@@ -45,10 +45,13 @@ const drawEntities = function(svgNode, entities, graph) {
|
|||||||
.append('text')
|
.append('text')
|
||||||
.attr('id', textId)
|
.attr('id', textId)
|
||||||
.attr('x', 0)
|
.attr('x', 0)
|
||||||
.attr('y', (conf.fontSize + 2 * conf.entityPadding) / 2)
|
.attr('y', 0)
|
||||||
.attr('dominant-baseline', 'middle')
|
.attr('dominant-baseline', 'middle')
|
||||||
.attr('text-anchor', 'middle')
|
.attr('text-anchor', 'middle')
|
||||||
.attr('style', 'font-family: ' + getConfig().fontFamily + '; font-size: ' + conf.fontSize)
|
.attr(
|
||||||
|
'style',
|
||||||
|
'font-family: ' + getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px'
|
||||||
|
)
|
||||||
.text(id);
|
.text(id);
|
||||||
|
|
||||||
// Calculate the width and height of the entity
|
// Calculate the width and height of the entity
|
||||||
@@ -227,7 +230,10 @@ const drawRelationshipFromLayout = function(svg, rel, g, insert) {
|
|||||||
.attr('y', labelPoint.y)
|
.attr('y', labelPoint.y)
|
||||||
.attr('text-anchor', 'middle')
|
.attr('text-anchor', 'middle')
|
||||||
.attr('dominant-baseline', 'middle')
|
.attr('dominant-baseline', 'middle')
|
||||||
.attr('style', 'font-family: ' + getConfig().fontFamily + '; font-size: ' + conf.fontSize)
|
.attr(
|
||||||
|
'style',
|
||||||
|
'font-family: ' + getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px'
|
||||||
|
)
|
||||||
.text(rel.roleA);
|
.text(rel.roleA);
|
||||||
|
|
||||||
// Figure out how big the opaque 'container' rectangle needs to be
|
// Figure out how big the opaque 'container' rectangle needs to be
|
||||||
|
@@ -525,9 +525,9 @@ const config = {
|
|||||||
fill: 'honeydew',
|
fill: 'honeydew',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Font size
|
* Font size (expressed as an integer representing a number of pixels)
|
||||||
*/
|
*/
|
||||||
fontSize: '12px'
|
fontSize: 12
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user