Update 8.6.0_docs.md

This commit is contained in:
Neil Cuzon 2020-07-09 04:46:55 -07:00 committed by GitHub
parent 89dc64ab66
commit 3f8eb8cb6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
# Version 8.6.0 Changes
**Edit this Page** [![N|Solid](https://github.com/NeilCuzon/mermaid/blob/develop/docs/img/GitHub-Mark-32px.png)](https://github.com/NeilCuzon/mermaid/edit/develop/docs/8.6.0_docs.md)
With version 8.6.0 comes the release of directives for mermaid and a new system for configurations, with the aim of establishing centralized, sane defaults and simple implementation.
@ -33,6 +34,7 @@ default values for the **secure array** consists of: ['secure', 'securityLevel',
# Modifying Configurations and directives:
The Two types of directives: are “init” or “initialize” and “wrap”, or “wrapping”.
**Notes**: All directives are enclosed in %%{ }%%.
Older versions of mermaid will not parse directives because %% will comment out the directive.
@ -62,9 +64,14 @@ When deployed within code, init is called before the graph/diagram description.
# Wrap
Wrap is a function that is currently only deployable for sequence diagrams.
It is a non-argument directive and can be executed thusly:
%%{wrap}%%
%%{wrap}%%.
**Notes**: wrap respects manually added <br/> so if the user wants to break up their text, they have full control over those breaks by adding their own <br/> tags.
**for example**:
![Image showing wrapped text](https://github.com/NeilCuzon/mermaid/blob/develop/docs/img/wrapped%20text.png)
**Notes**: wrap respects manually added "<br/>" so if the user wants to break up their text, they have full control over those breaks by adding their own "<br/>" tags.
# Resetting Configurations:
@ -80,9 +87,16 @@ There are two more functions in the mermaidAPI that can be called by site owners
**memoize**: simple caching for computationally expensive functions. It reduces the rendering time for computationally intensive diagrams by about 90%.
**assignWithDepth** - this is an improvement on previous functions with config.js and Object.assign. The purpose of this function is to provide a sane mechanism for merging objects, similar to object.assign, but with depth.
Example of **assignWithDepth**:
![Image showing assignWithDepth](https://github.com/NeilCuzon/mermaid/blob/develop/docs/img/assignWithDepth.png)
Example of **object.Assign**:
![Image showing object.assign without depth](https://github.com/NeilCuzon/mermaid/blob/develop/docs/img/object.assign%20without%20depth.png)
**calculateTextDimensions, calculateTextWidth,** and **calculateTextHeight** - for measuring text dimensions, width and height.
**Notes**:For more information on usage, parameters, and return info for these new functions take a look at the jsdocs for them in the utils package.