Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract DataFramePresenter into a class that can be reused #248

Open
olekscode opened this issue Jun 1, 2023 · 0 comments
Open

Extract DataFramePresenter into a class that can be reused #248

olekscode opened this issue Jun 1, 2023 · 0 comments

Comments

@olekscode
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants