js/tsne_vis.js
//First function that runs on a brush move
First function that runs on a brush move
First function that runs on a brush move
function brushmove() {
  var extent = brush.extent();
   var originalRange = main_yZoom.range();
   main_yZoom.domain( extent );
  main_yScale.domain(correlationResultsFinal.map(function(d) { return d[0]; }));
  main_yScale.rangeBands( [ main_yZoom(originalRange[0]), main_yZoom(originalRange[1]) ], 0.4, 0);
  d3v3.select(".mainGroup")
    .select(".y.axis")
    .select("textLength","10")
    .call(main_yAxis);
  var selected = mini_yScale.domain()
    .filter(function(d) { return (extent[0] - mini_yScale.rangeBand () + 1e-2 <= mini_yScale(d)) && (mini_yScale(d) <= extent[1] - 1e-2); }); 
 d3.select(".miniGroup").selectAll(".bar")
    .style("fill", function(d, i) { return selected.indexOf(d[0]) > -1 ? "url(#gradient-mini)" : "#e0e0e0"; });
  d3v3.selectAll(".y.axis text")
    .style("font-size", textScale(selected.length));
  updateBarChart();
}
function brushmove ( ) { var extent = brush . extent ( ) ; var originalRange = main_yZoom . range ( ) ; main_yZoom . domain ( extent ) ; main_yScale . domain ( correlationResultsFinal . map ( function ( d ) { return d [ 0 ] ; } ) ) ; main_yScale . rangeBands ( [ main_yZoom ( originalRange [ 0 ] ) , main_yZoom ( originalRange [ 1 ] ) ] , 0.4 , 0 ) ; d3v3 . select ( ".mainGroup" ) . select ( ".y.axis" ) . select ( "textLength" , "10" ) . call ( main_yAxis ) ; var selected = mini_yScale . domain ( ) . filter ( function ( d ) { return ( extent [ 0 ] - mini_yScale . rangeBand ( ) + 1e-2 <= mini_yScale ( d ) ) && ( mini_yScale ( d ) <= extent [ 1 ] - 1e-2 ) ; } ) ; d3 . select ( ".miniGroup" ) . selectAll ( ".bar" ) . style ( "fill" , function ( d , i ) { return selected . indexOf ( d [ 0 ] ) > - 1 ? "url(#gradient-mini)" : "#e0e0e0" ; } ) ; d3v3 . selectAll ( ".y.axis text" ) . style ( "font-size" , textScale ( selected . length ) ) ; updateBarChart ( ) ; }
First function that runs on a brush move
First function that runs on a brush move
//Reset the part that is visible on the big chart //Update the domain of the x & y scale of the big bar chart //Update the y axis of the big chart //Which bars are still "selected" //Update the colors of the mini chart - Make everything outside the brush grey //Update the label size //Update the big bar chart //brushmove