app.js
// Initializes the page with a default plot
Initializes the page with a default plot
Initializes the page with a default plot
function init() {
  let dropdownMenu = d3.select("#selDataset");
  d3.json("samples2.json").then(data => {
      data.names.forEach(function(name) {
        dropdownMenu.append("option").text(name).property("value");
      });
      updateBarPlot(data.names[0]);
      updateBubblesPlot(data.names[0]);
      updateMetaData(data.names[0]);
      updateGaugePlot(data.names[0]);
  });
}
function init ( ) { let dropdownMenu = d3 . select ( "#selDataset" ) ; d3 . json ( "samples2.json" ) . then ( data => { data . names . forEach ( function ( name ) { dropdownMenu . append ( "option" ) . text ( name ) . property ( "value" ) ; } ) ; updateBarPlot ( data . names [ 0 ] ) ; updateBubblesPlot ( data . names [ 0 ] ) ; updateMetaData ( data . names [ 0 ] ) ; updateGaugePlot ( data . names [ 0 ] ) ; } ) ; }
Initializes the page with a default plot
Initializes the page with a default plot
// Use D3 to select the dropdown menu (02-Activities 08-Ins_Dropdown_Events) // Use D3 library to read in samples.json to select the dropdown menu // Assign the value of the dropdown menu option to a variable // Set name from the list for functions to build plots