D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
asminja
Full window
Github gist
chip seq thing
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <!--<img src = "https://imagizer.imageshack.us/a/img923/9457/c5n0ve.png"> --> <script> var svg = d3.select("body").append("svg") .attr("width", 7000) .attr("height", 5000) d3.csv("spacingchip.csv", function(err, data) { var g = d3.select("svg").selectAll("g") .data(data) .enter() .append("g") g.append("rect") .attr("transform", function(d) { { return "translate(0,"+-(d.Interval_length)+")"; } }) .attr("x", function(d) { if (d.Chromosome == 1) return 200; else return 300 }) .attr("y", function(d) { if (d.Chromosome == 1) return 500; else return 200 }) .attr("width", 100) .attr("height", function(d) {return d.Interval_length/10} ) .attr("fill", function(d) { if (d.Chromosome == 1) return "green"; else return "black"}) }) </script> </body>
https://d3js.org/d3.v4.min.js