Skip to content

Extract DataFramePresenter into a class that can be reused #248

Open
@olekscode

Description

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.)

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions