function y_selector()

in src/chart.js [1427:1493]


      function y_selector() {

        d3.event.preventDefault();
        touching = true;

        d3.select('.y_indicator').select('.indicator_text')
        .transition()
        .duration(100)
        .ease(d3.easeCubic)
        .style('fill','#fff')
        .transition()
        .duration(250)
        .ease(d3.easeCubic)
        .style('fill','gold');

        d3.select('#y_picker').remove();
        d3.select('#x_picker').remove();

        var param_list = [
          "Population",
          "Arable Area",
          "Energy Consumption",
          "GDP Per Capita",
          "Life Expectancy (Women)",
          "Life Expectancy (Men)",
          "Life Expectancy",
          "Infant Mortality",
          "Number of Personal Computers",
          "G Index",
          "E Index",
          "P Index"
        ];

        hideCarousel();

        d3.select('#sandbox_div').append("select")
        .attr('id','y_picker')
        .style('position','absolute')
        .style('top',((svg_dim * 0.5) - 20) + 'px')
        .style('left',(svg_dim * 0.1) + 'px')
        .style('width',(svg_dim * 0.8) + 'px')
        .attr('class','menu_select_enabled')  
        .on('change', function() {
          if (globals.param_x == d3.select(this).property('value')){
            d3.select(this).property('value', globals.param_y);
            alert('y != x');
          }
          else {
            touching = false;
            globals.param_y = d3.select(this).property('value');
            chart_instance.params().y = d3.select(this).property('value');
            d3.select(this).remove();
            chart_g.call(chart_instance);             
            hideAddressBar();
          }
        })
        .selectAll('option')
        .data(param_list)
        .enter()
        .append('option')
        .attr("value", function (d) { return d; })
        .text(function (d) { return 'y: ' + d; })
        .property("selected", function (d) {
          return d === globals.param_y;
        });

      }