function runEnter() {
  tbody.html("");
  // Prevent the page from refreshing
  d3.event.preventDefault();
  // Select the input element and get the raw HTML node
  var inputElement = d3.select("#datetime");
  // Get the value property of the input element
  var inputValue = inputElement.property("value");
  // Print the value to the console
  console.log(inputValue);
  //FIlter datafrom selection
  var filteredData = tableData.filter(tableData => tableData.datetime === inputValue ||
                                                   tableData.city === inputValue ||
                                                   tableData.state === inputValue ||
                                                   tableData.country === inputValue ||
                                                   tableData.shape === inputValue);
  // Print the value to the console
  console.log(filteredData);
  //select the table
  //var tbody = d3.select("tbody");
  // remove any data from the table
  filteredData.forEach(function(FD) {
    console.log(FD);
    var row = tbody.append("tr");
    Object.entries(FD).forEach(function([key, value]) {
      console.log(key, value);
      var cell = row.append("td");
      cell.text(value);
   });
});
}
// Create the function to run for both events
Create the function to run for both events
Create the function to run for both events
function runEnter() {
  tbody.html("");
  d3.event.preventDefault();
  var inputElement = d3.select("#datetime");
  var inputValue = inputElement.property("value");
  console.log(inputValue);
  var filteredData = tableData.filter(tableData => tableData.datetime === inputValue ||
                                                   tableData.city === inputValue ||
                                                   tableData.state === inputValue ||
                                                   tableData.country === inputValue ||
                                                   tableData.shape === inputValue);
  console.log(filteredData);
  filteredData.forEach(function(FD) {
    console.log(FD);
    var row = tbody.append("tr");
    Object.entries(FD).forEach(function([key, value]) {
      console.log(key, value);
      var cell = row.append("td");
      cell.text(value);
   });
});
}
function runEnter ( ) { tbody . html ( "" ) ; d3 . event . preventDefault ( ) ; var inputElement = d3 . select ( "#datetime" ) ; var inputValue = inputElement . property ( "value" ) ; console . log ( inputValue ) ; var filteredData = tableData . filter ( tableData => tableData . datetime === inputValue || tableData . city === inputValue || tableData . state === inputValue || tableData . country === inputValue || tableData . shape === inputValue ) ; console . log ( filteredData ) ; filteredData . forEach ( function ( FD ) { console . log ( FD ) ; var row = tbody . append ( "tr" ) ; Object . entries ( FD ) . forEach ( function ( [ key , value ] ) { console . log ( key , value ) ; var cell = row . append ( "td" ) ; cell . text ( value ) ; } ) ; } ) ; }
Create the function to run for both events
Create the function to run for both events
// Prevent the page from refreshing // Select the input element and get the raw HTML node // Get the value property of the input element // Print the value to the console //FIlter datafrom selection // Print the value to the console //select the table //var tbody = d3.select("tbody"); // remove any data from the table