Skip to content

Commit

Permalink
fix flowchart edges
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjain0512 committed Jul 8, 2024
1 parent e63b5a7 commit fe22a5f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/mermaid/src/diagrams/flowchart/flowDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ export const destructLink = (_str: string, _startStr: string) => {
// Todo optimizer this by caching existing nodes
const exists = (allSgs: FlowSubGraph[], _id: string) => {
for (const sg of allSgs) {
if (sg.nodes.indexOf(_id) >= 0) {
if (sg.nodes.includes(_id)) {
return true;
}
}
Expand Down Expand Up @@ -890,7 +890,7 @@ export const getData = () => {
styles.push(...rawEdge.style);
}
const edge: Edge = {
id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: 'edge' }),
id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: 'L' }),
start: rawEdge.start,
end: rawEdge.end,
type: rawEdge.type ?? 'normal',
Expand Down
1 change: 0 additions & 1 deletion packages/mermaid/src/diagrams/flowchart/flowDiagram-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const diagram = {
}
cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
setConfig({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } });
flowRendererV3.setConf(cnf.flowchart);
flowDb.clear();
flowDb.setGen('gen-2');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getClasses = function (
export const draw = async function (text: string, id: string, _version: string, diag: any) {
log.info('REF0:');
log.info('Drawing state diagram (v2)', id);
const { securityLevel, state: conf, layout } = getConfig();
const { securityLevel, flowchart: conf, layout } = getConfig();

// Handle root and document for when rendering in sandbox mode
let sandboxElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { CSS_DIAGRAM, DEFAULT_NESTED_DOC_DIR } from './stateCommon.js';
* @param defaultDir - the direction to use if none is found
* @returns The direction to use
*/
const getDir = (parsedItem: any, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
export const getDir = (parsedItem: any, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
if (!parsedItem.doc) {
return defaultDir;
}
Expand Down

0 comments on commit fe22a5f

Please sign in to comment.