mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-10-31 10:54:15 +01:00 
			
		
		
		
	 5da4ced8c1
			
		
	
	5da4ced8c1
	
	
	
		
			
			This option lets you customise the padding around the whole flowchart. It is equivalent to `er.diagramPadding` and defaults to 8px for backwards compatibility with the current hardcoded value.
		
			
				
	
	
		
			32 lines
		
	
	
		
			787 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			787 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /* eslint-env jest */
 | |
| import { imgSnapshotTest } from '../../helpers/util';
 | |
| 
 | |
| describe('Flowchart v2', () => {
 | |
|   it('1: should render a simple flowchart', () => {
 | |
|     imgSnapshotTest(
 | |
|       `flowchart TD
 | |
|       A[Christmas] -->|Get money| B(Go shopping)
 | |
|       B --> C{Let me think}
 | |
|       C -->|One| D[Laptop]
 | |
|       C -->|Two| E[iPhone]
 | |
|       C -->|Three| F[fa:fa-car Car]
 | |
|       `,
 | |
|       {}
 | |
|     );
 | |
|   });
 | |
| 
 | |
|   it('2: should render a simple flowchart with diagramPadding set to 0', () => {
 | |
|     imgSnapshotTest(
 | |
|       `flowchart TD
 | |
|       A[Christmas] -->|Get money| B(Go shopping)
 | |
|       B --> C{Let me think}
 | |
|       %% this is a comment
 | |
|       C -->|One| D[Laptop]
 | |
|       C -->|Two| E[iPhone]
 | |
|       C -->|Three| F[fa:fa-car Car]
 | |
|       `,
 | |
|       { flowchart: { diagramPadding: 0 } }
 | |
|     );
 | |
|   });
 | |
| });
 |