Published
Edited
May 14, 2019
Insert cell
md`# ied-> Lecture 3`
Insert cell
md `copy and paste the code betwen the / * * / your `
Insert cell
/*
function autorun()
{

console.log("run run run run")

d3.csv("https://gist.githubusercontent.com/serman/f6a0b09269dad9130f4538b05becb124/raw/7468c8f047258f7edba1913bcef21e763d8d61d3/gistfile1.txt")
.then(function(result){
characters=result
drawCircles();
})

}



function drawCircles(){
updated_elements = d3.select("svg")
.selectAll("circle")
.data(characters)

new_elements=updated_elements.enter()
.append("circle")
.attr('r',function(d,i){ return d.appeared/4})
.attr('cy', function(d,i){ return 50})
.attr('cx',function(d,i){ return 40+i*40})

allElements=updated_elements.merge(new_elements)

}


if (window.addEventListener) window.addEventListener("load", autorun, false);
else if (window.attachEvent) window.attachEvent("onload", autorun);
else window.onload = autorun;
*/
Insert cell
/*
function preprocess() {
var n_characters= characters.length;
var separation_degrees = (2*Math.PI)/characters.length;
var distance = 200;
var offset=distance+40
for(i=0; i<characters.length; i++){
characters[i].result;
characters[i].yposition = Math.sin(i*separation_degrees)* distance+offset;
characters[i].xposition = Math.cos(i*separation_degrees)* distance+offset;
}

}
*/
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more