Skip to content

Commit 2c84554

Browse files
author
Hernán Morales Durand
committed
Add compatibility method because Roassal chart class name changes between different Pharo versions
1 parent cb9a018 commit 2c84554

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/Math-Visualizations/PMPrincipalComponentAnalyserSVD.extension.st

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Extension { #name : 'PMPrincipalComponentAnalyserSVD' }
1+
Extension { #name : #PMPrincipalComponentAnalyserSVD }
22

3-
{ #category : '*Math-Visualizations' }
3+
{ #category : #'*Math-Visualizations' }
44
PMPrincipalComponentAnalyserSVD class >> example1 [
55
"Extract 4 columns from original data"
66

@@ -28,7 +28,7 @@ PMPrincipalComponentAnalyserSVD class >> example1 [
2828
addColumn: (irisDataFrame columnsFrom: 5 to: 5) asArrayOfColumns first
2929
named: 'type'.
3030

31-
roassalChart := RSCompositeChart new
31+
roassalChart := self roassalChartClass new
3232
title: 'PCA of Iris Data Frame';
3333
addDecoration: (RSHorizontalTick new doNotUseNiceLabel asFloat: 3);
3434
addDecoration: RSVerticalTick new;
@@ -49,7 +49,7 @@ PMPrincipalComponentAnalyserSVD class >> example1 [
4949

5050
]
5151

52-
{ #category : '*Math-Visualizations' }
52+
{ #category : #'*Math-Visualizations' }
5353
PMPrincipalComponentAnalyserSVD class >> example2 [
5454
"Extract 4 columns from original data. This example uses Random colors for each flower type"
5555

@@ -81,3 +81,12 @@ PMPrincipalComponentAnalyserSVD class >> example2 [
8181
openScatterPlotWithTitle: 'PCA of Iris data set'
8282
forColumn: 'type'.
8383
]
84+
85+
{ #category : #'*Math-Visualizations' }
86+
PMPrincipalComponentAnalyserSVD class >> roassalChartClass [
87+
88+
^ SystemVersion current major < 12
89+
ifTrue: [ Smalltalk at: #RSChart ]
90+
ifFalse: [ Smalltalk at: #RSCompositeChart ]
91+
92+
]

src/Math-Visualizations/package.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Package { #name : 'Math-Visualizations' }
1+
Package { #name : #'Math-Visualizations' }

0 commit comments

Comments
 (0)