mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
fix: ELK diagram remove re-parsing
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
// @ts-ignore: JISON typing missing
|
// @ts-ignore: JISON typing missing
|
||||||
import parser from '../../mermaid/src/diagrams/flowchart/parser/flow.jison';
|
import parser from '../../mermaid/src/diagrams/flowchart/parser/flow.jison';
|
||||||
import * as db from '../../mermaid/src/diagrams/flowchart/flowDb.js';
|
import db from '../../mermaid/src/diagrams/flowchart/flowDb.js';
|
||||||
import styles from '../../mermaid/src/diagrams/flowchart/styles.js';
|
import styles from '../../mermaid/src/diagrams/flowchart/styles.js';
|
||||||
import renderer from './flowRenderer-elk.js';
|
import renderer from './flowRenderer-elk.js';
|
||||||
|
|
||||||
|
@@ -708,15 +708,9 @@ const insertChildren = (nodeArray, parentLookupDb) => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const draw = async function (text, id, _version, diagObj) {
|
export const draw = async function (text, id, _version, diagObj) {
|
||||||
// Add temporary render element
|
|
||||||
diagObj.db.clear();
|
|
||||||
const { securityLevel, flowchart: conf } = getConfig();
|
const { securityLevel, flowchart: conf } = getConfig();
|
||||||
nodeDb = {};
|
nodeDb = {};
|
||||||
portPos = {};
|
portPos = {};
|
||||||
diagObj.db.setGen('gen-2');
|
|
||||||
// Parse the graph definition
|
|
||||||
diagObj.parser.parse(text);
|
|
||||||
|
|
||||||
const renderEl = select('body').append('div').attr('style', 'height:400px').attr('id', 'cy');
|
const renderEl = select('body').append('div').attr('style', 'height:400px').attr('id', 'cy');
|
||||||
let graph = {
|
let graph = {
|
||||||
id: 'root',
|
id: 'root',
|
||||||
|
Reference in New Issue
Block a user