In case of an d3.attrTween
, I can retrieve the target value as this
How can I do the same for d3.tween()
, I tried the same and it did not work.
Thank you in advance
@Fil
In case of an d3.attrTween
, I can retrieve the target value as this
How can I do the same for d3.tween()
, I tried the same and it did not work.
Thank you in advance
@Fil
I’m not sure I understand the question fully, but maybe this will help:
.tween("_", function () {
return function (t) {
const r = d3.interpolateNumber(200, 0)(t);
circ.attr("r", r);
return r;
};
})
I am extremely sorry and apologize for not properly explaining the question.
When I am building a transition by changing the value of a particular attribute (r
in this case) to a target value (0 in this case from 200 to 0), I desire for this target value to be retrieved through a callback to be utilized in another one.
If I use d3.attrTween
I can do that as showed here. I am asking how can I do the same in case of d3.tween
?
Thanks. Then please try the suggestion above
Thanks, one follow-up question to this, Is it also possible for a d3 callback to return the attribute that has been targeted in transition?