static/js/app.js
// Build a fucntion (initial function) to populate page with default sample id and populate drop down selection
Build a fucntion (initial function) to populate page with default sample id and populate drop down selection
Build a fucntion ( initial function ) to populate page with default sample id and populate drop down selection
function init() {
  var selector = d3.select("#selDataset");
  d3.json("samples.json").then((data) => {
    var sampleNames = data.names;
    sampleNames.forEach((sample) => {
      selector
        .append("option")
        .text(sample)
        .property("value", sample);
    });
    var firstSample = sampleNames[0];
    chartBuilder(firstSample);
    PullSampledata(firstSample);
  });
}
function init ( ) { var selector = d3 . select ( "#selDataset" ) ; d3 . json ( "samples.json" ) . then ( ( data ) => { var sampleNames = data . names ; sampleNames . forEach ( ( sample ) => { selector . append ( "option" ) . text ( sample ) . property ( "value" , sample ) ; } ) ; var firstSample = sampleNames [ 0 ] ; chartBuilder ( firstSample ) ; PullSampledata ( firstSample ) ; } ) ; }
Build a fucntion (initial function) to populate page with default sample id and populate drop down selection
Build a fucntion ( initial function ) to populate page with default sample id and populate drop down selection
// Grab a reference to the dropdown select element // Use the list of sample names to populate the select options // Use the first sample from the list to build the initial plots