<commit_before><!doctype html>
<meta charset="utf-8">
<script src="../js/d3.js"></script>
<script src="../build/vistk.js"></script>
<link href="../css/vistk.css" rel="stylesheet">
<body>
<div id="viz"></div>
<body>
<script src="../js/d3.js"></script>
<script>


d3.csv("../data/new_rankings2.csv", function(error, data) {

  d3.json("../data/countries.json", function(error, countries) {

    var res = [];

    function find_country(var_filter, value) {

      var metadata = countries.filter(function(d) {
        return d['name'][var_filter] == value;
      })

      if(metadata.length == 0) {
        return "ERROR";
      } else {
        return metadata[0]['region'];
      }

    }

    data.forEach(function(d) {

      // Create ids for countries
      for(var k in d) {

        if(k != "Country") {
          res.push({name: d.Country, year: k, rank: +d[k], id: d.Country.replace(/ /g, "_").replace(/,/g, "").replace(/./g, ""), continent: find_country('common', d.Country)})
        }

      }
    });

    visualization = vistk.viz().params({
      type: "slopegraph",
      container: "#viz",
      height: 600,
      width: 400,
      margin: {top: 30, right: 100, bottom: 30, left: 100},
      data: res,
      var_id: "name", // Should be ["continent", "id"] to allow aggregation and filtering
      var_group: "continent",
      var_color: "category", // TODO: color by final ranking value..
      var_text: "name",
      y_text: "ECI Rank",
      var_y: "rank",
      var_x: "year",
      items: [],
      time: {
        parse: d3.time.format("%Y").parse,
        var_time: 'year',
        current_time: "2013",
        filter: ["2003", "2013"]
      },
      selection: ["Japan", "Switzerland", "Germany"],<commit_msg>Inverting scale<commit_after><!doctype html>
<meta charset="utf-8">
<script src="../js/d3.js"></script>
<script src="../build/vistk.js"></script>
<link href="../css/vistk.css" rel="stylesheet">
<body>
<div id="viz"></div>
<body>
<script src="../js/d3.js"></script>
<script>


d3.csv("../data/new_rankings2.csv", function(error, data) {

  d3.json("../data/countries.json", function(error, countries) {

    var res = [];

    function find_country(var_filter, value) {

      var metadata = countries.filter(function(d) {
        return d['name'][var_filter] == value;
      })

      if(metadata.length == 0) {
        return "ERROR";
      } else {
        return metadata[0]['region'];
      }

    }

    data.forEach(function(d) {

      // Create ids for countries
      for(var k in d) {

        if(k != "Country") {
          res.push({name: d.Country, year: k, rank: +d[k], id: d.Country.replace(/ /g, "_").replace(/,/g, "").replace(/./g, ""), continent: find_country('common', d.Country)})
        }

      }
    });

    visualization = vistk.viz().params({
      type: "slopegraph",
      container: "#viz",
      height: 600,
      width: 400,
      margin: {top: 30, right: 100, bottom: 30, left: 100},
      data: res,
      var_id: "name", // Should be ["continent", "id"] to allow aggregation and filtering
      var_group: "continent",
      var_color: "category", // TODO: color by final ranking value..
      var_text: "name",
      y_text: "ECI Rank",
      var_y: "rank",
      y_invert: true,
      var_x: "year",
      time: {
        parse: d3.time.format("%Y").parse,
        var_time: 'year',
        current_time: "2013",
        filter: ["2003", "2013"]
      },
      selection: ["Japan", "Switzerland", "Germany"],
{'fraction_non_alphanumeric': 0.19741750358680057, 'fraction_numerical': 0.021233859397417502, 'mean_word_length': 2.4790419161676644, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '6684580', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1162, 'n_words': 267}