I am encountering an issue when trying to access the "_groups" property in my code:
function getMouseDate(scale){
var groupElement = d3.select("#group")._groups[0][0]
var xCoordinate = scale.invert(d3.mouse(groupElement)[0]);
console.log(xCoordinate);
}
When I check the console log, I see the following result:
Selection {_groups: Array(1), _parents: Array(1)}
_groups: Array(1)
0: Array(1)
0: g#group
However, compiling the code gives me this error message:
D:/Documents/starter-propre-angular4/src/app/pages/graphe-page/graphe.page.ts (782,32): Property '_groups' does not exist on type 'Selection<BaseType, {}, HTMLElement, any>'.
Therefore, my question is: How can I access the information in "_groups" consistently while working with TypeScript and d3js?