Created
November 17, 2015 13:47
-
-
Save fchevitarese/ce0b5d944e4ba8070197 to your computer and use it in GitHub Desktop.
pandas.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<title>Test D3js</title> | |
<head> | |
<script src="{{ STATIC_URL}}datagoal/node_modules/d3/d3.min.js" charset="utf-8"></script> | |
<script> | |
define(['d3', 'wq/pandas'], function(d3, pandas) { | |
pandas.get('/static/datagoal/node_modules/df1.csv', render); | |
function render(error, data) { | |
d3.select('svg') | |
.selectAll('rect') | |
.data(data) | |
} | |
}); | |
// d3.csv("/static/datagoal/node_modules/df1.csv", function(data){ | |
// console.log(data); | |
// var canvas = d3.select("body").append("svg") | |
// .attr("width", "100%") | |
// .attr("height", "100%") | |
// | |
// canvas.selectAll("rect") | |
// .data(data) | |
// .enter() | |
// .append("rect") | |
// .attr("width", function(d) { return d.duration ; }) | |
// .attr("height", 48) | |
// .attr("y", function(d, i) { return i * 50; }) | |
// .attr("fill", "blue"); | |
// | |
// canvas.selectAll("text") | |
// .data(data) | |
// .enter() | |
// .append("text") | |
// .attr("fill", "white") | |
// .attr("y", function(d, i) { return i * 50 + 24; }) | |
// .text(function(d) { return d.duration ; }); | |
// }); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment