mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-03 14:19:38 +02:00
#815 Adding possibility to configure elk as renderer for flowcharts
This commit is contained in:
@@ -3,11 +3,18 @@ import type { ExternalDiagramDefinition } from 'mermaid';
|
||||
const id = 'flowchart-v3';
|
||||
|
||||
const detector = (txt: string, config) => {
|
||||
if (config?.flowchart?.defaultRenderer === 'dagre-d3') {
|
||||
return false;
|
||||
}
|
||||
if (config?.flowchart?.defaultRenderer === 'dagre-wrapper') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we have configured to use dagre-wrapper then we should return true in this function for graph code thus making it use the new flowchart diagram
|
||||
if (config?.flowchart?.defaultRenderer === 'cytoscape' && txt.match(/^\s*graph/) !== null) {
|
||||
if (txt.match(/^\s*graph/) !== null) {
|
||||
return true;
|
||||
}
|
||||
return txt.match(/^\s*cyto/) !== null;
|
||||
return txt.match(/^\s*flowchart/) !== null;
|
||||
};
|
||||
|
||||
const loader = async () => {
|
||||
|
Reference in New Issue
Block a user