Fix: state diagram default direction update

This commit is contained in:
omkarht
2025-02-17 20:53:31 +05:30
parent 548256507d
commit 72eda9ce52

View File

@@ -643,10 +643,17 @@ export class StateDB {
}
getDirection() {
const doc = this.rootDoc.find((doc) => doc.stmt === 'dir');
this.direction = doc ? doc.value : 'TB';
return this.direction;
}
setDirection(dir) {
this.direction = dir;
let doc = this.rootDoc.find((doc) => doc.stmt === 'dir');
if (doc) {
doc.value = dir;
} else {
this.rootDoc.unshift({ stmt: 'dir', value: dir });
}
}
trimColon(str) {