mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 02:39:41 +02:00
Fix: state diagram default direction update
This commit is contained in:
@@ -643,10 +643,17 @@ export class StateDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDirection() {
|
getDirection() {
|
||||||
|
const doc = this.rootDoc.find((doc) => doc.stmt === 'dir');
|
||||||
|
this.direction = doc ? doc.value : 'TB';
|
||||||
return this.direction;
|
return this.direction;
|
||||||
}
|
}
|
||||||
setDirection(dir) {
|
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) {
|
trimColon(str) {
|
||||||
|
Reference in New Issue
Block a user