mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 17:56:43 +02:00
fix flowchart edges
This commit is contained in:
@@ -730,7 +730,7 @@ export const destructLink = (_str: string, _startStr: string) => {
|
|||||||
// Todo optimizer this by caching existing nodes
|
// Todo optimizer this by caching existing nodes
|
||||||
const exists = (allSgs: FlowSubGraph[], _id: string) => {
|
const exists = (allSgs: FlowSubGraph[], _id: string) => {
|
||||||
for (const sg of allSgs) {
|
for (const sg of allSgs) {
|
||||||
if (sg.nodes.indexOf(_id) >= 0) {
|
if (sg.nodes.includes(_id)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -890,7 +890,7 @@ export const getData = () => {
|
|||||||
styles.push(...rawEdge.style);
|
styles.push(...rawEdge.style);
|
||||||
}
|
}
|
||||||
const edge: Edge = {
|
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,
|
start: rawEdge.start,
|
||||||
end: rawEdge.end,
|
end: rawEdge.end,
|
||||||
type: rawEdge.type ?? 'normal',
|
type: rawEdge.type ?? 'normal',
|
||||||
|
@@ -17,7 +17,6 @@ export const diagram = {
|
|||||||
}
|
}
|
||||||
cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
||||||
setConfig({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } });
|
setConfig({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } });
|
||||||
flowRendererV3.setConf(cnf.flowchart);
|
|
||||||
flowDb.clear();
|
flowDb.clear();
|
||||||
flowDb.setGen('gen-2');
|
flowDb.setGen('gen-2');
|
||||||
},
|
},
|
||||||
|
@@ -19,7 +19,7 @@ export const getClasses = function (
|
|||||||
export const draw = async function (text: string, id: string, _version: string, diag: any) {
|
export const draw = async function (text: string, id: string, _version: string, diag: any) {
|
||||||
log.info('REF0:');
|
log.info('REF0:');
|
||||||
log.info('Drawing state diagram (v2)', id);
|
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
|
// Handle root and document for when rendering in sandbox mode
|
||||||
let sandboxElement;
|
let sandboxElement;
|
||||||
|
@@ -16,7 +16,7 @@ import { CSS_DIAGRAM, DEFAULT_NESTED_DOC_DIR } from './stateCommon.js';
|
|||||||
* @param defaultDir - the direction to use if none is found
|
* @param defaultDir - the direction to use if none is found
|
||||||
* @returns The direction to use
|
* @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) {
|
if (!parsedItem.doc) {
|
||||||
return defaultDir;
|
return defaultDir;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user