try to generalize d3-grid to work with rCharts