@@ -181615,6 +181615,45 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
181615
181615
.attr('d', textGuidePath)
181616
181616
.attr('transform', sankeyInverseTransform);
181617
181617
181618
+
181619
+
181620
+ var nodeLabelImage = nodeCentered.selectAll('.' + 'node-label-image')
181621
+ .data(repeat);
181622
+
181623
+ nodeLabelImage.enter()
181624
+ .append('image')
181625
+ .classed('node-label-image', true)
181626
+ .attr('xlink:href', function(d) {
181627
+ var label = d.node.label;
181628
+
181629
+ var IMG_REGEX = /(.*)(<img src=[\"\'])([^\"\']+)(.*[\"\']\s*[^\/]*\/>)(.*)/i;
181630
+ var foundUrl = '';
181631
+
181632
+ label.replace(IMG_REGEX,
181633
+ function(match, textA, prefix, url, suffix, textB) {
181634
+ foundUrl = url;
181635
+ return url;
181636
+ }
181637
+ );
181638
+
181639
+ return foundUrl;
181640
+ })
181641
+ .attr('style', 'transform: translateY(-9px) translateX(0px)')
181642
+ // .attr('width', function(d) {
181643
+ // var label = d.node.label;
181644
+ // var IMG_WIDTH_REGEX = /(<img src=["][^"]+["]\s*width=\")(\d+)(\"[^\/]*\/>)/i;
181645
+ // var width = '';
181646
+ // label.replace(IMG_WIDTH_REGEX, function(match, imgTag, numberValue) {
181647
+ // width = numberValue;
181648
+ // return numberValue;
181649
+ // });
181650
+ // debugger;
181651
+ // return width;
181652
+ // })
181653
+ .attr('width', '16')
181654
+ .attr('height', '16');
181655
+
181656
+
181618
181657
var nodeLabel = nodeCentered.selectAll('.' + c.cn.nodeLabel)
181619
181658
.data(repeat);
181620
181659
@@ -181649,7 +181688,17 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
181649
181688
.style('fill', nodeTextColor);
181650
181689
181651
181690
nodeLabelTextPath
181652
- .text(function(d) {return d.horizontal || d.node.dy > 5 ? d.node.label : '';})
181691
+ .text(function(d) {
181692
+ var label = d.node.label;
181693
+ var IMG_REGEX = /(.*)(<img src=[\"\'])([^\"\']+)(.*[\"\']\s*[^\/]*\/>)(.*)/i;
181694
+ var imgTag = '';
181695
+ label = label.replace(IMG_REGEX,
181696
+ function(match, textA, prefix, url, suffix, textB) {
181697
+ return textA + textB;
181698
+ }
181699
+ );
181700
+ return d.horizontal || d.node.dy > 5 ? label : '';
181701
+ })
181653
181702
.attr('text-anchor', function(d) {return d.horizontal && d.left ? 'end' : 'start';});
181654
181703
181655
181704
nodeLabelTextPath
0 commit comments