D3 overwrites the 'this' variable, allowing you to see the current selection while in different methods.
I also need 'this' to access class member properties in typescript. I'm currently unsure of how I can retain both whenever I need them.
tweenArc(datum: any, index: number, attr: string) {
console.log(this);
console.log(this.classVariable);
...
}
The first console.log will write out the d3 selection, which in this case is an svg element.
If I'm trying to access member properties from the class the function is defined in however, I cannot. That console.log returns undefined.