commit
259abb081a
|
@ -15,7 +15,7 @@ English | [简体中文](./README.zh-CN.md)
|
|||
## About
|
||||
|
||||
<!-- <Main description> -->
|
||||
Mermaid is a Javascript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
|
||||
Mermaid is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. The main purpose of Mermaid is to help documentation catch up with development.
|
||||
|
||||
> Doc-Rot is a Catch-22 that Mermaid helps to solve.
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ describe('Configuration', () => {
|
|||
.should('exist')
|
||||
.and('include', 'url(#');
|
||||
});
|
||||
it('should handle arrowMarkerAbsolute excplicitly set to false', () => {
|
||||
it('should handle arrowMarkerAbsolute explicitly set to false', () => {
|
||||
renderGraph(
|
||||
`graph TD
|
||||
A[Christmas] -->|Get money| B(Go shopping)
|
||||
|
@ -63,7 +63,7 @@ describe('Configuration', () => {
|
|||
.should('exist')
|
||||
.and('include', 'url(#');
|
||||
});
|
||||
it('should handle arrowMarkerAbsolute excplicitly set to "false" as false', () => {
|
||||
it('should handle arrowMarkerAbsolute explicitly set to "false" as false', () => {
|
||||
renderGraph(
|
||||
`graph TD
|
||||
A[Christmas] -->|Get money| B(Go shopping)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
describe('Rerendering', () => {
|
||||
it('should be able to render after an error has occured', () => {
|
||||
it('should be able to render after an error has occurred', () => {
|
||||
const url = 'http://localhost:9000/render-after-error.html';
|
||||
cy.viewport(1440, 1024);
|
||||
cy.visit(url);
|
||||
|
|
|
@ -60,52 +60,52 @@ describe('XSS', () => {
|
|||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating htmlLabels into a false positive', () => {
|
||||
it('should not allow manipulating htmlLabels into a false positive', () => {
|
||||
cy.visit('http://localhost:9000/xss4.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript', () => {
|
||||
it('should not allow manipulating antiscript to run javascript', () => {
|
||||
cy.visit('http://localhost:9000/xss5.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror', () => {
|
||||
cy.visit('http://localhost:9000/xss6.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre wrapper', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre wrapper', () => {
|
||||
cy.visit('http://localhost:9000/xss8.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
cy.visit('http://localhost:9000/xss9.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
cy.visit('http://localhost:9000/xss10.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
cy.visit('http://localhost:9000/xss11.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
cy.visit('http://localhost:9000/xss12.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||
cy.visit('http://localhost:9000/xss13.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
});
|
||||
it('should not allow maniplulating antiscript to run javascript iframes in class diagrams', () => {
|
||||
it('should not allow manipulating antiscript to run javascript iframes in class diagrams', () => {
|
||||
cy.visit('http://localhost:9000/xss14.html');
|
||||
cy.wait(1000);
|
||||
cy.get('#the-malware').should('not.exist');
|
||||
|
|
|
@ -381,7 +381,7 @@ describe('Class diagram V2', () => {
|
|||
cy.get('svg');
|
||||
});
|
||||
|
||||
it('16b: should handle the direction statemnent with TB', () => {
|
||||
it('16b: should handle the direction statement with TB', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
classDiagram
|
||||
|
@ -406,7 +406,7 @@ describe('Class diagram V2', () => {
|
|||
cy.get('svg');
|
||||
});
|
||||
|
||||
it('18: should handle the direction statemnent with LR', () => {
|
||||
it('18: should handle the direction statement with LR', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
classDiagram
|
||||
|
@ -430,7 +430,7 @@ describe('Class diagram V2', () => {
|
|||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('17a: should handle the direction statemnent with BT', () => {
|
||||
it('17a: should handle the direction statement with BT', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
classDiagram
|
||||
|
@ -454,7 +454,7 @@ describe('Class diagram V2', () => {
|
|||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('17b: should handle the direction statemment with RL', () => {
|
||||
it('17b: should handle the direction statement with RL', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
classDiagram
|
||||
|
|
|
@ -16,7 +16,7 @@ describe('Configuration and directives - nodes should be light blue', () => {
|
|||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('Settigns from intitialize - nodes should be green', () => {
|
||||
it('Settings from initialize - nodes should be green', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
graph TD
|
||||
|
@ -30,7 +30,7 @@ graph TD
|
|||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('Settings from initialize overriding themeVariable - nodes shold be red', () => {
|
||||
it('Settings from initialize overriding themeVariable - nodes should be red', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ context('Sequence diagram', () => {
|
|||
imgSnapshotTest(
|
||||
`
|
||||
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
|
||||
Alice->>Bob: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
loop Loopy
|
||||
Bob->>Alice: Pasten
|
||||
end `,
|
||||
|
@ -143,7 +143,7 @@ context('Sequence diagram', () => {
|
|||
imgSnapshotTest(
|
||||
`
|
||||
sequenceDiagram
|
||||
participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
participant A as Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
A->>Bob: Hola
|
||||
Bob-->A: Pasten !
|
||||
`,
|
||||
|
@ -154,7 +154,7 @@ context('Sequence diagram', () => {
|
|||
imgSnapshotTest(
|
||||
`
|
||||
sequenceDiagram
|
||||
participant A as wrap:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
participant A as wrap:Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
A->>Bob: Hola
|
||||
Bob-->A: Pasten !
|
||||
`,
|
||||
|
@ -166,7 +166,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
%%{init: {'config': {'wrap': true }}}%%
|
||||
sequenceDiagram
|
||||
participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
participant A as Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
A->>Bob: Hola
|
||||
Bob-->A: Pasten !
|
||||
`,
|
||||
|
@ -190,7 +190,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hola
|
||||
Note left of Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Note left of Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -201,7 +201,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hola
|
||||
Note left of Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Note left of Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -212,7 +212,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hola
|
||||
Note right of Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Note right of Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -223,7 +223,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hola
|
||||
Note right of Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Note right of Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -234,7 +234,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hola
|
||||
Note over Alice: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Note over Alice: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -245,7 +245,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hola
|
||||
Note over Alice:wrap: Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Note over Alice:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -255,7 +255,7 @@ context('Sequence diagram', () => {
|
|||
imgSnapshotTest(
|
||||
`
|
||||
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
|
||||
Alice->>Bob: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -265,7 +265,7 @@ context('Sequence diagram', () => {
|
|||
imgSnapshotTest(
|
||||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob:wrap:Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
Alice->>Bob:wrap:Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
`,
|
||||
{}
|
||||
|
@ -276,7 +276,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: I'm short
|
||||
Bob->>Alice: 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: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
`,
|
||||
{}
|
||||
);
|
||||
|
@ -286,7 +286,7 @@ context('Sequence diagram', () => {
|
|||
`
|
||||
sequenceDiagram
|
||||
Alice->>Bob: I'm short
|
||||
Bob->>Alice:wrap: 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:wrap: Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
`,
|
||||
{}
|
||||
);
|
||||
|
|
|
@ -35,7 +35,7 @@ flowchart BT
|
|||
</div>
|
||||
<div class="mermaid2" style="width: 50%; height: 200px;">
|
||||
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
|
||||
Alice->>Bob:Extremely utterly long line of longness which had previously overflown the actor box as it is much longer than what it should be
|
||||
Bob->>Alice: I'm short though
|
||||
</div>
|
||||
<div class="mermaid2" style="width: 50%; height: 200px;">
|
||||
|
|
|
@ -3,4 +3,4 @@ div.id = 'the-malware';
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
parent.document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
// const el = document.querySelector('.mermaid');
|
||||
// el.parentNode.removeChild(el);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'classDiagram\n';
|
||||
|
@ -105,4 +105,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'stateDiagram-v2\n';
|
||||
|
@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'stateDiagram-v2\n';
|
||||
|
@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'stateDiagram-v2\n';
|
||||
|
@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'classDiagram\n';
|
||||
|
@ -105,4 +105,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = `sequenceDiagram
|
||||
|
@ -104,4 +104,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = `sequenceDiagram
|
||||
|
@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = `sequenceDiagram
|
||||
|
@ -103,4 +103,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = `classDiagram
|
||||
|
@ -102,4 +102,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = `classDiagram
|
||||
|
@ -104,4 +104,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
// var diagram = ` graph TD
|
||||
|
@ -102,4 +102,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
// var diagram = ` graph TD
|
||||
|
@ -102,4 +102,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
var diagram = 'graph LR\n';
|
||||
diagram += 'B-->D("<img onerror=location=`java';
|
||||
|
@ -100,4 +100,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
var diagram = 'graph LR\n';
|
||||
diagram += 'A(<img/src/onerror=xssAttack`1`>)';
|
||||
|
@ -98,4 +98,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
var diagram = 'graph LR\n';
|
||||
diagram += " B(<a href='<";
|
||||
|
@ -100,4 +100,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'stateDiagram-v2\n';
|
||||
|
@ -99,4 +99,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
div.className = 'malware';
|
||||
div.innerHTML = 'XSS Succeeded';
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
throw new Error('XSS Succeded');
|
||||
throw new Error('XSS Succeeded');
|
||||
}
|
||||
|
||||
var diagram = 'stateDiagram-v2\n';
|
||||
|
@ -99,4 +99,3 @@ mermaid.render('diagram', diagram, (res) => {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ Enterprise_Boundary(b0, "BankBoundary0") {
|
|||
Person(customer, Customer, "A customer of the bank, with personal bank accounts")
|
||||
|
||||
Container_Boundary(c1, "Internet Banking") {
|
||||
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to cutomers via their web browser")
|
||||
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to customers via their web browser")
|
||||
Container_Ext(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device")
|
||||
Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA")
|
||||
ContainerDb(database, "Database", "SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.")
|
||||
|
@ -99,7 +99,7 @@ Enterprise_Boundary(b0, "BankBoundary0") {
|
|||
System_Ext(mbs, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||||
|
||||
Container_Boundary(api, "API Application") {
|
||||
Component(sign, "Sign In Controller", "MVC Rest Controlle", "Allows users to sign in to the internet banking system")
|
||||
Component(sign, "Sign In Controller", "MVC Rest Controller", "Allows users to sign in to the internet banking system")
|
||||
Component(accounts, "Accounts Summary Controller", "MVC Rest Controller", "Provides customers with a summary of their bank accounts")
|
||||
Component(security, "Security Component", "Spring Bean", "Provides functionality related to singing in, changing passwords, etc.")
|
||||
Component(mbsfacade, "Mainframe Banking System Facade", "Spring Bean", "A facade onto the mainframe banking system.")
|
||||
|
|
|
@ -118,7 +118,7 @@ Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
|
|||
|
||||
This option controls if the generated ids of nodes in the SVG are generated randomly or based
|
||||
on a seed. If set to false, the IDs are generated based on the current date and thus are not
|
||||
deterministic. This is the default behaviour.
|
||||
deterministic. This is the default behavior.
|
||||
|
||||
**Notes**:
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
|
||||
|
||||
Mermaid's c4 diagram sytax is compatible with plantUML. See example below:
|
||||
Mermaid's c4 diagram syntax is compatible with plantUML. See example below:
|
||||
|
||||
```mermaid-example
|
||||
C4Context
|
||||
|
|
|
@ -194,7 +194,7 @@ Here, a new commit representing the cherry-pick is created on the current branch
|
|||
A few important rules to note here are:
|
||||
1. You need to provide the `id` for an existing commit to be cherry-picked. If given commit id does not exist it will result in an error. For this, make use of the `commit id:$value` format of declaring commits. See the examples from above.
|
||||
2. The given commit must not exist on the current branch. The cherry-picked commit must always be a different branch than the current branch.
|
||||
3. Current branch must have at least one commit, before you can cherry-pick, otherwise it will case an error is throw.
|
||||
3. Current branch must have at least one commit, before you can cherry-pick, otherwise it will cause an error is throw.
|
||||
|
||||
Let see an example:
|
||||
```mermaid-example
|
||||
|
|
|
@ -110,7 +110,7 @@ Look at `graphDb.js` for more details on that object.
|
|||
|
||||
## Layout
|
||||
|
||||
If you are using a dagre based layout, please use flowchart-v2 as a template and by doing that you will be using dagre-wrapper instead of dagreD3 which we are m igrating away from.
|
||||
If you are using a dagre based layout, please use flowchart-v2 as a template and by doing that you will be using dagre-wrapper instead of dagreD3 which we are migrating away from.
|
||||
|
||||
### Common parts of a diagram
|
||||
|
||||
|
@ -129,7 +129,7 @@ Here is example handling from flowcharts:
|
|||
Jison:
|
||||
```jison
|
||||
|
||||
/* lexial grammar */
|
||||
/* lexical grammar */
|
||||
%lex
|
||||
%x open_directive
|
||||
%x type_directive
|
||||
|
@ -175,7 +175,7 @@ It is probably a good idea to keep the handling similar to this in your new diag
|
|||
The syntax for adding title and description looks like this:
|
||||
```
|
||||
accTitle: The title
|
||||
accDescr: The dsscription
|
||||
accDescr: The description
|
||||
|
||||
accDescr {
|
||||
Syntax for a description text
|
||||
|
|
|
@ -21,7 +21,7 @@ export const updateCurrentConfig = (siteCfg, _directives) => {
|
|||
const d = _directives[i];
|
||||
sanitize(d);
|
||||
|
||||
// Apply the data from the directive where the the overrides the themeVaraibles
|
||||
// Apply the data from the directive where the the overrides the themeVariables
|
||||
sumOfDirectives = assignWithDepth(sumOfDirectives, d);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ export const setSiteConfig = (conf) => {
|
|||
return siteConfig;
|
||||
};
|
||||
|
||||
export const saveConfigFromInitilize = (conf) => {
|
||||
export const saveConfigFromInitialize = (conf) => {
|
||||
configFromInitialize = assignWithDepth({}, conf);
|
||||
};
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ flowchart
|
|||
|
||||
The new nodes C1 and C2 are a special type of nodes, clusterNodes. ClusterNodes have have the nodes in the cluster including the cluster attached in a graph object.
|
||||
|
||||
When rendering this diagram it it beeing rendered recursivly. The diagram is rendered by the dagre-mermaid:render function which in turn will be used to render the node C1 and the node C2. The result of those renderings will be inserted as nodes in the "root" diagram. With this recursive approach it would be possible to have different layout direction for each cluster.
|
||||
When rendering this diagram it it beeing rendered recursively. The diagram is rendered by the dagre-mermaid:render function which in turn will be used to render the node C1 and the node C2. The result of those renderings will be inserted as nodes in the "root" diagram. With this recursive approach it would be possible to have different layout direction for each cluster.
|
||||
|
||||
```
|
||||
{ clusterNode: true, graph }
|
||||
|
@ -74,7 +74,7 @@ This is set by the renderer of the diagram and insert the data that the wrapper
|
|||
|
||||
| property | description |
|
||||
| ---------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| labelStyle | Css styles for the label. User for instance for stylling the labels for clusters |
|
||||
| labelStyle | Css styles for the label. User for instance for styling the labels for clusters |
|
||||
| shape | The shape of the node. |
|
||||
| labelText | The text on the label |
|
||||
| rx | The corner radius - maybe part of the shape instead? Used for rects. |
|
||||
|
|
|
@ -78,7 +78,7 @@ const rect = (parent, node) => {
|
|||
};
|
||||
|
||||
/**
|
||||
* Non visiable cluster where the note is group with its
|
||||
* Non visible cluster where the note is group with its
|
||||
*
|
||||
* @param {any} parent
|
||||
* @param {any} node
|
||||
|
|
|
@ -313,7 +313,7 @@ const cutPathAtIntersect = (_points, boundryNode) => {
|
|||
// check if point is inside the boundry rect
|
||||
if (!outsideNode(boundryNode, point) && !isInside) {
|
||||
// First point inside the rect found
|
||||
// Calc the intersection coord between the point anf the last opint ouside the rect
|
||||
// Calc the intersection coord between the point anf the last point outside the rect
|
||||
const inter = intersection(boundryNode, lastPointOutside, point);
|
||||
log.warn('abc88 inside', point, lastPointOutside, inter);
|
||||
log.warn('abc88 intersection', inter);
|
||||
|
@ -391,7 +391,7 @@ export const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph
|
|||
// }
|
||||
// isInside = true;
|
||||
// } else {
|
||||
// // outtside
|
||||
// // outside
|
||||
// lastPointOutside = point;
|
||||
// if (!isInside) points.push(point);
|
||||
// }
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('Graphlib decorations', () => {
|
|||
expect(int.x).toBeCloseTo(192.4609375);
|
||||
expect(int.y).toBeCloseTo(145.15711441743503);
|
||||
});
|
||||
it('case 3 - intersection on otop of box outside point greater then inside point', function () {
|
||||
it('case 3 - intersection on top of box outside point greater then inside point', function () {
|
||||
const o = { x: 157, y: 39 };
|
||||
const i = { x: 104, y: 105 };
|
||||
const node2 = {
|
||||
|
|
|
@ -61,7 +61,7 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => {
|
|||
log.warn('Recursive render complete ', newEl, node);
|
||||
} else {
|
||||
if (graph.children(v).length > 0) {
|
||||
// This is a cluster but not to be rendered recusively
|
||||
// This is a cluster but not to be rendered recursively
|
||||
// Render as before
|
||||
log.info('Cluster - the non recursive path XXX', v, node.id, node, graph);
|
||||
log.info(findNonClusterChild(node.id, graph));
|
||||
|
@ -117,7 +117,7 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => {
|
|||
} else {
|
||||
// Non cluster node
|
||||
if (graph.children(v).length > 0) {
|
||||
// A cluster in the non-recurive way
|
||||
// A cluster in the non-recursive way
|
||||
// positionCluster(node);
|
||||
insertCluster(clusters, node);
|
||||
clusterDb[node.id].node = node;
|
||||
|
|
|
@ -244,7 +244,7 @@ const barb = (elem, type) => {
|
|||
.attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');
|
||||
};
|
||||
|
||||
// TODO rename the class diagram markers to something shape descriptive and semanitc free
|
||||
// TODO rename the class diagram markers to something shape descriptive and semantic free
|
||||
const markers = {
|
||||
extension,
|
||||
composition,
|
||||
|
|
|
@ -210,7 +210,7 @@ export const adjustClustersAndEdges = (graph, depth) => {
|
|||
} else {
|
||||
log.debug('Opting in, graph ');
|
||||
}
|
||||
// Go through the nodes and for each cluster found, save a replacment node, this can be used when
|
||||
// Go through the nodes and for each cluster found, save a replacement node, this can be used when
|
||||
// faking a link to a cluster
|
||||
graph.nodes().forEach(function (id) {
|
||||
const children = graph.children(id);
|
||||
|
@ -257,7 +257,7 @@ export const adjustClustersAndEdges = (graph, depth) => {
|
|||
});
|
||||
|
||||
// For clusters with incoming and/or outgoing edges translate those edges to a real node
|
||||
// in the cluster inorder to fake the edge
|
||||
// in the cluster in order to fake the edge
|
||||
graph.edges().forEach(function (e) {
|
||||
const edge = graph.edge(e);
|
||||
log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));
|
||||
|
|
|
@ -877,7 +877,7 @@ const class_box = (parent, node) => {
|
|||
);
|
||||
verticalPos = interfaceBBox.height + rowPadding;
|
||||
}
|
||||
// Positin the class title label
|
||||
// Position the class title label
|
||||
let diffX = (maxWidth - classTitleBBox.width) / 2;
|
||||
select(classTitleLabel).attr(
|
||||
'transform',
|
||||
|
|
|
@ -45,7 +45,7 @@ const dots = (elem, type) => {
|
|||
.attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');
|
||||
};
|
||||
|
||||
// TODO rename the class diagram markers to something shape descriptive and semanitc free
|
||||
// TODO rename the class diagram markers to something shape descriptive and semantic free
|
||||
const patterns = {
|
||||
dots,
|
||||
};
|
||||
|
|
|
@ -568,7 +568,7 @@ function drawInsideBoundary(diagram, parentBoundaryAlias, parentBounds, currentB
|
|||
export const draw = function (text, id) {
|
||||
conf = configApi.getConfig().c4;
|
||||
const securityLevel = configApi.getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -315,7 +315,7 @@ const drawBoundary = function (elem, boundary, conf) {
|
|||
|
||||
drawRect(boundaryElem, rectData);
|
||||
|
||||
// draw lable
|
||||
// draw label
|
||||
let boundaryConf = conf.boundaryFont();
|
||||
boundaryConf.fontWeight = 'bold';
|
||||
boundaryConf.fontSize = boundaryConf.fontSize + 2;
|
||||
|
|
|
@ -138,7 +138,7 @@ export const addClasses = function (classes, g) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Add edges to graph based on parsed graph defninition
|
||||
* Add edges to graph based on parsed graph definition
|
||||
*
|
||||
* @param relations
|
||||
* @param {object} g The graph object
|
||||
|
@ -317,7 +317,7 @@ export const draw = function (text, id) {
|
|||
// flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);
|
||||
// }
|
||||
|
||||
// Fetch the verices/nodes and edges/links from the parsed graph definition
|
||||
// Fetch the vertices/nodes and edges/links from the parsed graph definition
|
||||
const classes = classDb.getClasses();
|
||||
const relations = classDb.getRelations();
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ export const draw = function (text, id) {
|
|||
log.info('Rendering diagram ' + text);
|
||||
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -547,7 +547,7 @@ export const draw = function (text, id) {
|
|||
const parser = erParser.parser;
|
||||
parser.yy = erDb;
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
@ -575,7 +575,7 @@ export const draw = function (text, id) {
|
|||
// ---
|
||||
// 1. Create all the entities in the svg node at 0,0, but with the correct dimensions (allowing for text content)
|
||||
// 2. Make sure they are all added to the graph
|
||||
// 3. Add all the edges (relationships) to the graph aswell
|
||||
// 3. Add all the edges (relationships) to the graph as well
|
||||
// 4. Let dagre do its magic to layout the graph. This assigns:
|
||||
// - the centre co-ordinates for each node, bearing in mind the dimensions and edge relationships
|
||||
// - the path co-ordinates for each edge
|
||||
|
|
|
@ -465,7 +465,7 @@ export const addSubGraph = function (_id, list, _title) {
|
|||
const prims = { boolean: {}, number: {}, string: {} };
|
||||
const objs = [];
|
||||
|
||||
let dir; // = unbdefined; direction.trim();
|
||||
let dir; // = undefined; direction.trim();
|
||||
const nodeList = a.filter(function (item) {
|
||||
const type = typeof item;
|
||||
if (item.stmt && item.stmt === 'dir') {
|
||||
|
|
|
@ -58,7 +58,7 @@ describe('[Comments] when parsing', () => {
|
|||
});
|
||||
|
||||
it('should handle comments at the end no trailing newline', function () {
|
||||
const res = flow.parser.parse('graph TD;\n A-->B\n%% Commento');
|
||||
const res = flow.parser.parse('graph TD;\n A-->B\n%% Comment');
|
||||
|
||||
const vert = flow.parser.yy.getVertices();
|
||||
const edges = flow.parser.yy.getEdges();
|
||||
|
@ -73,7 +73,7 @@ describe('[Comments] when parsing', () => {
|
|||
});
|
||||
|
||||
it('should handle comments at the end many trailing newlines', function () {
|
||||
const res = flow.parser.parse('graph TD;\n A-->B\n%% Commento\n\n\n');
|
||||
const res = flow.parser.parse('graph TD;\n A-->B\n%% Comment\n\n\n');
|
||||
|
||||
const vert = flow.parser.yy.getVertices();
|
||||
const edges = flow.parser.yy.getEdges();
|
||||
|
|
|
@ -12,7 +12,7 @@ describe('parsing a flow chart', function () {
|
|||
flow.parser.yy.clear();
|
||||
});
|
||||
|
||||
it('should handle a trailing whitespaces after statememnts', function () {
|
||||
it('should handle a trailing whitespaces after statements', function () {
|
||||
const res = flow.parser.parse('graph TD;\n\n\n %% Comment\n A-->B; \n B-->C;');
|
||||
|
||||
const vert = flow.parser.yy.getVertices();
|
||||
|
|
|
@ -30,7 +30,7 @@ export const draw = function (text, id) {
|
|||
parser.parse(text);
|
||||
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -65,9 +65,9 @@ const drawText = (txt) => {
|
|||
};
|
||||
|
||||
/**
|
||||
* Draws the commits with its symbol and labels. The function has tywo modes, one which only
|
||||
* Draws the commits with its symbol and labels. The function has two modes, one which only
|
||||
* calculates the positions and one that does the actual drawing. This for a simple way getting the
|
||||
* vertical leyering rcorrect in the graph.
|
||||
* vertical layering correct in the graph.
|
||||
*
|
||||
* @param {any} svg
|
||||
* @param {any} commits
|
||||
|
@ -345,7 +345,7 @@ const findLane = (y1, y2, _depth) => {
|
|||
};
|
||||
|
||||
/**
|
||||
* This function draw trhe lines between the commits. They were arrows initially.
|
||||
* This function draw the lines between the commits. They were arrows initially.
|
||||
*
|
||||
* @param {any} svg
|
||||
* @param {any} commit1
|
||||
|
|
|
@ -28,7 +28,7 @@ export const draw = (text, id, version) => {
|
|||
log.debug('Renering info diagram\n' + text);
|
||||
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -25,7 +25,7 @@ export const draw = (txt, id) => {
|
|||
log.debug('Rendering info diagram\n' + txt);
|
||||
|
||||
const securityLevel = configApi.getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -324,7 +324,7 @@ export const draw = (text, id) => {
|
|||
parser.parse(text);
|
||||
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -587,7 +587,7 @@ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoop
|
|||
export const draw = function (text, id) {
|
||||
conf = configApi.getConfig().sequence;
|
||||
const securityLevel = configApi.getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -362,7 +362,7 @@ export const drawNote = (text, g) => {
|
|||
|
||||
/**
|
||||
* Starting point for drawing a state. The function finds out the specifics about the state and
|
||||
* renders with approprtiate function.
|
||||
* renders with appropriate function.
|
||||
*
|
||||
* @param {any} elem
|
||||
* @param {any} stateDef
|
||||
|
|
|
@ -107,8 +107,8 @@ describe('state diagram, ', function () {
|
|||
});
|
||||
it('handle "as" in state names 2', function () {
|
||||
const str = `stateDiagram-v2
|
||||
assembleas
|
||||
state assembleas
|
||||
assemblies
|
||||
state assemblies
|
||||
`;
|
||||
|
||||
parser.parse(str);
|
||||
|
@ -207,14 +207,14 @@ describe('state diagram, ', function () {
|
|||
|
||||
parser.parse(str);
|
||||
});
|
||||
it('should handle state deifintions with separation of id', function () {
|
||||
it('should handle state definitions with separation of id', function () {
|
||||
const str = `stateDiagram-v2\n
|
||||
state "Long state description" as state1
|
||||
`;
|
||||
|
||||
parser.parse(str);
|
||||
});
|
||||
it('should handle state deifintions with separation of id', function () {
|
||||
it('should handle state definitions with separation of id', function () {
|
||||
const str = `stateDiagram-v2
|
||||
state "Not Shooting State" as NotShooting {
|
||||
state "Idle mode" as Idle
|
||||
|
|
|
@ -122,8 +122,8 @@ describe('state diagram, ', function () {
|
|||
});
|
||||
it('handle "as" in state names 2', function () {
|
||||
const str = `stateDiagram
|
||||
assembleas
|
||||
state assembleas
|
||||
assemblies
|
||||
state assemblies
|
||||
`;
|
||||
|
||||
parser.parse(str);
|
||||
|
@ -222,14 +222,14 @@ describe('state diagram, ', function () {
|
|||
|
||||
parser.parse(str);
|
||||
});
|
||||
it('should handle state deifintions with separation of id', function () {
|
||||
it('should handle state defintions with separation of id', function () {
|
||||
const str = `stateDiagram\n
|
||||
state "Long state description" as state1
|
||||
`;
|
||||
|
||||
parser.parse(str);
|
||||
});
|
||||
it('should handle state deifintions with separation of id', function () {
|
||||
it('should handle state defintions with separation of id', function () {
|
||||
const str = `stateDiagram
|
||||
state "Not Shooting State" as NotShooting {
|
||||
state "Idle mode" as Idle
|
||||
|
|
|
@ -48,7 +48,7 @@ const insertMarkers = function (elem) {
|
|||
export const draw = function (text, id) {
|
||||
conf = getConfig().state;
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -56,7 +56,7 @@ export const draw = function (text, id) {
|
|||
parser.parse(text + '\n');
|
||||
|
||||
const securityLevel = getConfig().securityLevel;
|
||||
// Handle root and ocument for when rendering in sanbox mode
|
||||
// Handle root and Document for when rendering in sanbox mode
|
||||
let sandboxElement;
|
||||
if (securityLevel === 'sandbox') {
|
||||
sandboxElement = select('#i' + id);
|
||||
|
|
|
@ -90,7 +90,7 @@ const initThrowsErrors = function () {
|
|||
mermaidAPI.updateSiteConfig({ gantt: mermaid.ganttConfig });
|
||||
}
|
||||
|
||||
const idGeneratior = new utils.initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed);
|
||||
const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed);
|
||||
|
||||
let txt;
|
||||
|
||||
|
@ -105,7 +105,7 @@ const initThrowsErrors = function () {
|
|||
continue;
|
||||
}
|
||||
|
||||
const id = `mermaid-${idGeneratior.next()}`;
|
||||
const id = `mermaid-${idGenerator.next()}`;
|
||||
|
||||
// Fetch the graph definition including tags
|
||||
txt = element.innerHTML;
|
||||
|
@ -189,7 +189,7 @@ if (typeof document !== 'undefined') {
|
|||
}
|
||||
|
||||
/**
|
||||
* ## setParseErrorHandler Alternativet to directly setting parseError using:
|
||||
* ## setParseErrorHandler Alternative to directly setting parseError using:
|
||||
*
|
||||
* ```js
|
||||
* mermaid.parseError = function(err,hash){=
|
||||
|
|
|
@ -272,7 +272,7 @@ const render = function (id, _txt, cb, container) {
|
|||
// let d3Iframe;
|
||||
let root = select('body');
|
||||
|
||||
// In regular execurtion the container will be the div with a mermaid class
|
||||
// In regular execution the container will be the div with a mermaid class
|
||||
if (typeof container !== 'undefined') {
|
||||
if (cnf.securityLevel === 'sandbox') {
|
||||
// IF we are in sandboxed mode, we do everyting mermaid related
|
||||
|
@ -317,7 +317,7 @@ const render = function (id, _txt, cb, container) {
|
|||
} else {
|
||||
// No container was provided
|
||||
// If there is an existsing element with the id, we remove it
|
||||
// this likley a previously rendered diagram
|
||||
// this likely a previously rendered diagram
|
||||
const existingSvg = document.getElementById(id);
|
||||
if (existingSvg) {
|
||||
existingSvg.remove();
|
||||
|
@ -743,7 +743,7 @@ function initialize(options) {
|
|||
}
|
||||
}
|
||||
// Set default options
|
||||
configApi.saveConfigFromInitilize(options);
|
||||
configApi.saveConfigFromInitialize(options);
|
||||
|
||||
if (options && options.theme && theme[options.theme]) {
|
||||
// Todo merge with user options
|
||||
|
|
|
@ -5,7 +5,7 @@ class Theme {
|
|||
/** # Base variables */
|
||||
/**
|
||||
* - Background - used to know what the background color is of the diagram. This is used for
|
||||
* deducing colors for istance line color. Defaulr value is #f4f4f4.
|
||||
* deducing colors for instance line color. Default value is #f4f4f4.
|
||||
*/
|
||||
this.background = '#f4f4f4';
|
||||
this.darkMode = false;
|
||||
|
@ -21,7 +21,7 @@ class Theme {
|
|||
this.fontSize = '16px';
|
||||
}
|
||||
updateColors() {
|
||||
// The || is to make sure that if the variable has been defiend by a user override that value is to be used
|
||||
// The || is to make sure that if the variable has been defined by a user override that value is to be used
|
||||
|
||||
/* Main */
|
||||
this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor);
|
||||
|
@ -103,7 +103,7 @@ class Theme {
|
|||
/* state colors */
|
||||
this.transitionColor = this.transitionColor || this.lineColor;
|
||||
this.transitionLabelColor = this.transitionLabelColor || this.textColor;
|
||||
/* The color of the text tables of the tstates*/
|
||||
/* The color of the text tables of the states*/
|
||||
this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;
|
||||
|
||||
this.stateBkg = this.stateBkg || this.mainBkg;
|
||||
|
|
|
@ -945,7 +945,7 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth)
|
|||
// Ensure the viewBox includes the whole svgBounds area with extra space for padding
|
||||
const vBox = `0 0 ${width} ${height}`;
|
||||
log.debug(
|
||||
'Grpah.label',
|
||||
'Graph.label',
|
||||
graph._label,
|
||||
'swidth',
|
||||
sWidth,
|
||||
|
@ -966,7 +966,7 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth)
|
|||
svgElem.select('g').attr('transform', `translate(${tx}, ${ty})`);
|
||||
};
|
||||
|
||||
export const initIdGeneratior = class iterator {
|
||||
export const initIdGenerator = class iterator {
|
||||
constructor(deterministic, seed) {
|
||||
this.deterministic = deterministic;
|
||||
this.seed = seed;
|
||||
|
@ -1109,7 +1109,7 @@ export default {
|
|||
memoize,
|
||||
runFunc,
|
||||
entityDecode,
|
||||
initIdGeneratior,
|
||||
initIdGenerator: initIdGenerator,
|
||||
directiveSanitizer,
|
||||
sanitizeCss,
|
||||
};
|
||||
|
|
|
@ -302,7 +302,7 @@ describe('when calculating SVG size', function () {
|
|||
|
||||
describe('when initializing the id generator', function () {
|
||||
it('should return a random number generator based on Date', function (done) {
|
||||
const idGenerator = new utils.initIdGeneratior(false);
|
||||
const idGenerator = new utils.initIdGenerator(false);
|
||||
expect(typeof idGenerator.next).toEqual('function');
|
||||
const lastId = idGenerator.next();
|
||||
setTimeout(() => {
|
||||
|
@ -312,7 +312,7 @@ describe('when initializing the id generator', function () {
|
|||
});
|
||||
|
||||
it('should return a non random number generator', function () {
|
||||
const idGenerator = new utils.initIdGeneratior(true);
|
||||
const idGenerator = new utils.initIdGenerator(true);
|
||||
expect(typeof idGenerator.next).toEqual('function');
|
||||
const start = 0;
|
||||
const lastId = idGenerator.next();
|
||||
|
@ -321,7 +321,7 @@ describe('when initializing the id generator', function () {
|
|||
});
|
||||
|
||||
it('should return a non random number generator based on seed', function () {
|
||||
const idGenerator = new utils.initIdGeneratior(true, 'thisIsASeed');
|
||||
const idGenerator = new utils.initIdGenerator(true, 'thisIsASeed');
|
||||
expect(typeof idGenerator.next).toEqual('function');
|
||||
const start = 11;
|
||||
const lastId = idGenerator.next();
|
||||
|
|
Loading…
Reference in New Issue