Skip to content

Commit

Permalink
Update deprecated addPlot: -> add:
Browse files Browse the repository at this point in the history
  • Loading branch information
Hernán Morales Durand committed Dec 27, 2023
1 parent d73c216 commit c404883
Show file tree
Hide file tree
Showing 25 changed files with 267 additions and 227 deletions.
14 changes: 8 additions & 6 deletions src/AI-DataFrameInspector/AISpAbstractToolbarCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
I am an abstract class for the toolbar buttons of the evaluator in the data frame inspector. If you want to add a new button to the toolbar, just create a subclass of me and add the behaviour.
"
Class {
#name : #AISpAbstractToolbarCommand,
#superclass : #CmCommand,
#category : #'AI-DataFrameInspector-Toolbar evaluator commands'
#name : 'AISpAbstractToolbarCommand',
#superclass : 'CmCommand',
#category : 'AI-DataFrameInspector-Toolbar evaluator commands',
#package : 'AI-DataFrameInspector',
#tag : 'Toolbar evaluator commands'
}

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractToolbarCommand class >> defaultIconName [

^ self subclassResponsibility
]

{ #category : #accessing }
{ #category : 'accessing' }
AISpAbstractToolbarCommand class >> order [

^ self subclassResponsibility
]

{ #category : #accessing }
{ #category : 'accessing' }
AISpAbstractToolbarCommand class >> toolbarButtons [

^ self allSubclasses sorted: #order ascending
Expand Down
26 changes: 14 additions & 12 deletions src/AI-DataFrameInspector/AISpAbstractVisualizerPresenter.class.st
Original file line number Diff line number Diff line change
@@ -1,61 +1,63 @@
Class {
#name : #AISpAbstractVisualizerPresenter,
#superclass : #SpRoassalPresenter,
#name : 'AISpAbstractVisualizerPresenter',
#superclass : 'SpRoassalPresenter',
#traits : 'SpTModel',
#classTraits : 'SpTModel classTrait',
#instVars : [
'numberOfBins'
],
#category : #'AI-DataFrameInspector-Main presenters'
#category : 'AI-DataFrameInspector-Main presenters',
#package : 'AI-DataFrameInspector',
#tag : 'Main presenters'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
AISpAbstractVisualizerPresenter class >> openOn: aModel [

^ (self on: aModel) open
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> allColumnValuesWithColumnName [
" Private - Answer a <Collection> of <Association> with numeric column values in the receiver's data frame "

^ self subclassResponsibility
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> defaultNumberOfBins [

^ 50
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> initializePresenters [

self canvas: RSCanvas new.
self plotAllHistograms: self canvas.
self refresh
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> numberOfBins [

^ numberOfBins ifNil: [ numberOfBins := self defaultNumberOfBins ]
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> numberOfBins: aNumber [

numberOfBins := aNumber.
self initializePresenters
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> numericColumnNames [

^ self model numericColumnNames
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> plotAllHistograms: aCanvas [

| shapes |
Expand All @@ -79,7 +81,7 @@ AISpAbstractVisualizerPresenter >> plotAllHistograms: aCanvas [
for: self
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAbstractVisualizerPresenter >> plotHistogram: columnAssoc [

| container c columnValues plot vertical horizontal |
Expand Down
32 changes: 17 additions & 15 deletions src/AI-DataFrameInspector/AISpAddRowPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This window has these fields:
After entering each item under the specific column, the 'enter' key must be hit.
"
Class {
#name : #AISpAddRowPresenter,
#superclass : #AISpDataFramePresenter,
#name : 'AISpAddRowPresenter',
#superclass : 'AISpDataFramePresenter',
#instVars : [
'sortType',
'columnName',
Expand All @@ -30,31 +30,33 @@ Class {
'cancelButton',
'dataRows'
],
#category : #'AI-DataFrameInspector-sub presenters'
#category : 'AI-DataFrameInspector-sub presenters',
#package : 'AI-DataFrameInspector',
#tag : 'sub presenters'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
AISpAddRowPresenter class >> openOn: aDataFrame [

^ (self on: aDataFrame) open
]

{ #category : #adding }
{ #category : 'adding' }
AISpAddRowPresenter >> addButtonAction [

newRow name: newRowName text.
dataFrame addRow: newRow atPosition: positionInput number.
self window close
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> connectPresenters [

addButton action: [ self addButtonAction ].
resetButton action: [ self resetButtonAction ]
]

{ #category : #layout }
{ #category : 'layout' }
AISpAddRowPresenter >> defaultLayout [

| topLayout bottomLayout |
Expand Down Expand Up @@ -84,7 +86,7 @@ AISpAddRowPresenter >> defaultLayout [
yourself
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> initializeAddResetButtons [

addButton := self newButton
Expand All @@ -95,7 +97,7 @@ AISpAddRowPresenter >> initializeAddResetButtons [
icon: (self iconNamed: #refreshIcon)
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> initializeNewRowInputTable [

emptyRow := dataFrame rowsFrom: 1 to: 1.
Expand All @@ -120,7 +122,7 @@ AISpAddRowPresenter >> initializeNewRowInputTable [
newRowInputTable items: emptyRow asArrayOfRowsWithName
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
AISpAddRowPresenter >> initializeNewRowName [

newRowName := self newTextInput
Expand All @@ -129,7 +131,7 @@ AISpAddRowPresenter >> initializeNewRowName [
yourself
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> initializePositionInput [

positionInput := self newNumberInput
Expand All @@ -138,7 +140,7 @@ AISpAddRowPresenter >> initializePositionInput [
yourself
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> initializePresenters [

self initializeNewRowName.
Expand All @@ -147,7 +149,7 @@ AISpAddRowPresenter >> initializePresenters [
self initializeAddResetButtons
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
AISpAddRowPresenter >> initializeRowInputTable [

emptyRow := dataFrame rowsFrom: 1 to: 1.
Expand All @@ -172,7 +174,7 @@ AISpAddRowPresenter >> initializeRowInputTable [
rowInputTable items: emptyRow asArrayOfRowsWithName
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> initializeWindow: aWindowPresenter [

aWindowPresenter
Expand All @@ -183,7 +185,7 @@ AISpAddRowPresenter >> initializeWindow: aWindowPresenter [
positionInput number: dataFrame numberOfRows + 1 ]
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpAddRowPresenter >> resetButtonAction [

self initializeNewRowInputTable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@ Internal Representation and Key Implementation Points.
Implementation Points
"
Class {
#name : #AISpDataFrameAbstractPresenter,
#superclass : #SpPresenter,
#name : 'AISpDataFrameAbstractPresenter',
#superclass : 'SpPresenter',
#instVars : [
'dataFrame'
],
#category : #'AI-DataFrameInspector-Sub presenters'
#category : 'AI-DataFrameInspector-Sub presenters',
#package : 'AI-DataFrameInspector',
#tag : 'Sub presenters'
}

{ #category : #accessing }
{ #category : 'accessing' }
AISpDataFrameAbstractPresenter >> dataFrame [

^ dataFrame
]

{ #category : #accessing }
{ #category : 'accessing' }
AISpDataFrameAbstractPresenter >> dataFrame: anObject [

dataFrame := anObject
]

{ #category : #'accessing - model' }
{ #category : 'accessing - model' }
AISpDataFrameAbstractPresenter >> setModelBeforeInitialization: aDomainObject [

dataFrame := aDomainObject
Expand Down
22 changes: 12 additions & 10 deletions src/AI-DataFrameInspector/AISpDataFrameBasicInfoPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,31 @@ Internal Representation and Key Implementation Points.
Implementation Points
"
Class {
#name : #AISpDataFrameBasicInfoPresenter,
#superclass : #AISpDataFrameAbstractPresenter,
#name : 'AISpDataFrameBasicInfoPresenter',
#superclass : 'AISpDataFrameAbstractPresenter',
#instVars : [
'dataFrameBasicInfoPresenter'
],
#category : #'AI-DataFrameInspector-Sub presenters'
#category : 'AI-DataFrameInspector-Sub presenters',
#package : 'AI-DataFrameInspector',
#tag : 'Sub presenters'
}

{ #category : #accessing }
{ #category : 'accessing' }
AISpDataFrameBasicInfoPresenter >> dataFrameBasicInfoPresenter [

^ dataFrameBasicInfoPresenter
]

{ #category : #layout }
{ #category : 'layout' }
AISpDataFrameBasicInfoPresenter >> defaultLayout [

^ SpBoxLayout newTopToBottom
add: dataFrameBasicInfoPresenter;
yourself
]

{ #category : #initialization }
{ #category : 'initialization' }
AISpDataFrameBasicInfoPresenter >> initializePresenters [

dataFrameBasicInfoPresenter := self newTable.
Expand All @@ -52,7 +54,7 @@ AISpDataFrameBasicInfoPresenter >> initializePresenters [
beSortable)
]

{ #category : #'private building' }
{ #category : 'private building' }
AISpDataFrameBasicInfoPresenter >> summaryDescriptions [

^ Dictionary new
Expand All @@ -62,19 +64,19 @@ AISpDataFrameBasicInfoPresenter >> summaryDescriptions [
yourself
]

{ #category : #'private building' }
{ #category : 'private building' }
AISpDataFrameBasicInfoPresenter >> summaryDescriptionsLabels [

^ self summaryDescriptions keys asSortedCollection
]

{ #category : #'private building' }
{ #category : 'private building' }
AISpDataFrameBasicInfoPresenter >> summaryDescriptorsAt: aString [

^ self summaryDescriptions at: aString
]

{ #category : #'private building' }
{ #category : 'private building' }
AISpDataFrameBasicInfoPresenter >> summaryValueFor: aString [

^ (self dataFrame perform: (self summaryDescriptorsAt: aString)) asString
Expand Down
14 changes: 8 additions & 6 deletions src/AI-DataFrameInspector/AISpDataFrameCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
Abstract class for context commands related with DataFrame inspector.
"
Class {
#name : #AISpDataFrameCommand,
#superclass : #CmCommand,
#category : #'AI-DataFrameInspector-Context menu commands'
#name : 'AISpDataFrameCommand',
#superclass : 'CmCommand',
#category : 'AI-DataFrameInspector-Context menu commands',
#package : 'AI-DataFrameInspector',
#tag : 'Context menu commands'
}

{ #category : #accessing }
{ #category : 'accessing' }
AISpDataFrameCommand >> dataFrame [

^ self context dataFrame
]

{ #category : #accessing }
{ #category : 'accessing' }
AISpDataFrameCommand >> selectedItem [

^ self context dataFramePresenter selectedItem
]

{ #category : #accessing }
{ #category : 'accessing' }
AISpDataFrameCommand >> selectedItems [

^ self context selectedItems
Expand Down
Loading

0 comments on commit c404883

Please sign in to comment.