When the user clicks on an svg element it should trigger a method which is defined in the vue method section but that's not working. It's throwing me the error: "Uncaught TypeError: this.renderData is not a function at SVGForeignObjectElement.eval"
My code:
renderData(data){
//some other code
svg.selectAll('.delete-icon')
.on('click', function ({id}) {
links = removeLinksRelations(links, id);
nodes = nodes.filter(node => id !== node.id);
**this.renderData({ links, nodes });** // <--- THIS DOESN'T WORK
}}```