<commit_before>comparator    = require "../../array/comparator.coffee"
sort          = require "../../array/sort.coffee"
dataThreshold = require "../../core/data/threshold.js"
fetchText     = require "../../core/fetch/text.js"
fetchValue    = require "../../core/fetch/value.coffee"
fontSizes     = require "../../font/sizes.coffee"
offset        = require "../../geom/offset.coffee"
textwrap      = require "../../textwrap/textwrap.coffee"
buckets       = require "../../util/buckets.coffee"
uniques       = require "../../util/uniques.coffee"

radar = (vars) ->

  data = vars.data.viz

  nextDepth = vars.depth.value + 1
  nextLevel = vars.id.nesting[nextDepth]

  children = (d[nextLevel] for d in data)

  total = (uniques(data, nextLevel, fetchValue, vars, nextDepth) for d in data)
  total = uniques(d3.merge(total)).length
  angle = Math.PI * 2 / total
  maxRadius = d3.min([vars.width.viz, vars.height.viz])/2

  first = offset Math.PI/2, maxRadius
  second = offset angle + Math.PI/2, maxRadius
  labelWidth = (first.x - second.x)
  labels = (fetchText(vars, c, nextDepth)[0] for c in children)
  labels = uniques(d3.merge(labels))
  textStyle = {
    "fill": "#444"
    "font-size": "12px"
  }
  sizes = fontSizes labels, textStyle,
    mod: (elem) ->
      textwrap().container d3.select(elem)
        .height(vars.height.viz/8)
        .width(labelWidth).draw()<commit_msg>radar axis defaults to using x axis styles<commit_after>comparator    = require "../../array/comparator.coffee"
sort          = require "../../array/sort.coffee"
dataThreshold = require "../../core/data/threshold.js"
fetchText     = require "../../core/fetch/text.js"
fetchValue    = require "../../core/fetch/value.coffee"
fontSizes     = require "../../font/sizes.coffee"
offset        = require "../../geom/offset.coffee"
textwrap      = require "../../textwrap/textwrap.coffee"
buckets       = require "../../util/buckets.coffee"
uniques       = require "../../util/uniques.coffee"

radar = (vars) ->

  data = vars.data.viz

  nextDepth = vars.depth.value + 1
  nextLevel = vars.id.nesting[nextDepth]

  children = (d[nextLevel] for d in data)

  total = (uniques(data, nextLevel, fetchValue, vars, nextDepth) for d in data)
  total = uniques(d3.merge(total)).length
  angle = Math.PI * 2 / total
  maxRadius = d3.min([vars.width.viz, vars.height.viz])/2

  first = offset Math.PI/2, maxRadius
  second = offset angle + Math.PI/2, maxRadius
  labelWidth = (first.x - second.x)
  labels = (fetchText(vars, c, nextDepth)[0] for c in children)
  labels = uniques(d3.merge(labels))
  textStyle = {
    "fill": vars.x.ticks.font.color
    "font-family": vars.x.ticks.font.family.value
    "font-weight": vars.x.ticks.font.weight
    "font-size":   vars.x.ticks.font.size+"px"
  }
  sizes = fontSizes labels, textStyle,
    mod: (elem) ->
      textwrap().container d3.select(elem)
        .height(vars.height.viz/8)
        .width(labelWidth).draw()
{'fraction_non_alphanumeric': 0.17206132879045996, 'fraction_numerical': 0.009199318568994889, 'mean_word_length': 2.740127388535032, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 7, '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': '6170934', 'n_tokens_mistral': 1013, 'n_tokens_neox': 1003, 'n_words': 212}