#1078 Using the configuration of the arrowMarkerAbsolute

This commit is contained in:
Knut Sveidqvist
2019-11-20 19:06:46 +01:00
parent 3f8f9f6711
commit f6028b63b6
4 changed files with 113 additions and 7 deletions

View File

@@ -598,10 +598,11 @@ const render = function(id, txt, cb, container) {
}
// Fix for when the base tag is used
let svgCode = d3
.select('#d' + id)
.node()
.innerHTML.replace(/url\(#arrowhead/g, 'url(' + url + '#arrowhead', 'g');
let svgCode = d3.select('#d' + id).node().innerHTML;
if (!config.arrowMarkerAbsolute || config.arrowMarkerAbsolute === 'false') {
svgCode = svgCode.replace(/marker-end=\"url\(.*?#/g, 'marker-end="url(#', 'g');
}
svgCode = decodeEntities(svgCode);