mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 04:49:44 +02:00
Decorating edges and nodes
This commit is contained in:
@@ -622,6 +622,11 @@ export const insertEdge = function (elem, edge, clusterDb, diagramType, graph, i
|
||||
.attr('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : ''))
|
||||
.attr('style', edge.style);
|
||||
}
|
||||
|
||||
// MC Special
|
||||
svgPath.attr('data-edge', true);
|
||||
svgPath.attr('data-et', 'edge');
|
||||
svgPath.attr('data-id', edge.id);
|
||||
// DEBUG code, adds a red circle at each edge coordinate
|
||||
// cornerPoints.forEach((point) => {
|
||||
// elem
|
||||
|
@@ -57,9 +57,6 @@ export const insertNode = async (elem, node, dir) => {
|
||||
let newEl;
|
||||
let el;
|
||||
|
||||
if (node) {
|
||||
console.log('BLA: rect node', JSON.stringify(node));
|
||||
}
|
||||
//special check for rect shape (with or without rounded corners)
|
||||
if (node.shape === 'rect') {
|
||||
if (node.rx && node.ry) {
|
||||
@@ -83,6 +80,10 @@ export const insertNode = async (elem, node, dir) => {
|
||||
el = await shapes[node.shape](elem, node, dir);
|
||||
newEl = el;
|
||||
}
|
||||
// MC Special
|
||||
newEl.attr('data-id', node.id);
|
||||
newEl.attr('data-node', true);
|
||||
newEl.attr('data-et', 'node');
|
||||
if (node.tooltip) {
|
||||
el.attr('title', node.tooltip);
|
||||
}
|
||||
|
Reference in New Issue
Block a user