mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
fix: handling rerender in sandbox mode fixing tests
This commit is contained in:
@@ -1057,6 +1057,10 @@ Returns **any**
|
|||||||
|
|
||||||
- `conf` **any**
|
- `conf` **any**
|
||||||
|
|
||||||
|
## reinitialize
|
||||||
|
|
||||||
|
To be removed
|
||||||
|
|
||||||
## initialize
|
## initialize
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
@@ -1069,61 +1073,16 @@ Returns **any**
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
var config = {
|
var config = { theme: 'default', logLevel: 'fatal', securityLevel: 'strict', startOnLoad: true,
|
||||||
theme: 'default',
|
arrowMarkerAbsolute: false, er: { diagramPadding: 20, layoutDirection: 'TB', minEntityWidth: 100,
|
||||||
logLevel: 'fatal',
|
minEntityHeight: 75, entityPadding: 15, stroke: 'gray', fill: 'honeydew', fontSize: 12, useMaxWidth:
|
||||||
securityLevel: 'strict',
|
true, }, flowchart: { diagramPadding: 8, htmlLabels: true, curve: 'basis', }, sequence: {
|
||||||
startOnLoad: true,
|
diagramMarginX: 50, diagramMarginY: 10, actorMargin: 50, width: 150, height: 65, boxMargin: 10,
|
||||||
arrowMarkerAbsolute: false,
|
boxTextMargin: 5, noteMargin: 10, messageMargin: 35, messageAlign: 'center', mirrorActors: true,
|
||||||
|
bottomMarginAdj: 1, useMaxWidth: true, rightAngles: false, showSequenceNumbers: false, }, gantt: {
|
||||||
er: {
|
titleTopMargin: 25, barHeight: 20, barGap: 4, topPadding: 50, leftPadding: 75, gridLineStartPadding:
|
||||||
diagramPadding: 20,
|
35, fontSize: 11, fontFamily: '"Open-Sans", "sans-serif"', numberSectionStyles: 4, axisFormat:
|
||||||
layoutDirection: 'TB',
|
'%Y-%m-%d', topAxis: false, }, }; mermaid.initialize(config);
|
||||||
minEntityWidth: 100,
|
|
||||||
minEntityHeight: 75,
|
|
||||||
entityPadding: 15,
|
|
||||||
stroke: 'gray',
|
|
||||||
fill: 'honeydew',
|
|
||||||
fontSize: 12,
|
|
||||||
useMaxWidth: true,
|
|
||||||
},
|
|
||||||
flowchart: {
|
|
||||||
diagramPadding: 8,
|
|
||||||
htmlLabels: true,
|
|
||||||
curve: 'basis',
|
|
||||||
},
|
|
||||||
sequence: {
|
|
||||||
diagramMarginX: 50,
|
|
||||||
diagramMarginY: 10,
|
|
||||||
actorMargin: 50,
|
|
||||||
width: 150,
|
|
||||||
height: 65,
|
|
||||||
boxMargin: 10,
|
|
||||||
boxTextMargin: 5,
|
|
||||||
noteMargin: 10,
|
|
||||||
messageMargin: 35,
|
|
||||||
messageAlign: 'center',
|
|
||||||
mirrorActors: true,
|
|
||||||
bottomMarginAdj: 1,
|
|
||||||
useMaxWidth: true,
|
|
||||||
rightAngles: false,
|
|
||||||
showSequenceNumbers: false,
|
|
||||||
},
|
|
||||||
gantt: {
|
|
||||||
titleTopMargin: 25,
|
|
||||||
barHeight: 20,
|
|
||||||
barGap: 4,
|
|
||||||
topPadding: 50,
|
|
||||||
leftPadding: 75,
|
|
||||||
gridLineStartPadding: 35,
|
|
||||||
fontSize: 11,
|
|
||||||
fontFamily: '"Open-Sans", "sans-serif"',
|
|
||||||
numberSectionStyles: 4,
|
|
||||||
axisFormat: '%Y-%m-%d',
|
|
||||||
topAxis: false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
mermaid.initialize(config);
|
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "8.13.10",
|
"version": "8.14.0-rc1",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "dist/mermaid.core.js",
|
"main": "dist/mermaid.core.js",
|
||||||
"module": "dist/mermaid.esm.min.mjs",
|
"module": "dist/mermaid.esm.min.mjs",
|
||||||
|
@@ -28,10 +28,13 @@ export const setConf = function (cnf) {
|
|||||||
* @param svgId
|
* @param svgId
|
||||||
* @param root
|
* @param root
|
||||||
* @param doc
|
* @param doc
|
||||||
|
* @param _doc
|
||||||
*/
|
*/
|
||||||
export const addVertices = function (vert, g, svgId, root, doc) {
|
export const addVertices = function (vert, g, svgId, root, _doc) {
|
||||||
const securityLevel = getConfig().securityLevel;
|
const securityLevel = getConfig().securityLevel;
|
||||||
const svg = root.select(`[id="${svgId}"]`);
|
|
||||||
|
const svg = !root ? select(`[id="${svgId}"]`) : root.select(`[id="${svgId}"]`);
|
||||||
|
const doc = !_doc ? document : _doc;
|
||||||
const keys = Object.keys(vert);
|
const keys = Object.keys(vert);
|
||||||
|
|
||||||
// Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
|
// Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
|
||||||
|
@@ -564,7 +564,8 @@ export const draw = function (text, id) {
|
|||||||
bounds.init();
|
bounds.init();
|
||||||
log.debug(`C:${JSON.stringify(conf, null, 2)}`);
|
log.debug(`C:${JSON.stringify(conf, null, 2)}`);
|
||||||
|
|
||||||
const diagram = root.select(`[id="${id}"]`);
|
const diagram =
|
||||||
|
securityLevel === 'sandbox' ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
|
||||||
|
|
||||||
// Fetch data from the parsing
|
// Fetch data from the parsing
|
||||||
const actors = parser.yy.getActors();
|
const actors = parser.yy.getActors();
|
||||||
|
Reference in New Issue
Block a user