<commit_before>// This module defines a reusable data table component using D3.js.
define(function(require) {

  // Load D3 v4 via our custom bundle build output.
  var d3 = require("../d3/d3.min");

  // Constructor function for a data table.
  // Accepts a container `div` DOM element.
  return function Table(div){

    // DOM Elements.
    var tableRoot = d3.select(div)
          .append("table")
            .attr("class", "table table-bordered"),
        tableHeader = tableRoot
          .append("thead")
          .append("tr"),
        tableBody = tableRoot
          .append("tbody");

    // Renders the HTML table with the given data array.
    // Arguments:
    //
    //  * data - An array of row objects.
    //  * columns - An array of column descriptor objects with properties:
    //    * title - The title of the column to display in the header.
    //    * property - The name of the column property in row objects.
    function render(data, columns){
      
      // Populate the table header.
      var titles = tableHeader.selectAll("th").data(columns);
      titles.exit().remove();
      titles = titles.enter().append("th").merge(titles);
      titles.text(function (d) { return d.title; });
<commit_msg>Make table header background color light blue<commit_after>// This module defines a reusable data table component using D3.js.
define(function(require) {

  // Load D3 v4 via our custom bundle build output.
  var d3 = require("../d3/d3.min");

  // Configuration.
  var headerBackgroundColor = "lightblue";

  // Constructor function for a data table.
  // Accepts a container `div` DOM element.
  return function Table(div){

    // DOM Elements.
    var tableRoot = d3.select(div)
          .append("table")
            .attr("class", "table table-bordered"),
        tableHeader = tableRoot
          .append("thead")
            .style("background-color", headerBackgroundColor)
          .append("tr"),
        tableBody = tableRoot
          .append("tbody");

    // Renders the HTML table with the given data array.
    // Arguments:
    //
    //  * data - An array of row objects.
    //  * columns - An array of column descriptor objects with properties:
    //    * title - The title of the column to display in the header.
    //    * property - The name of the column property in row objects.
    function render(data, columns){
      
      // Populate the table header.
      var titles = tableHeader.selectAll("th").data(columns);
      titles.exit().remove();
      titles = titles.enter().append("th").merge(titles);
      titles.text(function (d) { return d.title; });

{'fraction_non_alphanumeric': 0.12137404580152672, 'fraction_numerical': 0.0053435114503816794, 'mean_word_length': 2.3219264892268696, 'pattern_counts': {'":': 0, '<': 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': '5237953', 'n_tokens_mistral': 727, 'n_tokens_neox': 717, 'n_words': 248}