mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
1st version parsing for class diagrams, parsing draft completed, starting rendering work
This commit is contained in:
@@ -145,11 +145,16 @@ could be used. The example just logs the resulting svg to the javascript console
|
||||
mermaidAPI.initialize({
|
||||
startOnLoad:false
|
||||
});
|
||||
// Example of using the API
|
||||
$(function(){
|
||||
// Example of using the API
|
||||
var element = document.querySelector("#graphDiv");
|
||||
|
||||
var insertSvg = function(svgCode, bindFunctions){
|
||||
element.innerHTML = svgCode;
|
||||
};
|
||||
|
||||
var graphDefinition = 'graph TB\na-->b';
|
||||
var graph = mermaidAPI.render(graphDefinition);
|
||||
$("#graphDiv").html(graph);
|
||||
var graph = mermaidAPI.render('graphDiv', graphDefinition, insertSvg);
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
Reference in New Issue
Block a user