m |
|||
Line 306: | Line 306: | ||
} | } | ||
− | // set the dimensions and margins of the graph | + | // set the dimensions and margins of the graph |
− | var margin = {top: | + | var margin = { top: 30, right: 30, bottom: 70, left: 60 }, |
− | width = | + | width = 460 - margin.left - margin.right, |
− | height = | + | height = 400 - margin.top - margin.bottom; |
− | + | ||
− | + | ||
− | // append the svg object | + | // append the svg object to the body of the page |
− | var svg = d3.select("#my_dataviz") | + | var svg = d3 |
− | + | .select("#my_dataviz") | |
+ | .append("svg") | ||
.attr("width", width + margin.left + margin.right) | .attr("width", width + margin.left + margin.right) | ||
.attr("height", height + margin.top + margin.bottom) | .attr("height", height + margin.top + margin.bottom) | ||
− | + | .append("g") | |
− | .attr("transform", "translate(" | + | .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); |
− | d3.csv("https://static.igem.org/mediawiki/2020/9/9e/T--IISER-Tirupati_India--graph.csv", function(data) { | + | // Parse the Data |
+ | d3.csv( | ||
+ | "https://static.igem.org/mediawiki/2020/9/9e/T--IISER-Tirupati_India--graph.csv", | ||
+ | function (data) { | ||
+ | // X axis | ||
+ | var x = d3 | ||
+ | .scaleBand() | ||
+ | .range([0, width]) | ||
+ | .domain( | ||
+ | data.map(function (d) { | ||
+ | return d.Country; | ||
+ | }) | ||
+ | ) | ||
+ | .padding(0.2); | ||
+ | svg | ||
+ | .append("g") | ||
+ | .attr("transform", "translate(0," + height + ")") | ||
+ | .call(d3.axisBottom(x)) | ||
+ | .selectAll("text") | ||
+ | .attr("transform", "translate(-10,0)rotate(-45)") | ||
+ | .style("text-anchor", "end"); | ||
− | + | // Add Y axis | |
− | + | var y = d3.scaleLinear().domain([0, 10000000]).range([height, 0]); | |
− | + | svg.append("g").call(d3.axisLeft(y)); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | svg.append("text") | ||
+ | .attr("class", "y label") | ||
+ | .attr("text-anchor", "end") | ||
+ | .attr("y", 6) | ||
+ | .attr("dy", ".75em") | ||
+ | .attr("transform","rotate(-90)") | ||
+ | .text("Death per year"); | ||
+ | // Bars | ||
+ | svg | ||
+ | .selectAll("mybar") | ||
+ | .data(data) | ||
+ | .enter() | ||
+ | .append("rect") | ||
+ | .attr("id", function (d) { | ||
+ | return d.id; | ||
+ | }) | ||
+ | .attr("x", function (d) { | ||
+ | return x(d.Country); | ||
+ | }) | ||
+ | .attr("y", function (d) { | ||
+ | return y(d.Value); | ||
+ | }) | ||
+ | .attr("width", x.bandwidth()) | ||
+ | .attr("height", function (d) { | ||
+ | return height - y(d.Value); | ||
+ | }) | ||
+ | .attr("fill", "#69b3a2"); | ||
+ | } | ||
+ | ); | ||
</script> | </script> | ||
</div> | </div> |
Revision as of 20:55, 18 October 2020
Anti-Microbial Resistance
As the overuse of antibiotics in farming grows, pathogens are becoming more and more resistant to the same
According to a review by the UK government, Anti-Microbial Resistance is going to overtake cancer as a cause of death by the year 2050. Not to mention that AMR comes with its own host of side effects, such as worsening the covid situation. Click on the chart to see a higher quality version.
Read the reviewWho we are
A hodgepodge group of students from various backgrounds
We are the 2020 iGEM team from the Indian Institute of Science Education and Research (IISER), Tirupati. We are students from all the major science backgrounds led by Prof. BJ Rao and Dr. Raju Mukherjee. As each one brings their own quirks to the team dynamic, so do they bring their own talents.