static/js/app.js
// Build a function to pull the meta data from samples.json and display the selected ID data on the display box 
Build a function to pull the meta data from samples.json and display the selected ID data on the display box
Build a function to pull the meta data from samples . json and display the selected ID data on the display box
function PullSampledata(sample) {
  d3.json("samples.json").then((data) => {
    let metadata = data.metadata;
    let results = metadata.filter(sampleObj => sampleObj.id == sample);
    let result = results[0];
    let display = d3.select("#sample-metadata");
    display.html("");
    Object.entries(result).forEach(([key, value]) => {
      display.append("h6").text(`${key.toUpperCase()}: ${value}`);
    });
  });
}
function PullSampledata ( sample ) { d3 . json ( "samples.json" ) . then ( ( data ) => { let metadata = data . metadata ; let results = metadata . filter ( sampleObj => sampleObj . id == sample ) ; let result = results [ 0 ] ; let display = d3 . select ( "#sample-metadata" ) ; display . html ( "" ) ; Object . entries ( result ) . forEach ( ( [ key , value ] ) => { display . append ( "h6" ) . text ( ` ${ key . toUpperCase ( ) } ${ value } ` ) ; } ) ; } ) ; }
Build a function to pull the meta data from samples.json and display the selected ID data on the display box
Build a function to pull the meta data from samples . json and display the selected ID data on the display box
// Pull in data from samples.json // grab the deomgraphic data tied to IDs - metadata // Filter the data for the specific ID  // Use d3 to select the display panel (#sample-metadata) for the specific sample number // clear any existing metadata // add each key and value pair to the display box