forked from mermaid-js/mermaid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Move setWrap to individual diagrams as necessary.
- Loading branch information
1 parent
04ce5d6
commit 066e096
Showing
4 changed files
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
// @ts-ignore: JISON doesn't support types | ||
import c4Parser from './parser/c4Diagram.jison'; | ||
import c4Db from './c4Db.js'; | ||
import c4Renderer from './c4Renderer.js'; | ||
import c4Styles from './styles.js'; | ||
import parser from './parser/c4Diagram.jison'; | ||
import db from './c4Db.js'; | ||
import renderer from './c4Renderer.js'; | ||
import styles from './styles.js'; | ||
import type { MermaidConfig } from '../../config.type.js'; | ||
import type { DiagramDefinition } from '../../diagram-api/types.js'; | ||
|
||
export const diagram: DiagramDefinition = { | ||
parser: c4Parser, | ||
db: c4Db, | ||
renderer: c4Renderer, | ||
styles: c4Styles, | ||
init: (cnf: MermaidConfig) => { | ||
c4Renderer.setConf(cnf.c4); | ||
parser, | ||
db, | ||
renderer, | ||
styles, | ||
init: ({ c4, wrap }: MermaidConfig) => { | ||
renderer.setConf(c4); | ||
db.setWrap(wrap); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,7 @@ export const diagram: DiagramDefinition = { | |
db, | ||
renderer, | ||
styles, | ||
init: ({ wrap }) => { | ||
db.setWrap(wrap); | ||
}, | ||
}; |