I'm trying to build a simple example on Cloud 9 using node.js and D3, but having some issues rendering the chart.
I have a simple view in a chart.ejs file and have attempted to do an include of the d3.v3.js and d3.layout.js files. However, I keep getting Uncaught Syntax Error: Unexpected token < when the d3 include files are reached.
So a couple of questions:
<script> tag the appropriate way to use D3 with EJS rendering?Would appreciate any thoughts / comments?
Disclaimer: I'm relatively new to node.js and D3, so I may need some basic direction.
EDIT: here's the chart.ejs code. It has something to do with the script include. When I try to include locally like below, it throws the unexpected token error. But when I refer to the include from a download location, it seems to work. It may be a C9 thing, not sure though. Curious if someone else has run across this in C9:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Page Template</title>
<script type="text/javascript" src="d3.v3.js"></script>
</head>
<body>
<script type="text/javascript">
// Your beautiful D3 code will go here
</script>
</body>
</html>