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 8ea7d5b commit 7f185d0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/mermaid/src/diagrams/state/stateDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ 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 @@ -221,7 +222,6 @@ 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,8 +237,6 @@ const extract = (_doc) => {
node.label = node.label[0];
}
});

direction = getDir(getRootDocV2());
};

/**
Expand Down Expand Up @@ -591,7 +589,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 };
return { nodes, edges, other: {}, config, direction: getDir(getRootDocV2()) };
};

export default {
Expand Down

0 comments on commit 7f185d0

Please sign in to comment.