mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 19:24:10 +01: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('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : ''))
|
||||||
.attr('style', edge.style);
|
.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
|
// DEBUG code, adds a red circle at each edge coordinate
|
||||||
// cornerPoints.forEach((point) => {
|
// cornerPoints.forEach((point) => {
|
||||||
// elem
|
// elem
|
||||||
|
|||||||
@@ -57,9 +57,6 @@ export const insertNode = async (elem, node, dir) => {
|
|||||||
let newEl;
|
let newEl;
|
||||||
let el;
|
let el;
|
||||||
|
|
||||||
if (node) {
|
|
||||||
console.log('BLA: rect node', JSON.stringify(node));
|
|
||||||
}
|
|
||||||
//special check for rect shape (with or without rounded corners)
|
//special check for rect shape (with or without rounded corners)
|
||||||
if (node.shape === 'rect') {
|
if (node.shape === 'rect') {
|
||||||
if (node.rx && node.ry) {
|
if (node.rx && node.ry) {
|
||||||
@@ -83,6 +80,10 @@ export const insertNode = async (elem, node, dir) => {
|
|||||||
el = await shapes[node.shape](elem, node, dir);
|
el = await shapes[node.shape](elem, node, dir);
|
||||||
newEl = el;
|
newEl = el;
|
||||||
}
|
}
|
||||||
|
// MC Special
|
||||||
|
newEl.attr('data-id', node.id);
|
||||||
|
newEl.attr('data-node', true);
|
||||||
|
newEl.attr('data-et', 'node');
|
||||||
if (node.tooltip) {
|
if (node.tooltip) {
|
||||||
el.attr('title', node.tooltip);
|
el.attr('title', node.tooltip);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user