block by nitaku 0e36dcc66487cd0997c1

R template

A base template for WebVis gists supporting R plots in SVG. The R script produces a random bar chart, logs the generated data (echoed to the JavaScript console) and writes the plot to an SVG device.

Thanks to d3.js, the produced SVG is loaded into the DOM, rather than included as an external image. This allows both scripting and styling (demonstrated by the use of CSS to render the bars with crisp edges).

index.css

index.php

main.R