mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Adding cloud and bang shapes
This commit is contained in:
@@ -78,6 +78,26 @@ const rectBkg = function (elem, node, section, conf) {
|
||||
.attr('height', node.height)
|
||||
.attr('width', node.width);
|
||||
};
|
||||
const cloudBkg = function (elem, node, section, conf) {
|
||||
const r = elem
|
||||
.append('rect')
|
||||
.attr('id', 'node-' + node.id)
|
||||
.attr('class', 'node-bkg node-' + db.type2Str(node.type))
|
||||
.attr('height', node.height)
|
||||
.attr('rx', node.padding)
|
||||
.attr('ry', node.padding)
|
||||
.attr('width', node.width);
|
||||
};
|
||||
const bangBkg = function (elem, node, section, conf) {
|
||||
const r = elem
|
||||
.append('rect')
|
||||
.attr('id', 'node-' + node.id)
|
||||
.attr('class', 'node-bkg node-' + db.type2Str(node.type))
|
||||
.attr('height', node.height)
|
||||
.attr('rx', node.padding)
|
||||
.attr('ry', node.padding)
|
||||
.attr('width', node.width);
|
||||
};
|
||||
const circleBkg = function (elem, node, section, conf) {
|
||||
const r = elem
|
||||
.append('circle')
|
||||
@@ -194,6 +214,14 @@ export const drawNode = function (elem, node, section, conf) {
|
||||
bkgElem.attr('transform', 'translate(' + node.width / 2 + ', ' + +node.height / 2 + ')');
|
||||
circleBkg(bkgElem, node, section, conf);
|
||||
break;
|
||||
case db.nodeType.CLOUD:
|
||||
// bkgElem.attr('transform', 'translate(' + node.width / 2 + ', ' + +node.height / 2 + ')');
|
||||
cloudBkg(bkgElem, node, section, conf);
|
||||
break;
|
||||
case db.nodeType.BANG:
|
||||
// bkgElem.attr('transform', 'translate(' + node.width / 2 + ', ' + +node.height / 2 + ')');
|
||||
bangBkg(bkgElem, node, section, conf);
|
||||
break;
|
||||
default:
|
||||
// defaultBkg(bkgElem, node, section, conf);
|
||||
}
|
||||
|
Reference in New Issue
Block a user