<commit_before>var layout = require('dagre').layout;

var d3 = (typeof window === 'undefined') ? require('d3') : window.d3;

module.exports = Renderer;

function Renderer() {
  this._layout = layout();
  this._drawNode = defaultDrawNode;
  this._drawEdgeLabel = defaultDrawEdgeLabel;
  this._drawEdge = defaultDrawEdge;
  this._postLayout = defaultPostLayout;
  this._postRender = defaultPostRender;
}

Renderer.prototype.layout = function(layout) {
  if (!arguments.length) { return this._layout; }
  this._layout = layout;
  return this;
};

Renderer.prototype.drawNode = function(drawNode) {
  if (!arguments.length) { return this._drawNode; }<commit_msg>Better support for pulling in d3<commit_after>var layout = require('dagre').layout;

var d3;
try { d3 = require('d3'); } catch (_) { d3 = window.d3; }

module.exports = Renderer;

function Renderer() {
  this._layout = layout();
  this._drawNode = defaultDrawNode;
  this._drawEdgeLabel = defaultDrawEdgeLabel;
  this._drawEdge = defaultDrawEdge;
  this._postLayout = defaultPostLayout;
  this._postRender = defaultPostRender;
}

Renderer.prototype.layout = function(layout) {
  if (!arguments.length) { return this._layout; }
  this._layout = layout;
  return this;
};

Renderer.prototype.drawNode = function(drawNode) {
  if (!arguments.length) { return this._drawNode; }
{'fraction_non_alphanumeric': 0.13072877535687452, 'fraction_numerical': 0.0067618332081141996, 'mean_word_length': 4.893805309734513, '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': '3342225', 'n_tokens_mistral': 414, 'n_tokens_neox': 412, 'n_words': 90}