<commit_before>GenMap();
  GenPlaceholder();
  GenScatter();

  $(document).ready(function () {
      $("input[type='radio']").on('change', function () {
           var selectedValue = $("input[name='radio']:checked").val();

           if (selectedValue === 'Map') {
               d3.selectAll('#viz_container').remove();
               GenMap();

             }else if(selectedValue === 'Table'){
               d3.selectAll("#viz_container").remove();
               d3.selectAll("#legend").remove();
               d3.select("#edu-tooltip").remove();
               d3.select("svg").remove();
               GenTable();
             }
       });
  });

  function GenPlaceholder(){
    var formatNumber = d3.format("$,");

    var abs_width = 1024,
        abs_height = 550,
        margin = { top: 100, right:50, bottom: 15, left: 100 },
        panel_2_width = abs_width - margin.left - margin.right,
        panel_2_height = abs_height - margin.top - margin.bottom,
        matrix_width = abs_width/1.85 - margin.left - margin.right,
        matrix_height = abs_height - margin.top - margin.bottom,
        map_width = panel_2_width-matrix_width - margin.left - margin.right,
        map_height = panel_2_height/3,
        info_width = panel_2_width-matrix_width - margin.left - margin.right,
        info_height = panel_2_height/3;

    var svg_1 = d3.select("#panel_map")
        .append("svg")
        .attr("width", map_width + margin.left + margin.right)
        .attr("height", map_height + margin.top + margin.bottom);

    var svg_2 = d3.select("#panel_info")
        .append("svg")
        .attr("width", info_width + margin.left + margin.right)
        .attr("height", info_height + margin.top + margin.bottom);

    var svg = d3.select("#panel_matrix").append("svg")
        .attr("width", matrix_width + margin.left + margin.right)
        .attr("height", matrix_height + margin.top + margin.bottom)
        .style("margin-left", -margin.left/2.5 + "px")
        .attr("transform", "translate(" + 40 + ","+ 10 +")");


  console.log("svg: ", svg);
  console.log("width: ",svg[0][0].attributes[0].nodeValue);

  d3.csv("/data-lab-data/test_v2.csv",function(bar_chrt){

        bar_chrt.forEach(function(d) {
          d.amount = +d.amount;
        });

        bar_chrt = bar_chrt.sort(function(x, y){
           return d3.descending(x.amount, y.amount);
        });

        var initial_bar =  bar_chrt.slice(0,20);

        var formatNumber = d3.format("$,");

        var axisMargin = 5,
                x_width = 470,
                barHeight = 18,
                barPadding = 5,
                bar, scale, xAxis, labelWidth = 0;

        console.log("x_width: ",x_width);

        max = d3.max(initial_bar, function(d) { return d.amount; });

        bar = svg.selectAll("g")
                .data(initial_bar)
                .enter()
                .append("g");

        bar.attr("class", "bar")
           .attr("cx",0)
           .style("fill",function(d){
             if(d.category == 1){return "#3D3A4F"}
             else if(d.category == 2){return "#1D545C"}
             else if(d.category == 3){return "#29684D"}
             else if(d.category == 4){return "#657532"}
             else if(d.category == 5){return "#A97538"}
           })
           .attr("transform", function(d, i) {
                    return "translate(0," + (i * (barHeight + barPadding)) + ")";
                });

        bar.append("text")
                .attr("class", "label")
                .attr("x",0)
                .attr("y", barHeight / 2)
                .attr("dy", ".35em") //vertical align middle
                .text(function(d){
                    return d.cfda;
                }).each(function() {
            labelWidth = Math.ceil(Math.max(labelWidth, this.getBBox().width))+2;
        });

        scale = d3.scale.linear()
                .domain([0, max])
                .range([0, x_width - labelWidth]);

        xAxis = d3.svg.axis()
                //.orient("bottom")
                .scale(scale)
                .tickSize(-svg[0][0].attributes[1].nodeValue  + axisMargin);

        bar.append("rect")
                .attr("transform", "translate("+(labelWidth)+", 0)")
                .attr("margin-left",5)
                //.attr("rx","30")
                .attr("height", barHeight)
                .attr("width", function(d){
                    return scale(d.amount);
                });

        svg.insert("g",":first-child")
            .attr("class", "axisHorizontal")
            .attr("transform", "translate(" +labelWidth+ ","+ 475 +")")
            .call(xAxis)
          .selectAll("text")
            .attr("y", 10)
            .attr("x", 0)
            .attr("dy", ".35em")
            .attr("transform", "rotate(-35)")
            .style("text-anchor", "end");

    });
<commit_msg>format panel 2 axis values<commit_after>GenMap();
  GenPlaceholder();
  GenScatter();

  $(document).ready(function () {
      $("input[type='radio']").on('change', function () {
           var selectedValue = $("input[name='radio']:checked").val();

           if (selectedValue === 'Map') {
               d3.selectAll('#viz_container').remove();
               GenMap();

             }else if(selectedValue === 'Table'){
               d3.selectAll("#viz_container").remove();
               d3.selectAll("#legend").remove();
               d3.select("#edu-tooltip").remove();
               d3.select("svg").remove();
               GenTable();
             }
       });
  });

  function GenPlaceholder(){
    var formatNumber = d3.format("$,");

    var abs_width = 1024,
        abs_height = 550,
        margin = { top: 100, right:50, bottom: 15, left: 100 },
        panel_2_width = abs_width - margin.left - margin.right,
        panel_2_height = abs_height - margin.top - margin.bottom,
        matrix_width = abs_width/1.85 - margin.left - margin.right,
        matrix_height = abs_height - margin.top - margin.bottom,
        map_width = panel_2_width-matrix_width - margin.left - margin.right,
        map_height = panel_2_height/3,
        info_width = panel_2_width-matrix_width - margin.left - margin.right,
        info_height = panel_2_height/3;

    var svg_1 = d3.select("#panel_map")
        .append("svg")
        .attr("width", map_width + margin.left + margin.right)
        .attr("height", map_height + margin.top + margin.bottom);

    var svg_2 = d3.select("#panel_info")
        .append("svg")
        .attr("width", info_width + margin.left + margin.right)
        .attr("height", info_height + margin.top + margin.bottom);

    var svg = d3.select("#panel_matrix").append("svg")
        .attr("width", matrix_width + margin.left + margin.right)
        .attr("height", matrix_height + margin.top + margin.bottom)
        .style("margin-left", -margin.left/2.5 + "px")
        .attr("transform", "translate(" + 40 + ","+ 10 +")");


  console.log("svg: ", svg);
  console.log("width: ",svg[0][0].attributes[0].nodeValue);

  d3.csv("/data-lab-data/test_v2.csv",function(bar_chrt){

        bar_chrt.forEach(function(d) {
          d.amount = +d.amount;
        });

        bar_chrt = bar_chrt.sort(function(x, y){
           return d3.descending(x.amount, y.amount);
        });

        var initial_bar =  bar_chrt.slice(0,20);

        var formatNumber = d3.format("$,");

        var axisMargin = 5,
                x_width = 470,
                barHeight = 18,
                barPadding = 5,
                bar, scale, xAxis, labelWidth = 0;

        console.log("x_width: ",x_width);

        max = d3.max(initial_bar, function(d) { return d.amount; });

        bar = svg.selectAll("g")
                .data(initial_bar)
                .enter()
                .append("g");

        bar.attr("class", "bar")
           .attr("cx",0)
           .style("fill",function(d){
             if(d.category == 1){return "#3D3A4F"}
             else if(d.category == 2){return "#1D545C"}
             else if(d.category == 3){return "#29684D"}
             else if(d.category == 4){return "#657532"}
             else if(d.category == 5){return "#A97538"}
           })
           .attr("transform", function(d, i) {
                    return "translate(0," + (i * (barHeight + barPadding)) + ")";
                });

        bar.append("text")
                .attr("class", "label")
                .attr("x",0)
                .attr("y", barHeight / 2)
                .attr("dy", ".35em") //vertical align middle
                .text(function(d){
                    return d.cfda;
                }).each(function() {
            labelWidth = Math.ceil(Math.max(labelWidth, this.getBBox().width))+2;
        });

        scale = d3.scale.linear()
                .domain([0, max])
                .range([0, x_width - labelWidth]);

        xAxis = d3.svg.axis()
                //.orient("bottom")
                .scale(scale)
                .tickSize(-svg[0][0].attributes[1].nodeValue  + axisMargin)
                .tickFormat(function(d) { return formatNumber(d); });

        bar.append("rect")
                .attr("transform", "translate("+(labelWidth)+", 0)")
                .attr("margin-left",5)
                //.attr("rx","30")
                .attr("height", barHeight)
                .attr("width", function(d){
                    return scale(d.amount);
                });

        svg.insert("g",":first-child")
            .attr("class", "axisHorizontal")
            .attr("transform", "translate(" +labelWidth+ ","+ 475 +")")
            .call(xAxis)
          .selectAll("text")
            .attr("y", 10)
            .attr("x", 0)
            .attr("dy", ".35em")
            .attr("transform", "rotate(-35)")
            .style("text-anchor", "end");

    });

{'fraction_non_alphanumeric': 0.17273098937040066, 'fraction_numerical': 0.02463205233033524, 'mean_word_length': 1.769600905745825, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1509807', 'n_tokens_mistral': 3143, 'n_tokens_neox': 2918, 'n_words': 507}