<commit_before>define [
  'paper'
], (paper) ->

  class Elements
    constructor: (elements) ->
      @elements = elements
    
    draw: (node) ->
      children = (@createElement(e, node) for e in @elements)
      new paper.Group(children)

    createElement: (e, node) =>
      e.x or= 0
      e.y or= 0
      path = @createPath(e, node)
      path.position = new paper.Point(node.position).add(@getOption(e.x, node, 0), @getOption(e.y, node, 0))      
      path.fillColor = @getOption(e.fillColor, node, "white")
      path.strokeColor = @getOption(e.borderColor, node, "black")
      path

    createPath: (options, node) =>
      width = @getOption(options.size.width, node, 100)
      height = @getOption(options.size.height, node, 100)
      
      switch options.figure
        when "rounded"
          rect = new paper.Rectangle(0, 0, width, height)
          new paper.Path.RoundRectangle(rect, new paper.Size(10, 10))
        when "ellipse"
          rect = new paper.Rectangle(0, 0, options.size.width*2, options.size.height*2)
          new paper.Path.Oval(rect)
        when "rectangle"
          new paper.Path.Rectangle(0, 0, options.size.width, options.size.height)<commit_msg>Use derived width and height for all node shapes.<commit_after>define [
  'paper'
], (paper) ->

  class Elements
    constructor: (elements) ->
      @elements = elements
    
    draw: (node) ->
      children = (@createElement(e, node) for e in @elements)
      new paper.Group(children)

    createElement: (e, node) =>
      e.x or= 0
      e.y or= 0
      path = @createPath(e, node)
      path.position = new paper.Point(node.position).add(@getOption(e.x, node, 0), @getOption(e.y, node, 0))      
      path.fillColor = @getOption(e.fillColor, node, "white")
      path.strokeColor = @getOption(e.borderColor, node, "black")
      path

    createPath: (options, node) =>
      width = @getOption(options.size.width, node, 100) if options.size
      height = @getOption(options.size.height, node, 100) if options.size
      
      switch options.figure
        when "rounded"
          rect = new paper.Rectangle(0, 0, width, height)
          new paper.Path.RoundRectangle(rect, new paper.Size(10, 10))
        when "ellipse"
          rect = new paper.Rectangle(0, 0, width*2, height*2)
          new paper.Path.Oval(rect)
        when "rectangle"
          new paper.Path.Rectangle(0, 0, width, height)
{'fraction_non_alphanumeric': 0.13485477178423236, 'fraction_numerical': 0.018257261410788383, 'mean_word_length': 2.5145772594752187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4221631', 'n_tokens_mistral': 811, 'n_tokens_neox': 765, 'n_words': 195}