<commit_before>require_relative 'count_graph'
require_relative 'image_renderer'

class ManikinCountGraph < CountGraph
  include ImageRenderer

  def draw_item(x, y, color)
    head(x, y, color)
    body(x, y, color)
    arms(x, y, color)
  end

  def head(x, y, color)
    cx = x + @options[:item_width] / 2
    cy = y + @options[:item_height] / 4
    radius = @options[:item_height] / 8

    renderer.circle cx, cy, radius, { fill: color }
  end

  def body(x, y, color)
    left   = x + @options[:item_width] / 2
    right  = x + @options[:item_width] / 2
    top    = y + @options[:item_height] / 2
    bottom = y + @options[:item_height] 
    style  = { 
      stroke:         color, 
      stroke_width:   @options[:item_width] / 4, 
      stroke_linecap: 'round',
      class:          'body'
    }

    renderer.line left, top, right, bottom, style
  end

  def arms(x, y, color)
    left   = x + @options[:item_width] / 2
    right  = x + @options[:item_width] / 2
    top    = y + @options[:item_height] / 2 - @options[:item_height] * 0.12
    bottom = y + @options[:item_height] - @options[:item_height] * 0.15
    style  = { 
      stroke:         color, 
      stroke_width:   @options[:item_width] / 14, 
      stroke_linecap: 'round' 
    }

    style_left_arm = style.merge(class: 'left-arm', transform: "rotate(45 #{left} #{top})")
    renderer.line left, top, right, bottom, style_left_arm
    style_right_arm = style.merge(class: 'right-arm', transform: "rotate(-45 #{left} #{top})")<commit_msg>add rubocop correction on manikin_count_graph<commit_after>require_relative 'count_graph'
require_relative 'image_renderer'

class ManikinCountGraph < CountGraph
  include ImageRenderer

  def draw_item(x, y, color)
    head(x, y, color)
    body(x, y, color)
    arms(x, y, color)
  end

  def head(x, y, color)
    cx = x + @options[:item_width] / 2
    cy = y + @options[:item_height] / 4
    radius = @options[:item_height] / 8

    renderer.circle cx, cy, radius, fill: color
  end

  def body(x, y, color)
    left   = x + @options[:item_width] / 2
    right  = x + @options[:item_width] / 2
    top    = y + @options[:item_height] / 2
    bottom = y + @options[:item_height]
    style  = {
      stroke:         color,
      stroke_width:   @options[:item_width] / 4,
      stroke_linecap: 'round',
      class:          'body'
    }

    renderer.line left, top, right, bottom, style
  end

  def arms(x, y, color)
    left   = x + @options[:item_width] / 2
    right  = x + @options[:item_width] / 2
    top    = y + @options[:item_height] / 2 - @options[:item_height] * 0.12
    bottom = y + @options[:item_height] - @options[:item_height] * 0.15
    style  = {
      stroke:         color,
      stroke_width:   @options[:item_width] / 14,
      stroke_linecap: 'round'
    }

    style_left_arm = style.merge(class: 'left-arm', transform: "rotate(45 #{left} #{top})")
    renderer.line left, top, right, bottom, style_left_arm
    style_right_arm = style.merge(class: 'right-arm', transform: "rotate(-45 #{left} #{top})")
{'fraction_non_alphanumeric': 0.14116874589625739, 'fraction_numerical': 0.014445173998686802, 'mean_word_length': 2.7386503067484664, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5971645', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1060, 'n_words': 267}