function updateDownload() {
          var tmpField = d3.select(".info").datum().field_name;
          if(d3.select(".info").datum().sort_state == "ascending") {
            var tmpCSV = d3.csvFormat(dim[tmpField].bottom(Infinity));
          }
          else {
            var tmpCSV = d3.csvFormat(dim[tmpField].top(Infinity));
          }
          d3.select("#downloadButtonA").attr("href", "data:attachment/csv," + encodeURIComponent(tmpCSV));
        }
//***Function to download data as a CSV file
Function to download data as a CSV file
Function to download data as a CSV file
function updateDownload() {
          var tmpField = d3.select(".info").datum().field_name;
          if(d3.select(".info").datum().sort_state == "ascending") {
            var tmpCSV = d3.csvFormat(dim[tmpField].bottom(Infinity));
          }
          else {
            var tmpCSV = d3.csvFormat(dim[tmpField].top(Infinity));
          }
          d3.select("#downloadButtonA").attr("href", "data:attachment/csv," + encodeURIComponent(tmpCSV));
        }
function updateDownload ( ) { var tmpField = d3 . select ( ".info" ) . datum ( ) . field_name ; if ( d3 . select ( ".info" ) . datum ( ) . sort_state == "ascending" ) { var tmpCSV = d3 . csvFormat ( dim [ tmpField ] . bottom ( Infinity ) ) ; } else { var tmpCSV = d3 . csvFormat ( dim [ tmpField ] . top ( Infinity ) ) ; } d3 . select ( "#downloadButtonA" ) . attr ( "href" , "data:attachment/csv," + encodeURIComponent ( tmpCSV ) ) ; }
Function to download data as a CSV file
Function to download data as a CSV file