User:Themsen/Protclass7: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "words.html <meta charset="utf-8" /> <script src="d3.min.js"></script> <body> <div id="content"></div> </body> <script> d3.json("words2.json", function (data) { c...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
words.html
words.html
<meta charset="utf-8" />
 
<script src="d3.min.js"></script>
<code>
<body>
<meta charset="utf-8" />
<script src="d3.min.js"></script>
<div id="content"></div>
<body>
 
</body>
<div id="content"></div>
<script>
 
</body>
d3.json("words2.json", function (data) {
<script>
 
d3.json("words2.json", function (data) {
console.log("loaded", data);
console.log("loaded", data);
d3.select("#content")
d3.select("#content")
Line 23: Line 25:
})
})


})
})


</script>
</script>
</code>

Latest revision as of 20:20, 28 April 2015

words.html

<meta charset="utf-8" /> <script src="d3.min.js"></script> <body>

</body> <script>

d3.json("words2.json", function (data) { console.log("loaded", data); d3.select("#content") .selectAll("span") .data(data) .enter() .append("span") .text(function(d) { return d.word + " " }) .style("font-size", function(d) { return d.count })

})

</script>