function init() {

  // Read json data
  d3.json("samples.json").then((sampleData) => {

      // Filter data to get sample names
      var filtData = sampleData.names;

      // Add dropdown option for each sample
      var dropdownMenu = d3.select("#selDataset");

      // Add names to the drop down
      filtData.forEach((id) => {
          dropdownMenu.append("option").property("value", id).text(id);
      })

      // Use first sample to build metadata and initial plots
      buildMetadata(filtData[0]);

      buildCharts(filtData[0]);

  });
}
// Define function that will run on page load
Define function that will run on page load
Define function that will run on page load
function init() {
  d3.json("samples.json").then((sampleData) => {
      var filtData = sampleData.names;
      var dropdownMenu = d3.select("#selDataset");
      filtData.forEach((id) => {
          dropdownMenu.append("option").property("value", id).text(id);
      })
      buildMetadata(filtData[0]);
      buildCharts(filtData[0]);
  });
}
function init ( ) { d3 . json ( "samples.json" ) . then ( ( sampleData ) => { var filtData = sampleData . names ; var dropdownMenu = d3 . select ( "#selDataset" ) ; filtData . forEach ( ( id ) => { dropdownMenu . append ( "option" ) . property ( "value" , id ) . text ( id ) ; } ) buildMetadata ( filtData [ 0 ] ) ; buildCharts ( filtData [ 0 ] ) ; } ) ; }
Define function that will run on page load
Define function that will run on page load
// Read json data // Filter data to get sample names // Add dropdown option for each sample // Add names to the drop down // Use first sample to build metadata and initial plots