updated with R to json function and d3 example