<commit_before>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.graphics',
  name: 'TreeNode',
  extends: 'foam.graphics.Box',

  requires: [
    'foam.graphics.Box',
    'foam.graphics.CView',
    'foam.graphics.Label',
    'foam.graphics.Line'
  ],

  imports: [
    'formatNode',
    'graph',
    'parentNode?',
    'relationship'
  ],
  exports: ['as parentNode'],

  properties: [
    'data',
    [ 'height', 155 ],
    [ 'width', 60 ],
    [ 'padding', 30 ],
    [ 'border', 'gray' ],
    [ 'color', 'white' ],
    {
      name: 'outline',
      expression: function (x, width, expanded, childNodes, padding) {
        var rootLevelOutline = [
          {
            left: x - width / 2 - padding / 2,
            right: x + width / 2 + padding / 2
          }
        ];

        var champion = [];

        for (let i = 0; i < childNodes.length && expanded; i++) {
          // get child outline
          // transform all rows
          // merge levels into childoutlines
          var childOutline = childNodes[i].outline.map(o => ({
            left: o.left + x,
            right: o.right + x,
          }));

          for (var j = 0; j < childOutline.length; j++) {
            champion[j] = champion[j] || {
              left: Number.MAX_SAFE_INTEGER,
              right: Number.MIN_SAFE_INTEGER<commit_msg>Added documentation to the outline property<commit_after>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.graphics',
  name: 'TreeNode',
  extends: 'foam.graphics.Box',

  requires: [
    'foam.graphics.Box',
    'foam.graphics.CView',
    'foam.graphics.Label',
    'foam.graphics.Line'
  ],

  imports: [
    'formatNode',
    'graph',
    'parentNode?',
    'relationship'
  ],
  exports: ['as parentNode'],

  properties: [
    'data',
    [ 'height', 155 ],
    [ 'width', 60 ],
    [ 'padding', 30 ],
    [ 'border', 'gray' ],
    [ 'color', 'white' ],
    {
      name: 'outline',
      documentation: `
        An array containing the max left ( left edge plus padding of the leftmost node)
        and max right ( right edge plus padding of the rightmost node) values per level
        of the tree where index 0 is the root
      `,
      expression: function (x, width, expanded, childNodes, padding) {
        var rootLevelOutline = [
          {
            left: x - width / 2 - padding / 2,
            right: x + width / 2 + padding / 2
          }
        ];

        var champion = [];

        for (let i = 0; i < childNodes.length && expanded; i++) {
          // get child outline
          // transform all rows
          // merge levels into childoutlines
          var childOutline = childNodes[i].outline.map(o => ({
            left: o.left + x,
            right: o.right + x,
          }));

          for (var j = 0; j < childOutline.length; j++) {
            champion[j] = champion[j] || {
              left: Number.MAX_SAFE_INTEGER,
              right: Number.MIN_SAFE_INTEGER
{'fraction_non_alphanumeric': 0.14376590330788805, 'fraction_numerical': 0.012404580152671756, 'mean_word_length': 1.8642987249544627, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1529272', 'n_tokens_mistral': 1011, 'n_tokens_neox': 976, 'n_words': 258}