'use strict'; var BuoyAnalysisBehaviors = { stationClick: function() { }, stationMouseover: function() { }, reticleDrag: function(d) { }, reticleDragEnd: function() { var x = d3.mouse(this)[0]; var y = d3.mouse(this)[1]; if (x < 200) { x = 200; } if (x > 800) { x = 800; } var d = d3.select('.reticle').data()[0]; d.x = x; d.y = y; d3.select('.reticle') .transition() .duration(300) .attr('transform', 'translate(' + [ d.x, d.y ] + ')') BuoyAnalysisMap.findStationsUnderReticle(); BuoyAnalysisChart.draw(); }, reticleResize: function() { }, attachBehaviors: function() { d3.select('#map') .on('click', BuoyAnalysisBehaviors.reticleDragEnd) // .call(d3.behavior.drag() // .on('drag', BuoyAnalysisBehaviors.reticleDrag) // .on('dragend', BuoyAnalysisBehaviors.reticleDragEnd) // ); }, }; // d3.selectAll('.detail') // .on('mouseover', startAnimateStation) // .on('mouseout', stopAnimateStation); // function startAnimateStation() { // var id = d3.event.target.id || d3.event.target.parentNode.id; // var selector = '#' + id.split('-')[1]; // d3.select(selector) // .transition() // .attr('r', '10') // .duration(200) // }; // function stopAnimateStation() { // var id = d3.event.target.id || d3.event.target.parentNode.id; // var selector = '#' + id.split('-')[1]; // d3.select(selector) // .transition() // .attr('r', '3') // .duration(200) // }; // /** // * // */ // function startAnimateDetail() { // var id = d3.event.target.id; // d3.select('#detail-' + id) // .classed('active', true) // } // /** // * // */ // function stopAnimateDetail() { // var id = d3.event.target.id; // d3.select('#detail-' + id) // .classed('active', false) // }