varyAxis=d3.axisLeft(yScale);//create axis, not yet applied
returnelement.distance;
d3.select('svg').append('g').attr('id','x-axis').attr('transform','translate(0,'+HEIGHT+')').call(xAxis);//apply xAxis, also, x axis must be moved to bottom of svg
});
d3.select('svg').append('g').attr('id','y-axis').call(yAxis);//y axis is good as it is, apply it
vardateDomain=d3.extent(data,function(element){
returnnewDate(element.date);
//callback for zooming
});
varzoomCallback=function(){
lastTransform=d3.event.transform;//save the transform for later inversion with clicks
d3.select('svg').call(zoom);//apply zoom behavior to svg
//create axes
varxAxis=d3.axisBottom(xScale);//create axis, not yet applied
varyAxis=d3.axisLeft(yScale);//create axis, not yet applied
d3.select('svg').append('g').attr('id','x-axis').attr('transform','translate(0,'+HEIGHT+')').call(xAxis);//apply xAxis, also, x axis must be moved to bottom of svg
d3.select('svg').append('g').attr('id','y-axis').call(yAxis);//y axis is good as it is, apply it
//callback for zooming
varzoomCallback=function(){
lastTransform=d3.event.transform;//save the transform for later inversion with clicks
d3.select('#points').attr("transform",d3.event.transform);//apply transform to g element containing circles