<commit_before>﻿:class ejTreeGrid : #._SF._ejWidget
⍝ Description:: Syncfusion TreeGrid widget
⍝ Formats data in a grid with tree-based collapsibility
⍝ Constructor:: [items [levels]]
⍝ items           - matrix of data (the row is titles for each column if the first level is 0)
⍝ levels          - integer vector indicating level for each row in items (the first may be 0 to indicate title row)
⍝ Public Fields::
⍝ Items           - matrix of data (the row is titles for each column if the first level is 0)
⍝ Columns         - if non-empty, a vector of namespaces, one per column, containing the definition for each columns
⍝                   see the Syncfusion documentation for more information
⍝ ColNames        - vector of character vectors containing the title for each column in items
⍝ ColTitles       - vector of character vectors containing the displayed column heading for each column in items
⍝ CellWidths      - integer scalar or vector of column widths (in pixels)
⍝ Levels          - integer vector indicating the level for each row in the table
⍝ width           - overall width for the TreeGrid
⍝ height          - overall height for the TreeGrid

⍝ OLD INFO!!!
⍝ Constructor:: [values [titles [levels [widths]]]]
⍝ values          - matrix of data
⍝ titles          - vector of character vectors containing the title for each column in values
⍝ levels          - integer vector indicating level for each row in values
⍝ widths          - column widths
⍝ Public Fields::
⍝ Values          - vector of char vectors
⍝ Columns         - if non-empty, a vector of namespaces, one per column, containing the definition for each columns
⍝                   see the Symcfusion documentation for more information
⍝ ColNames        - vector of character vectors containing the title for each column in values
⍝ ColTitles       - vector of character vectors containing the displayed column heading for each column in values
⍝ CellWidths      - integer vector of column widths (in pixels)
⍝ Levels          - integer vector indicating the level for each row in the table
⍝ width           - overall width for the TreeGrid
⍝ height          - overall height for the TreeGrid
⍝ END OF OLD INFO


    :Field public shared readonly DocBase←'http://help.syncfusion.com/js/api/ejTreeGrid.html'
    :Field public shared readonly ApiLevel←3
    :Field public shared readonly DocDyalog←'/Documentation/DyalogAPIs/Syncfusion/ejTreeGrid.html'
    :Field public shared readonly IntEvt←'clearSelection' 'collapseAll' 'hideColumn' 'refresh' 'saveCell' 'search' 'showColumn' 'sortColumn'

    :Field Public Items←,⊂''
    :Field Public Columns←⍬      ⍝ Vector of namespaces using JSON names
    :Field Public Levels←⍬       ⍝ Level of nesting

    :Field Public ColNames←⍬     ⍝ JSON: field
    :Field Public ColTitles←⍬    ⍝       headerText
    :Field Public CellWidths←⍬   ⍝       width

    :Field Public width←500      ⍝ default width = 500px
    :Field Public height←⍬

    script←{⎕NEW #._DC.Script ⍵}

    ∇ make
      :Access public
      JQueryFn←Uses←'ejTreeGrid'
      :Implements Constructor
      InternalEvents←IntEvt
    ∇

    ∇ makec args
      :Access public
      args←eis args
      JQueryFn←Uses←'ejTreeGrid'
      :Implements Constructor
      InternalEvents←IntEvt
      args←↑¨∘↓∘⍉⍣(2=≢⍴args)⊢args ⍝ translate matrix arg to vector arg
     
      (Items Levels)←args defaultArgs(0 0⍴⍬)⍬
     
      :If 0∊Levels ⍝ separate titles
          ColTitles←Items[1;]
          Items←1 0↓Items
      :EndIf
     
      :If 0≠⍴ColTitles
          :If 326=⎕DR⊃ColTitles ⋄ Columns←ColTitles ⋄ ColTitles←⍬
          :Else ⋄ ColNames←{'c',⍕⍵}¨⍳≢ColTitles
          :EndIf
      :EndIf
    ∇

    ∇ r←Render;fields;src;rows;cols;coldefs;colfields;i;lev
      :Access public
      SetId
      r←''
      (rows cols)←⍴Items<commit_msg>ejTreeGrid now generates ColNames if needed, accepts Links (although does not use them), and defaults to level 1. Old comments removed.<commit_after>﻿:class ejTreeGrid : #._SF._ejWidget
⍝ Description:: Syncfusion TreeGrid widget
⍝ Formats data in a grid with tree-based collapsibility
⍝ Constructor:: [items [levels]]
⍝ items           - matrix of data (the row is titles for each column if the first level is 0)
⍝ levels          - integer vector indicating level for each row in items (the first may be 0 to indicate title row)
⍝ Public Fields::
⍝ Items           - matrix of data (the row is titles for each column if the first level is 0)
⍝ Columns         - if non-empty, a vector of namespaces, one per column, containing the definition for each columns
⍝                   see the Syncfusion documentation for more information
⍝ ColNames        - vector of character vectors containing the title for each column in items
⍝ ColTitles       - vector of character vectors containing the displayed column heading for each column in items
⍝ CellWidths      - integer scalar or vector of column widths (in pixels)
⍝ Levels          - integer vector indicating the level for each row in the table
⍝ width           - overall width for the TreeGrid
⍝ height          - overall height for the TreeGrid

    :Field public shared readonly DocBase←'http://help.syncfusion.com/js/api/ejTreeGrid.html'
    :Field public shared readonly ApiLevel←3
    :Field public shared readonly DocDyalog←'/Documentation/DyalogAPIs/Syncfusion/ejTreeGrid.html'
    :Field public shared readonly IntEvt←'clearSelection' 'collapseAll' 'hideColumn' 'refresh' 'saveCell' 'search' 'showColumn' 'sortColumn'

    :Field Public Items←,⊂''
    :Field Public Columns←⍬      ⍝ Vector of namespaces using JSON names
    :Field Public Levels←1       ⍝ Level of nesting

    :Field Public ColNames←⍬     ⍝ JSON: field
    :Field Public ColTitles←⍬    ⍝       headerText
    :Field Public CellWidths←⍬   ⍝       width

    :Field Public width←500      ⍝ default width = 500px
    :Field Public height←⍬

    script←{⎕NEW #._DC.Script ⍵}

    ∇ make
      :Access public
      JQueryFn←Uses←'ejTreeGrid'
      :Implements Constructor
      InternalEvents←IntEvt
    ∇

    ∇ makec args;sink
      :Access public
      args←eis args
      JQueryFn←Uses←'ejTreeGrid'
      :Implements Constructor
      InternalEvents←IntEvt
      args←↑¨∘↓∘⍉⍣(2=≢⍴args)⊢args ⍝ translate matrix arg to vector arg
     
      (Items Levels sink)←args defaultArgs(0 0⍴⍬)1 ⍬
     
    ∇

    ∇ r←Render;fields;src;rows;cols;coldefs;colfields;i;lev
      :Access public
      SetId
     
      :If 0∊Levels ⍝ separate titles
          ColTitles←Items[1;]
          Items←1 0↓Items
      :EndIf
     
      :If 0≠⍴ColTitles
          :If 326=⎕DR⊃ColTitles ⋄ Columns←ColTitles ⋄ ColTitles←⍬
          :Else ⋄ ColNames←{'c',⍕⍵}¨⍳≢ColTitles
          :EndIf
      :EndIf
     
      :If 0∊⍴ColNames
          ColNames←{'c',⍕⍵}¨⍳⊃⌽⍴Items
      :EndIf
     
      r←''
      (rows cols)←⍴Items
{'fraction_non_alphanumeric': 0.07998251748251749, 'fraction_numerical': 0.006701631701631702, 'mean_word_length': 2.680965147453083, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2852781', 'n_tokens_mistral': 2285, 'n_tokens_neox': 2231, 'n_words': 797}