To inspect a DataFrame, we create a Spec table:
inspectionItems: aBuilder
<inspectorPresentationOrder: 0 title: 'DataFrame'>
| table |
table := aBuilder newTable.
table addColumn: (SpIndexTableColumn new
title: '#';
sortFunction: #yourself ascending;
beNotExpandable;
yourself).
(self columnNames) doWithIndex: [ :headerName :columnIndex |
table addColumn: (SpStringTableColumn
title: headerName
evaluated: [ :rowWithName | rowWithName at: columnIndex + 1 ]) ].
table items: self asArrayOfRowsWithName.
^ table
It would be nice to extract this table into a separate class DataFramePresenter that could be reused in different applications to display data frames. In future, we could make this presenter cooler by adding more features (filtering, sorting, searching, etc.)
To inspect a DataFrame, we create a Spec table:
It would be nice to extract this table into a separate class
DataFramePresenterthat could be reused in different applications to display data frames. In future, we could make this presenter cooler by adding more features (filtering, sorting, searching, etc.)