mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
#926 Applying the color styling on the label instead of the node
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
<body>
|
||||
<script src="./mermaid.js"></script>
|
||||
<script>
|
||||
// Notice startOnLoad=false
|
||||
// This prevents default handling in mermaid from render before the e2e logic is applied
|
||||
mermaid.initialize({
|
||||
startOnLoad: false,
|
||||
useMaxWidth: true,
|
||||
|
@@ -20,6 +20,7 @@ const contentLoaded = function () {
|
||||
div.innerHTML = graphObj.code
|
||||
document.getElementsByTagName('body')[0].appendChild(div)
|
||||
global.mermaid.initialize(graphObj.mermaid)
|
||||
// console.log('graphObj.mermaid', graphObj.mermaid)
|
||||
global.mermaid.init()
|
||||
}
|
||||
}
|
||||
@@ -30,7 +31,6 @@ const contentLoadedApi = function () {
|
||||
const graphBase64 = document.location.href.substr(pos)
|
||||
const graphObj = JSON.parse(Base64.decode(graphBase64))
|
||||
// const graph = 'hello'
|
||||
console.log(graphObj)
|
||||
const div = document.createElement('div')
|
||||
div.id = 'block'
|
||||
div.className = 'mermaid'
|
||||
@@ -57,6 +57,7 @@ if (typeof document !== 'undefined') {
|
||||
this.console.log('Using api')
|
||||
contentLoadedApi()
|
||||
} else {
|
||||
this.console.log('Not using api')
|
||||
contentLoaded()
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user