function initializeControls(){
// Set up a controls box that can be style with css with .controls{}
  $('#world-container').after('<div class="controls"><h5>Controls</h5></div>');
  $('.controls').append('<div><h6>Categories Full Height:</h6><a class="cat_full_height_on">On</a><a class="cat_full_height_off">Off</a></div>')
  $('.controls').append('<div><h6>Normalize by Total Percentage Share ("what is the % of each category?"):</h6><a class="norm_tv_on">On</a><a class="norm_tv_off">Off</a></div>')
  // $('.controls').append('<div><h6>Normalize by Category Size: ("what year made the biggest impact to a given category?")</h6><a class="norm_cs_on">On</a><a class="norm_cs_off">Off</a></div>')

// Set the initial state of our on/off switches
  $('.norm_tv_off').addClass('active');
  $('.norm_cs_off').addClass('active');
  $('.cat_full_height_off').addClass('active');

// Category heights
  $(document).on('click', '.cat_full_height_on', function(){
    $('.statsblock').css({'height':'100%'});
    $('.cat_full_height_on').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.cat_full_height_off', function(){
    $('.statsblock').css({'height':'3px'});
    $('.cat_full_height_off').addClass('active').siblings().removeClass('active');
  })

// Normalized Annual Volume
  $(document).on('click', '.norm_tv_on', function(){
    $('.bar').css({'width':'100%'});
    $('.norm_tv_on').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.norm_tv_off', function(){
    relativeBarWidths();
    $('.norm_tv_off').addClass('active').siblings().removeClass('active');
  })

// Normalized Category Size
  $(document).on('click', '.norm_cs_on', function(){
    normalizeCategories();
    $('.norm_cs_on').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.norm_cs_off', function(){
    setCategoryWidths();
    $('.norm_cs_off').addClass('active').siblings().removeClass('active');
  })
}
/*=======================================================
STEP 2: User Interface Controls
=======================================================*/
STEP 2: User Interface Controls
STEP 2 : User Interface Controls
function initializeControls(){
  $('#world-container').after('<div class="controls"><h5>Controls</h5></div>');
  $('.controls').append('<div><h6>Categories Full Height:</h6><a class="cat_full_height_on">On</a><a class="cat_full_height_off">Off</a></div>')
  $('.controls').append('<div><h6>Normalize by Total Percentage Share ("what is the % of each category?"):</h6><a class="norm_tv_on">On</a><a class="norm_tv_off">Off</a></div>')
  $('.norm_tv_off').addClass('active');
  $('.norm_cs_off').addClass('active');
  $('.cat_full_height_off').addClass('active');
  $(document).on('click', '.cat_full_height_on', function(){
    $('.statsblock').css({'height':'100%'});
    $('.cat_full_height_on').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.cat_full_height_off', function(){
    $('.statsblock').css({'height':'3px'});
    $('.cat_full_height_off').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.norm_tv_on', function(){
    $('.bar').css({'width':'100%'});
    $('.norm_tv_on').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.norm_tv_off', function(){
    relativeBarWidths();
    $('.norm_tv_off').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.norm_cs_on', function(){
    normalizeCategories();
    $('.norm_cs_on').addClass('active').siblings().removeClass('active');
  })
  $(document).on('click', '.norm_cs_off', function(){
    setCategoryWidths();
    $('.norm_cs_off').addClass('active').siblings().removeClass('active');
  })
}
function initializeControls ( ) { $ ( '#world-container' ) . after ( '<div class="controls"><h5>Controls</h5></div>' ) ; $ ( '.controls' ) . append ( '<div><h6>Categories Full Height:</h6><a class="cat_full_height_on">On</a><a class="cat_full_height_off">Off</a></div>' ) $ ( '.controls' ) . append ( '<div><h6>Normalize by Total Percentage Share ("what is the % of each category?"):</h6><a class="norm_tv_on">On</a><a class="norm_tv_off">Off</a></div>' ) $ ( '.norm_tv_off' ) . addClass ( 'active' ) ; $ ( '.norm_cs_off' ) . addClass ( 'active' ) ; $ ( '.cat_full_height_off' ) . addClass ( 'active' ) ; $ ( document ) . on ( 'click' , '.cat_full_height_on' , function ( ) { $ ( '.statsblock' ) . css ( { 'height' : '100%' } ) ; $ ( '.cat_full_height_on' ) . addClass ( 'active' ) . siblings ( ) . removeClass ( 'active' ) ; } ) $ ( document ) . on ( 'click' , '.cat_full_height_off' , function ( ) { $ ( '.statsblock' ) . css ( { 'height' : '3px' } ) ; $ ( '.cat_full_height_off' ) . addClass ( 'active' ) . siblings ( ) . removeClass ( 'active' ) ; } ) $ ( document ) . on ( 'click' , '.norm_tv_on' , function ( ) { $ ( '.bar' ) . css ( { 'width' : '100%' } ) ; $ ( '.norm_tv_on' ) . addClass ( 'active' ) . siblings ( ) . removeClass ( 'active' ) ; } ) $ ( document ) . on ( 'click' , '.norm_tv_off' , function ( ) { relativeBarWidths ( ) ; $ ( '.norm_tv_off' ) . addClass ( 'active' ) . siblings ( ) . removeClass ( 'active' ) ; } ) $ ( document ) . on ( 'click' , '.norm_cs_on' , function ( ) { normalizeCategories ( ) ; $ ( '.norm_cs_on' ) . addClass ( 'active' ) . siblings ( ) . removeClass ( 'active' ) ; } ) $ ( document ) . on ( 'click' , '.norm_cs_off' , function ( ) { setCategoryWidths ( ) ; $ ( '.norm_cs_off' ) . addClass ( 'active' ) . siblings ( ) . removeClass ( 'active' ) ; } ) }
STEP 2: User Interface Controls
STEP 2 : User Interface Controls
// Set up a controls box that can be style with css with .controls{} // $('.controls').append('<div><h6>Normalize by Category Size: ("what year made the biggest impact to a given category?")</h6><a class="norm_cs_on">On</a><a class="norm_cs_off">Off</a></div>') // Set the initial state of our on/off switches // Category heights // Normalized Annual Volume // Normalized Category Size