mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge branch 'develop' into 1474_missplaced_transitions
This commit is contained in:
commit
b3f9bbe50f
@ -1,5 +1,11 @@
|
|||||||
/* eslint-env jest */
|
/* eslint-env jest */
|
||||||
describe('Rerendering', () => {
|
describe('Rerendering', () => {
|
||||||
|
it('should be able to render after an error has occured', () => {
|
||||||
|
const url = 'http://localhost:9000/render-after-error.html';
|
||||||
|
cy.viewport(1440, 1024);
|
||||||
|
cy.visit(url);
|
||||||
|
cy.get('#graphDiv').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
it('should be able to render and rerender a graph via API', () => {
|
it('should be able to render and rerender a graph via API', () => {
|
||||||
const url = 'http://localhost:9000/rerender.html';
|
const url = 'http://localhost:9000/rerender.html';
|
||||||
|
@ -32,6 +32,11 @@ flowchart BT
|
|||||||
end
|
end
|
||||||
c1 --apa apa apa--> b1
|
c1 --apa apa apa--> b1
|
||||||
two --> c2
|
two --> c2
|
||||||
|
</div>
|
||||||
|
<div class="mermaid" style="width: 50%; height: 20%;">
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>Bob:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||||
|
Bob->>Alice: I'm short though
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid2" style="width: 50%; height: 20%;">
|
<div class="mermaid2" style="width: 50%; height: 20%;">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
|
32
cypress/platform/render-after-error.html
Normal file
32
cypress/platform/render-after-error.html
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>Mermaid Quick Test Page</title>
|
||||||
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="graph">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
mermaid.init({ startOnLoad: false });
|
||||||
|
mermaid.mermaidAPI.initialize();
|
||||||
|
|
||||||
|
try{
|
||||||
|
mermaid.mermaidAPI.render("graphDiv",
|
||||||
|
`>`);
|
||||||
|
} catch(e){}
|
||||||
|
|
||||||
|
mermaid.mermaidAPI.render("graphDiv",
|
||||||
|
`graph LR\n a --> b`, html => {
|
||||||
|
document.getElementById('graph').innerHTML=html;
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -724,7 +724,7 @@ const render = function(id, _txt, cb, container) {
|
|||||||
}
|
}
|
||||||
const element = document.querySelector('#' + 'd' + id);
|
const element = document.querySelector('#' + 'd' + id);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.innerHTML = '';
|
element.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
select('body')
|
select('body')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user