|
|
|
|
@ -22,6 +22,22 @@ d3.selectAll('svg').on('click', function(datum){
|
|
|
|
|
console.log(worldProjection.invert(d3.mouse(this)));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var dragBehavior = d3.drag() //create a drag behavior
|
|
|
|
|
.on('start', function(){
|
|
|
|
|
d3.select('table tr:nth-child(2) td:first-child')
|
|
|
|
|
.html(worldProjection.invert(d3.mouse(this))[0])
|
|
|
|
|
d3.select('table tr:nth-child(2) td:last-child')
|
|
|
|
|
.html(worldProjection.invert(d3.mouse(this))[1])
|
|
|
|
|
})
|
|
|
|
|
.on('drag', function(){
|
|
|
|
|
d3.select('table tr:nth-child(3) td:first-child')
|
|
|
|
|
.html(worldProjection.invert(d3.mouse(this))[0])
|
|
|
|
|
d3.select('table tr:nth-child(3) td:last-child')
|
|
|
|
|
.html(worldProjection.invert(d3.mouse(this))[1])
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
d3.select('svg').call(dragBehavior);
|
|
|
|
|
|
|
|
|
|
d3.select('form').on('submit', function(){
|
|
|
|
|
d3.event.preventDefault();
|
|
|
|
|
|
|
|
|
|
|