I use meteor, iron-router, and d3. d3 is used to reactively display a pie chart based on the data, which I calculate in the data function of iron-router. So, I want to the d
You should use the onRendered callback with a template autorun. Out of the box that doesn't work with 1.0
, however there's a trick - you can get the autorun to rerun after a context change by using Template.currentData like this:
Template.myPictures.onRendered(function () {
this.autorun(function () {
var data = Template.currentData();
// use data with d3 here
});
});
For more details, see the end of this issue.