Improving DataFrame views. DataFrame needs to be added in the dependencies.
This commit is contained in:
parent
536d2a9326
commit
428936c1a7
19
src/MiniDocs/DataFrame.extension.st
Normal file
19
src/MiniDocs/DataFrame.extension.st
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Extension { #name : #DataFrame }
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
DataFrame >> viewDataFor: aView [
|
||||||
|
<gtView>
|
||||||
|
| columnedList |
|
||||||
|
self numberOfRows >= 1 ifFalse: [ ^ aView empty ].
|
||||||
|
columnedList := aView columnedList
|
||||||
|
title: 'Data';
|
||||||
|
items: [ self transposed columns ];
|
||||||
|
priority: 40.
|
||||||
|
self columnNames
|
||||||
|
withIndexDo: [:aName :anIndex |
|
||||||
|
columnedList
|
||||||
|
column: aName
|
||||||
|
text: [:anItem | anItem at: anIndex ]
|
||||||
|
].
|
||||||
|
^ columnedList
|
||||||
|
]
|
@ -20,6 +20,17 @@ String >> asDashedLowercase [
|
|||||||
^ '-' join: (self substrings collect: [:each | each asLowercase ])
|
^ '-' join: (self substrings collect: [:each | each asLowercase ])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*MiniDocs' }
|
||||||
|
String >> asInteger [
|
||||||
|
"Return the integer present in the receiver, or nil. In case of float, returns the integer part."
|
||||||
|
"'1' asInteger >>> 1"
|
||||||
|
"'-1' asInteger >>> -1"
|
||||||
|
"'10' asInteger >>> 10"
|
||||||
|
"'a' asInteger >>> nil"
|
||||||
|
"'1.234' asInteger >>> 1"
|
||||||
|
^ (self copyWithoutAll: '_') asSignedInteger
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #'*MiniDocs' }
|
{ #category : #'*MiniDocs' }
|
||||||
String >> contentsWithoutYAMLMetadata [
|
String >> contentsWithoutYAMLMetadata [
|
||||||
| newContents |
|
| newContents |
|
||||||
|
Loading…
Reference in New Issue
Block a user