<commit_before>---
layout: post
title: Branching out
subtitle: One Twig at a Time
---

<meta charset="utf-8">
<canvas width="480" height="480"></canvas>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>

var n = 20;

var nodes = d3.range(n * n).map(function(i) {
  return {
    index: i
  };
});

var links = [];

for (var y = 0; y < n; ++y) {
  for (var x = 0; x < n; ++x) {
    if (y > 0) links.push({source: (y - 1) * n + x, target: y * n + x});
    if (x > 0) links.push({source: y * n + (x - 1), target: y * n + x});
  }
}

var simulation = d3.forceSimulation(nodes)
    .force("charge", d3.forceManyBody().strength(-30))
    .force("link", d3.forceLink(links).strength(1).distance(10).iterations(10))
    .on("tick", ticked);

var canvas = document.querySelector("canvas"),
    context = canvas.getContext("2d"),
    width = canvas.width,
    height = canvas.height;

d3.select(canvas)
    .call(d3.drag()<commit_msg>Update lattice.html<commit_after>---
layout: default
title: Branching out
subtitle: One Twig at a Time
---

<meta charset="utf-8">
<canvas width="480" height="480"></canvas>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>

var n = 20;

var nodes = d3.range(n * n).map(function(i) {
  return {
    index: i
  };
});

var links = [];

for (var y = 0; y < n; ++y) {
  for (var x = 0; x < n; ++x) {
    if (y > 0) links.push({source: (y - 1) * n + x, target: y * n + x});
    if (x > 0) links.push({source: y * n + (x - 1), target: y * n + x});
  }
}

var simulation = d3.forceSimulation(nodes)
    .force("charge", d3.forceManyBody().strength(-30))
    .force("link", d3.forceLink(links).strength(1).distance(20).iterations(10))
    .on("tick", ticked);

var canvas = document.querySelector("canvas"),
    context = canvas.getContext("2d"),
    width = canvas.width,
    height = canvas.height;

d3.select(canvas)
    .call(d3.drag()
{'fraction_non_alphanumeric': 0.21105794790005317, 'fraction_numerical': 0.03402445507708666, 'mean_word_length': 3.2483069977426635, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '1737874', 'n_tokens_mistral': 760, 'n_tokens_neox': 727, 'n_words': 180}