Skip to content

Commit df94214

Browse files
authored
Merge pull request #276 from Joshua-Dias-Barreto/InspectorRowNames
Added a column for row names in the inspector table. Fixes #275
2 parents 85a9c36 + cf0b2b0 commit df94214

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/DataFrame/DataFrame.class.st

+13-8
Original file line numberDiff line numberDiff line change
@@ -1426,21 +1426,26 @@ DataFrame >> innerJoin: aDataFrame onLeft: leftColumn onRight: rightColumn [
14261426

14271427
{ #category : #newtools }
14281428
DataFrame >> inspectionItems: aBuilder [
1429-
<inspectorPresentationOrder: 0 title: 'DataFrame'>
14301429

1430+
<inspectorPresentationOrder: 0 title: 'DataFrame'>
14311431
| table |
14321432
table := aBuilder newTable.
14331433

14341434
table addColumn: (SpIndexTableColumn new
1435-
title: '#';
1436-
sortFunction: #yourself ascending;
1437-
beNotExpandable;
1438-
yourself).
1435+
title: '#';
1436+
sortFunction: #yourself ascending;
1437+
beNotExpandable;
1438+
yourself).
1439+
self rowNames = (1 to: self numberOfRows) asOrderedCollection
1440+
ifFalse: [
1441+
table addColumn: (SpStringTableColumn
1442+
title: ''
1443+
evaluated: [ :rowWithName | rowWithName at: 1 ]) ].
14391444

1440-
(self columnNames) doWithIndex: [ :headerName :columnIndex |
1445+
self columnNames doWithIndex: [ :headerName :columnIndex |
14411446
table addColumn: (SpStringTableColumn
1442-
title: headerName
1443-
evaluated: [ :rowWithName | rowWithName at: columnIndex + 1 ]) ].
1447+
title: headerName
1448+
evaluated: [ :rowWithName | rowWithName at: columnIndex + 1 ]) ].
14441449

14451450
table items: self asArrayOfRowsWithName.
14461451

0 commit comments

Comments
 (0)