<commit_before>
glyph = require("../glyph")


Glyph = glyph.Glyph
line_properties = glyph.line_properties
fill_properties = glyph.fill_properties


circle = (view, glyphspec, data) ->
  ctx = view.plot_view.ctx

  ctx.save()
  glyph = new Glyph(view, glyphspec, ["x", "y", "radius"], [fill_properties, line_properties])

  x = (glyph.select("x", obj) for obj in data)
  y = (glyph.select("y", obj) for obj in data)
  [sx, sy] = view.map_to_screen(x, glyph.x.units, y, glyph.y.units)
  radius = view.distance(glyph, data, "x", "radius", "edge")

  do_fill = glyph.fill_properties.do_fill
  do_stroke = glyph.line_properties.do_stroke

  if glyph.fast_path
    if do_fill
      glyph.fill_properties.set(ctx, glyph)
      ctx.beginPath()
      for i in [0..sx.length-1]
        if isNaN(sx[i] + sy[i] + radius[i])
          continue
        ctx.arc(sx[i], sy[i], radius[i], 0, 2*Math.PI*2, false)
      ctx.fill()

    if do_stroke
      glyph.line_properties.set(ctx, glyph)
      for i in [0..sx.length-1]
        ctx.beginPath()
        if isNaN(sx[i] + sy[i] + radius[i])
          continue
        ctx.arc(sx[i], sy[i], radius[i], 0, 2*Math.PI*2, false)
        ctx.stroke()

  else
    for i in [0..sx.length-1]
      if isNaN(sx[i] + sy[i] + radius[i])
        continue

      ctx.beginPath()
      ctx.arc(sx[i], sy[i], radius[i], 0, 2*Math.PI*2, false)

      if do_fill
        glyph.fill_properties.set(ctx, data[i])
        ctx.fill()

      if do_stroke
        glyph.line_properties.set(ctx, data[i])
        ctx.stroke()

  ctx.restore()
<commit_msg>revert previous circle fill loop change, only works on some browsers<commit_after>
glyph = require("../glyph")


Glyph = glyph.Glyph
line_properties = glyph.line_properties
fill_properties = glyph.fill_properties


circle = (view, glyphspec, data) ->
  ctx = view.plot_view.ctx

  ctx.save()
  glyph = new Glyph(view, glyphspec, ["x", "y", "radius"], [fill_properties, line_properties])

  x = (glyph.select("x", obj) for obj in data)
  y = (glyph.select("y", obj) for obj in data)
  [sx, sy] = view.map_to_screen(x, glyph.x.units, y, glyph.y.units)
  radius = view.distance(glyph, data, "x", "radius", "edge")

  do_fill = glyph.fill_properties.do_fill
  do_stroke = glyph.line_properties.do_stroke

  if glyph.fast_path
    if do_fill
      glyph.fill_properties.set(ctx, glyph)
      for i in [0..sx.length-1]
        if isNaN(sx[i] + sy[i] + radius[i])
          continue
        ctx.beginPath()
        ctx.arc(sx[i], sy[i], radius[i], 0, 2*Math.PI*2, false)
        ctx.fill()

    if do_stroke
      glyph.line_properties.set(ctx, glyph)
      for i in [0..sx.length-1]
        if isNaN(sx[i] + sy[i] + radius[i])
          continue
        ctx.beginPath()
        ctx.arc(sx[i], sy[i], radius[i], 0, 2*Math.PI*2, false)
        ctx.stroke()

  else
    for i in [0..sx.length-1]
      if isNaN(sx[i] + sy[i] + radius[i])
        continue

      ctx.beginPath()
      ctx.arc(sx[i], sy[i], radius[i], 0, 2*Math.PI*2, false)

      if do_fill
        glyph.fill_properties.set(ctx, data[i])
        ctx.fill()

      if do_stroke
        glyph.line_properties.set(ctx, data[i])
        ctx.stroke()

  ctx.restore()

{'fraction_non_alphanumeric': 0.1566718995290424, 'fraction_numerical': 0.009419152276295133, 'mean_word_length': 2.6578645235361655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5034147', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1158, 'n_words': 264}