Change ERD fontSize config to an integer to prevent NaN errors #1379
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃搼 Summary
Change the fontSize config from a string to an integer to prevent NaN errors
Resolves #1362
馃搹 Design Decisions
This was a simple fix - the original code expressed the fontSize option for ERDs (in mermaidAPI.js) as a string, for example '12px'. But during positioning and sizing of nodes this value was used in simple arithmetic (e.g. to add padding). In fact that code itself was not necessary because the position and sizing of nodes is taken care of elsewhere, however the attempt to add a string to a padding factor was causing NaN errors during rendering. These errors were not fatal, and rendering worked anyway, but the errors needed to be sorted. This was as simple as:
馃搵 Tasks
Make sure you
develop
branch