mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Added auto wrap option (and grammar) for sequenceDiagrams
Added inline config and init(ialization) grammar Added reinitialize functionality to mermaidAPI (not to be confused with initialize) Added actorFontWeight, noteFontWeight, messageFontWeight, wrapEnabled, wrapPadding Added wrapLabel and breakWord functions to intelligently wrap text based on a pixel-based width instead of column-based - The implementation is largely from Carys Mills: https://medium.com/@CarysMills/wrapping-svg-text-without-svg-2-ecbfb58f7ba4 - Made slight modifications for mermaid-js Fixed dark theme color inconsistencies for sequence diagrams Removed !important from sequence scss as this prevents any client overrides Fixed various invalid css values in sequence scss which prevented proper rendering of various elements Added detectInit to utils for initialization json detection Updated detectType to support the existence or absence of the intialization configuration Updated calculateTextWidth to include fontWeight
This commit is contained in:
@@ -7,6 +7,16 @@ describe('when detecting chart type ', function() {
|
||||
const type = utils.detectType(str);
|
||||
expect(type).toBe('flowchart');
|
||||
});
|
||||
it('should handle an initialize defintion', function() {
|
||||
const str = 'initialize: { "logLevel": 0, "theme": "dark" }\ngraph TB\nbfs1:queue';
|
||||
const init = JSON.stringify(utils.detectInit(str));
|
||||
expect(init).toBe('{"logLevel":0,"theme":"dark"}');
|
||||
});
|
||||
it('should handle an init defintion', function() {
|
||||
const str = 'init: { "logLevel": 0, "theme": "dark" }\ngraph TB\nbfs1:queue';
|
||||
const init = JSON.stringify(utils.detectInit(str));
|
||||
expect(init).toBe('{"logLevel":0,"theme":"dark"}');
|
||||
});
|
||||
it('should handle a graph defintion with leading spaces', function() {
|
||||
const str = ' graph TB\nbfs1:queue';
|
||||
const type = utils.detectType(str);
|
||||
|
Reference in New Issue
Block a user