I'm trying to replicate this visualization here http://redotheweb.com/CodeFlower/ using my own json data. However the visualization is not showing up and I suspect it's because I have misplaced this block of code
var myFlower = new CodeFlower("#visualization", 300, 200);
myflower.update(jsonData);
which updates the visualization based on the content in the jsonData file. The full code is as follows:
<html>
<head> </head>
<body>
<div class = "content">
<div class = "container">
<p class = "lead"> </p>
<div id = "visualization">
<svg width = "270" height = "270">
var myFlower = new CodeFlower("#visualization", 300, 200);
myflower.update(jsonData);
</svg>
</div>
</div>
</div>
<script type = "text/java
<script type="text/javascript" src="javascripts/d3/d3.js"></script>
<script type="text/javascript" src="javascripts/d3/d3.geom.js"></script>
<script type="text/javascript" src="javascripts/d3/d3.layout.js"></script>
<script type="text/javascript" src="javascripts/CodeFlower.js"></script>
<script type="text/javascript" src="javascripts/dataConverter.js"></script>
<script type="text/javascript"> </script>
</body>
Please help. Thank you.
<svg>tag. Place it in a<script>tag instead.<script var myFlower = new CodeFlower("#visualization", 300, 200); myflower.update(jsonData); </script>>. It should be<script> //code here</script>