mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 21:39:40 +02:00
#1295 Markers implmented, the gereric pattern and diagram specific for flowcharts.
This commit is contained in:
@@ -191,6 +191,7 @@ export const insertEdge = function(elem, edge, clusterDb) {
|
||||
.attr('id', edge.id)
|
||||
.attr('class', 'transition');
|
||||
|
||||
// DEBUG code, adds a red circle at each edge coordinate
|
||||
// edge.points.forEach(point => {
|
||||
// elem
|
||||
// .append('circle')
|
||||
@@ -212,13 +213,29 @@ export const insertEdge = function(elem, edge, clusterDb) {
|
||||
url = url.replace(/\(/g, '\\(');
|
||||
url = url.replace(/\)/g, '\\)');
|
||||
}
|
||||
logger.info('arrowType', edge.arrowType);
|
||||
switch (edge.arrowType) {
|
||||
case 'double_arrow_circle':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'circleEnd' + ')');
|
||||
svgPath.attr('marker-start', 'url(' + url + '#' + 'circleStart' + ')');
|
||||
case 'arrow_cross':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'crossEnd' + ')');
|
||||
break;
|
||||
case 'double_arrow_cross':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'crossEnd' + ')');
|
||||
svgPath.attr('marker-start', 'url(' + url + '#' + 'crossStart' + ')');
|
||||
break;
|
||||
case 'arrow_point':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'pointEnd' + ')');
|
||||
break;
|
||||
case 'double_arrow_point':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'pointEnd' + ')');
|
||||
svgPath.attr('marker-start', 'url(' + url + '#' + 'pointStart' + ')');
|
||||
break;
|
||||
case 'arrow_circle':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'circleEnd' + ')');
|
||||
break;
|
||||
case 'double_arrow_circle':
|
||||
svgPath.attr('marker-end', 'url(' + url + '#' + 'circleEnd' + ')');
|
||||
svgPath.attr('marker-start', 'url(' + url + '#' + 'circleStart' + ')');
|
||||
break;
|
||||
default:
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user