Skip to content

Commit

Permalink
fix for direction
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjain0512 committed Jul 4, 2024
1 parent 6b7d78e commit 8ea7d5b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/mermaid/src/diagrams/state/stateDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -237,6 +237,8 @@ const extract = (_doc) => {
node.label = node.label[0];
}
});

direction = getDir(getRootDocV2());
};

/**
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8ea7d5b

Please sign in to comment.