<commit_before># andlabs/ui table view/tree view proposal
<tt>(text that looks like this is optional)</tt>

```go
type TableView struct {
    Selected chan struct{}
    Data     interface{}
    // contains hidden or unexported fields
}
```
A TableView is a Control that displays rows of structured data organized by columns.

Data is a slice of objects of a structure containing multiple fields. Each field represents a column in the table. Column names are, by default, the exported field name; the struct tag ui:"Custom name" can be used to specify a custom field name. For example:
```go
type Person struct {
    Name        string
    Address     Address
    PhoneNumber PhoneNumber `ui:"Phone Number"`
}
```
Data is displayed using the fmt package's %v rule. The structure must satisfy sync.Locker.

<tt>If one of the members is of type slice of the structure type, then any element of the main slice with a Children whose length is nonzero represents child nodes. For example:
```go
type File struct {
    Filename string
    Size     int64
    Type     FileType
    Contents []File
}
```
In this case, File.Contents specifies children of the parent File.</tt>

```go
func NewTableView(initData interface{}) *TableView
```
Creates a new TableView with the specified initial data. This also determines the data type of the TableView; after this, all accesses to the data are made through the Data field of TableView. NewTableView() panics if initData is nil or not a slice of structures. The slice may be empty. (TODO slice of pointers to structures?) <tt>NewTableView() also panics if the structure has more than one possible children field.</tt>

```go
// if trees are not supported
func (t *TableView) Append(items ...interface{})
func (t *TableView) InsertBefore(index int, items ...interface{})
func (t *TableView) Delete(indices ...int)

// if trees are supported
func (t *TableView) Append(path []int, items ...interface{})
func (t *TableView) InsertBefore(path []int, items ...interface{})
func (t *TableView) Delete(path []int, indices ...int)
```<commit_msg>Fixed <tt> breakup in tableviewproposal.md.<commit_after># andlabs/ui table view/tree view proposal
<tt>(text that looks like this is optional)</tt>

```go
type TableView struct {
    Selected chan struct{}
    Data     interface{}
    // contains hidden or unexported fields
}
```
A TableView is a Control that displays rows of structured data organized by columns.

Data is a slice of objects of a structure containing multiple fields. Each field represents a column in the table. Column names are, by default, the exported field name; the struct tag ui:"Custom name" can be used to specify a custom field name. For example:
```go
type Person struct {
    Name        string
    Address     Address
    PhoneNumber PhoneNumber `ui:"Phone Number"`
}
```
Data is displayed using the fmt package's %v rule. The structure must satisfy sync.Locker.

<tt>If one of the members is of type slice of the structure type, then any element of the main slice with a Children whose length is nonzero represents child nodes. For example:</tt>
```go
type File struct {
    Filename string
    Size     int64
    Type     FileType
    Contents []File
}
```
<tt>In this case, File.Contents specifies children of the parent File.</tt>

```go
func NewTableView(initData interface{}) *TableView
```
Creates a new TableView with the specified initial data. This also determines the data type of the TableView; after this, all accesses to the data are made through the Data field of TableView. NewTableView() panics if initData is nil or not a slice of structures. The slice may be empty. (TODO slice of pointers to structures?) <tt>NewTableView() also panics if the structure has more than one possible children field.</tt>

```go
// if trees are not supported
func (t *TableView) Append(items ...interface{})
func (t *TableView) InsertBefore(index int, items ...interface{})
func (t *TableView) Delete(indices ...int)

// if trees are supported
func (t *TableView) Append(path []int, items ...interface{})
func (t *TableView) InsertBefore(path []int, items ...interface{})
func (t *TableView) Delete(path []int, indices ...int)
```
{'fraction_non_alphanumeric': 0.08960573476702509, 'fraction_numerical': 0.0009557945041816009, 'mean_word_length': 4.007177033492823, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '3997374', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1077, 'n_words': 580}