I think this is an even more relevant example than the simple div
bar chart from earlier today (see gist). Instead of R
using V8
+ rjade
with Javascript jade
and d3.js
, we'll use paths.js
. paths.js
provides nice APIs for working with SVG
, and fortunately for us, also works cleanly with V8
. We might as well use rjade
while we are at it and see how we can define style attributes and the d
attribute for a SVG path.
paths.js
Wiki
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8"/>
</head>
<body style="background-color:white;">
<svg version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" width="400px" height="400px" viewBox="0 0 10 10">
<path style="fill:red" d="M 1 3 L 2 5 L 3 4 L 2 0 Z "></path>
</svg>
</body>
</html>