I am attempting to update the provided example to be compatible with d3 version 4 http://bl.ocks.org/ameyms/9184728
Most of the code has been successfully converted, but I am encountering difficulties with the following function:
this.el.transition().delay(100).duration(200).select('.needle').tween('reset-progress', function() {
return function(percentOfPercent) {
var progress = (1 - percentOfPercent) * oldValue;
repaintGauge(progress);
return d3.select(this).attr('d', recalcPointerPos.call(self, progress));
};
});
The error message I am seeing is
this.setAttribute is not a function
on the line that contains the return statement. It has been confirmed that recalcPointerPos
is functioning properly, which leads me to believe that the issue lies in the syntax of d3.select(this).attr. Is there a difference in how this type of selection is handled between versions 3 and 4 of d3?
View the fiddle here: https://jsfiddle.net/v1tok1k6/