fix for direction

This commit is contained in:
Ashish Jain
2024-07-04 21:44:06 +02:00
parent 6b7d78ebcf
commit 8ea7d5b80e

View File

@@ -48,7 +48,6 @@ function newClassesList() {
let nodes = [];
let edges = [];
let direction = DEFAULT_DIAGRAM_DIRECTION;
let rootDoc = [];
let classes = newClassesList(); // style classes defined by a classDef
@@ -222,6 +221,7 @@ const extract = (_doc) => {
const look = config.look;
resetDataFetching();
dataFetcher(undefined, getRootDocV2(), diagramStates, nodes, edges, true, look, classes);
nodes.forEach((node) => {
if (Array.isArray(node.label)) {
// add the rest as description
@@ -237,6 +237,8 @@ const extract = (_doc) => {
node.label = node.label[0];
}
});
direction = getDir(getRootDocV2());
};
/**
@@ -589,7 +591,7 @@ const trimColon = (str) => (str && str[0] === ':' ? str.substr(1).trim() : str.t
export const getData = () => {
const config = getConfig();
return { nodes, edges, other: {}, config, direction: getDir(getRootDocV2()) };
return { nodes, edges, other: {}, config, direction };
};
export default {