Forum Discussion
ConnectedRoman
9 years agoFrequent Visitor
Image leaves behind artifacts when resized
Hello, I have finally succeeded in creating a working custom visual. I have also successfully added an image to the visual: let image = this.svg.append("svg:image")
.attr('x', 15)...
- 9 years ago
That's because 'svg:image' is not a valid selector.
d3.selectAll('svg > image').remove();
v-chuncz-msft
9 years agoCommunity Support
Every time the custom visual is resized, it will call update method. So in your case, more and more new images are appended.
- ConnectedRoman9 years agoFrequent Visitor
Thank you for your answer - that's what I thought.
How should I got about fixing it?
Adding a
d3.selectAll('svg:image').remove();before the code where I add the picture only accomplishes that the image doesn't even show up in the visual. I also tried initializing image in the class scope but the image still doesn't show up that way.
- v-chuncz-msft9 years agoCommunity Support
That's because 'svg:image' is not a valid selector.
d3.selectAll('svg > image').remove();- ConnectedRoman9 years agoFrequent Visitor
That worked, thank you for bearing with my noobines.