anchor.diff:    // var toggleFlag = 0;
     toggleAsteroidView(0);
   
  +  // select the sorting column
  +  var asteroidSortingDimension = designation; 
  +
     <% if @filter_type=="hazard" %>
  -    // impact2.filterRange([0.00009, 1.0]);
  -    // window.filter([null,null,null,null]);
  +    asteroidSortingDimension = impact2;
       window.danger();
     <% elsif @filter_type=="size"  %>
  +    asteroidSortingDimension = size;
       window.filter([[3500,10000],null,null,null]);
     <% elsif @filter_type=="near"  %>
  -    // window.filter([null,[0,20], [0.0,0.7], null]);
  +    asteroidSortingDimension = close_date;
       window.flyby();
     <% elsif @filter_type=="easy"  %>
  +    asteroidSortingDimension = energy;
       window.filter([null, null, null, [0.0,4.2]]);
  +  <% else %>
  +    asteroidSortingDimension = designation;
  +    window.filter([null, null, null, null]);
     <% end %> 
  +
     
  -  // start with showing table list, hiding highchart
  -  // var toggleFlag = 0;
  -  // toggleAsteroidView(0);
  -
  -  // renderAll();
  -
     // Renders the specified chart or list.
     function render(method) {
       d3.select(this).call(method);
  
positive.code:     close_date.filterRange([date1, date2]);
      
      renderAll();
    }
  
    var axisFlag = 0;
  
negative.code:     var impactSeries = [];
  
      $(function(){
          // seems it remembers the dimension data being fetched already in earlier call.
          var sortedDataSet = null;
          if( asteroidSortingDimension === close_date || asteroidSortingDimension === energy) {
            // ascending
            sortedDataSet = asteroidSortingDimension.bottom(1); 
          } 
          else {
            // descending
            sortedDataSet = asteroidSortingDimension.top(1);
          }
  
          var asteroid = d3.select(this).selectAll(".asteroid")
            .data(sortedDataSet, function(d) { 
  
              var dateStr = d.close_app_date.split(' ');
              var date = Date.UTC(dateStr[0],dateStr[1],dateStr[2]);
  