This issue is similar to https://github.com/mapnik/node-mapnik/issues/679. However, the Mapnik `grid_renderer` supports variables. For a complete example of the problem, check https://gist.github.com/rochoa/6e3da02259ff61acddccd3a3a04d5bd4.