Skip to content

Commit

Permalink
Merge pull request #276 from Joshua-Dias-Barreto/InspectorRowNames
Browse files Browse the repository at this point in the history
Added a column for row names in the inspector table. Fixes #275
  • Loading branch information
jecisc authored Jul 27, 2023
2 parents 85a9c36 + cf0b2b0 commit df94214
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/DataFrame/DataFrame.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1426,21 +1426,26 @@ DataFrame >> innerJoin: aDataFrame onLeft: leftColumn onRight: rightColumn [

{ #category : #newtools }
DataFrame >> inspectionItems: aBuilder [
<inspectorPresentationOrder: 0 title: 'DataFrame'>

<inspectorPresentationOrder: 0 title: 'DataFrame'>
| table |
table := aBuilder newTable.

table addColumn: (SpIndexTableColumn new
title: '#';
sortFunction: #yourself ascending;
beNotExpandable;
yourself).
title: '#';
sortFunction: #yourself ascending;
beNotExpandable;
yourself).
self rowNames = (1 to: self numberOfRows) asOrderedCollection
ifFalse: [
table addColumn: (SpStringTableColumn
title: ''
evaluated: [ :rowWithName | rowWithName at: 1 ]) ].

(self columnNames) doWithIndex: [ :headerName :columnIndex |
self columnNames doWithIndex: [ :headerName :columnIndex |
table addColumn: (SpStringTableColumn
title: headerName
evaluated: [ :rowWithName | rowWithName at: columnIndex + 1 ]) ].
title: headerName
evaluated: [ :rowWithName | rowWithName at: columnIndex + 1 ]) ].

table items: self asArrayOfRowsWithName.

Expand Down

0 comments on commit df94214

Please sign in to comment.