I created a single-page app containing d3 chart (area chart + scatter chart combo). The area chart is static (but should react on window resize events) that serves as a background for the scatter chart that is updated whenever the mongo collection changes. So far, i made the scatter plot react using the following structure.
Template.chart.onRendered( function() {
var height = window.innerHeight;
var width = window.innerWeight;
// d3 stuff to create area chart
Deps.autorun(function(){
// d3 stuff to update scatter chart
}
}
I know that the onRendered is only called once, but is possible to force re-rendering on window resize event? Or, how do I restructure this app such that the chart rerenders itself on window resize event but minimize the redrawing of the background chart?