Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nu444 committed Jun 19, 2024
1 parent 49d8004 commit 561a469
Show file tree
Hide file tree
Showing 40 changed files with 202 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
geometry
axisPadding

| paddedMaximumX paddedMaximumY paddingFactor|
| paddedMaximumX paddedMaximumY paddingFactorX paddingFactorY|

paddingFactor := (percentageBased) ifTrue: 1.0 ifFalse: self class defaultAxisValuePaddingFactor.
paddedMaximumX := (self xAxis maximum * paddingFactor) ceiling.
paddedMaximumY := ( self yAxis maximum * paddingFactor) ceiling.
paddingFactorX := self class defaultAxisValuePaddingFactor.
paddingFactorY := (percentageBased) ifTrue: 1.0 ifFalse: self class defaultAxisValuePaddingFactor.
paddedMaximumX := (self xAxis maximum * paddingFactorX) ceiling.
paddedMaximumY := ( self yAxis maximum * paddingFactorY) ceiling.

self xAxis maximum: paddedMaximumX.
self yAxis maximum: paddedMaximumY



Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"applyTheme:" : "ds 6/19/2020 19:54",
"axisColor:" : "ds 6/19/2020 19:54",
"axisNames" : "jk 8/4/2020 16:50",
"axisPadding" : "Nils Urban 6/7/2024 22:45",
"axisPadding" : " Nils Urban 6/19/2024 17:20",
"boundsThreshold" : "ds 6/19/2020 19:55",
"boundsThreshold:" : "ds 6/19/2020 19:56",
"centeredAxes" : "FM 7/9/2021 10:18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ event handling
mouseDown: anEvent

(anEvent yellowButtonPressed and: owner hasMultipleData)
ifTrue: [owner removeFromData: self].
anEvent hand waitForClicksOrDrag: self event: anEvent
ifTrue: [owner removeFromData: self.].
anEvent hand waitForClicksOrDrag: self event: anEvent.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"datapointIndex:" : "Nils Urban 6/13/2024 00:33",
"doubleClick:" : "JB 6/19/2024 02:27",
"handlesMouseDown:" : "ds 6/19/2020 19:12",
"mouseDown:" : "FM 8/6/2021 12:47",
"mouseDown:" : " Nils Urban 6/19/2024 18:17",
"round:to:" : "JB 6/19/2024 02:28",
"vector" : "ds 6/19/2020 19:12",
"vector:" : "ds 6/19/2020 19:12" } }
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ addSlider
contents: (Text fromString: 'haloo').

self sliderValueMorph: valueMorph.
self sliderMorph: sliderMorph.

self sendToCharts: sliderMorph getNumericValue.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
sliderMorph: aSlider

sliderMorph := aSlider
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
sliderMorph

^ sliderMorph
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"addChart:" : "jk 6/25/2020 22:27",
"addCoordinateSystem:" : "jk 6/24/2020 15:36",
"addLegend:" : "PAR 7/6/2021 07:54",
"addSlider" : "Nils Urban 6/13/2024 14:32",
"addSlider" : " Nils Urban 6/19/2024 17:39",
"applyColorTheme:" : "JB 6/9/2024 23:22",
"axisColor:" : "ds 6/19/2020 20:01",
"buttonHighlighting:" : "JB 6/18/2024 20:11",
Expand Down Expand Up @@ -62,6 +62,8 @@
"seriesCount" : "JB 6/10/2024 22:10",
"seriesCount:" : "JB 6/10/2024 22:11",
"showMean" : "JB 6/19/2024 01:56",
"sliderMorph" : " Nils Urban 6/19/2024 17:40",
"sliderMorph:" : " Nils Urban 6/19/2024 17:40",
"sliderValueMorph" : "Nils Urban 6/13/2024 11:44",
"sliderValueMorph:" : "Nils Urban 6/13/2024 11:45",
"stacked" : "Nils Urban 6/12/2024 14:48",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"commentStamp" : "jk 8/4/2020 18:12",
"instvars" : [
"sliderValueMorph",
"sliderMorph",
"seriesCount",
"dataCollection",
"charts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
testing
setUp

| diagram |
super setUp.
diagram := SWDiagram new.

self
data: SWDataStub createSeededXYZ;
diagram: (SWDiagram new visualize: self data with: SWBubblePlot);
bubblePlot: (self diagram charts) first
diagram: (diagram visualizeAll: self data with: SWBubblePlot);
bubblePlot: (self diagram charts) first.

diagram addSlider.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
testing
testBubblePlotVisualisation

self assert: self data size equals: self bubblePlot dataPoints size
self assert: self data first size equals: self bubblePlot dataPoints size
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
testing
testFiltering

| checkCollection |

self diagram sliderMorph setScaledValue: 8.5.

checkCollection := (self diagram charts first dataPoints select: [:dataPoint| dataPoint height = 0]).
self assert: (checkCollection size) equals: 2.

checkCollection := (self diagram charts second dataPoints select: [:dataPoint| dataPoint height = 0]).
self assert: (checkCollection size) equals: 2.

checkCollection := (self diagram charts third dataPoints select: [:dataPoint| dataPoint height = 0]).
self assert: (checkCollection size) equals: 3.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"data:" : "ds 6/19/2020 20:33",
"diagram" : "ds 6/19/2020 20:33",
"diagram:" : "ds 6/19/2020 20:33",
"setUp" : "JB 6/19/2024 02:57",
"testBubblePlotVisualisation" : "JB 6/19/2024 02:46" } }
"setUp" : " Nils Urban 6/19/2024 17:37",
"testBubblePlotVisualisation" : " Nils Urban 6/19/2024 17:35",
"testFiltering" : " Nils Urban 6/19/2024 17:33" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
helper
createSeededXYZ

^ SWDataUnlabeled fromXValues: {1 . 2 . 3 . 4 . 5} versusYValues: {5 . 200 . 38 . 69 . 16} versusZValues: {17 . 14 . 5 . 8 . 3}
| dataCollection |

dataCollection := OrderedCollection new.
dataCollection add: (SWDataUnlabeled fromXValues: {(1.5) . (2.5) . 3 . 4 . 5} versusYValues: {22 . 110 . 64 . 211 . 35} versusZValues: {9 . 20 . 3 . 7 . 12}).
dataCollection add: (SWDataUnlabeled fromXValues: {1 . 2 . 3 . 4 . 5} versusYValues: {5 . 200 . 38 . 69 . 16} versusZValues: {17 . 14 . 5 . 8 . 3}).
dataCollection add: (SWDataUnlabeled fromXValues: {1 . 2 . 3 . 4 . 5} versusYValues: {210 . 53 . 180 . 83 . 27} versusZValues: {6 . 3 . 9 . 7 . 11}).

^ dataCollection
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"createSeededNegative" : "jk 6/25/2020 15:15",
"createSeededRandom" : "jk 6/24/2020 16:13",
"createSeededWithTwoCategories" : "PAR 5/27/2021 20:51",
"createSeededXYZ" : "JB 6/19/2024 02:45" },
"createSeededXYZ" : " Nils Urban 6/19/2024 17:31" },
"instance" : {
} }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
configureDiagram

self diagram normalized: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
as yet unclassified
testNormalization

| summedValues |

summedValues := (Array new: 5) collect: [:a | 0].

self assert: ((self diagram charts at: 3) data first y) equals: 37.5.
self assert: ((self diagram charts at: 2) data first y) equals: 50.
self assert: ((self diagram charts at: 1) data first y) equals: 12.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"class" : {
},
"instance" : {
"configureDiagram" : " Nils Urban 6/19/2024 17:25",
"testNormalization" : " Nils Urban 6/19/2024 17:26" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "StatisticsWorkbench-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SWNormalizedTest",
"pools" : [
],
"super" : "SWPreprocessingTest",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
configureDiagram

^self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
dataCollection: aDataCollection

^ dataCollection := aDataCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
dataCollection

^ dataCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
diagram: aDiagram

^ diagram := aDiagram
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
diagram

^ diagram
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
as yet unclassified
setUp

| data1 data2 data3 dataCollection|

data1 := SWDataUnlabeled fromDataPointCollections: #(#(1 3) #(2 2) #(3 3) #(4 2) #(5 3)).
data2 := SWDataUnlabeled fromDataPointCollections: #(#(1 4) #(2 1) #(3 2) #(4 4) #(5 1)).
data3 := SWDataUnlabeled fromDataPointCollections: #(#(1 1) #(2 2) #(3 1) #(4 2) #(5 1)).

dataCollection := OrderedCollection new.
dataCollection
add: data1;
add: data2;
add: data3.

self diagram: SWDiagram new.
self configureDiagram.

self dataCollection: dataCollection;
diagram: (self diagram visualizeAll: dataCollection with: SWAreaChart)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"class" : {
},
"instance" : {
"configureDiagram" : " Nils Urban 6/19/2024 17:23",
"dataCollection" : " Nils Urban 6/19/2024 17:27",
"dataCollection:" : " Nils Urban 6/19/2024 17:27",
"diagram" : " Nils Urban 6/19/2024 17:27",
"diagram:" : " Nils Urban 6/19/2024 17:27",
"setUp" : " Nils Urban 6/19/2024 17:24" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category" : "StatisticsWorkbench-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"dataCollection",
"diagram" ],
"name" : "SWPreprocessingTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
configureDiagram

self diagram stacked: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
as yet unclassified
testSum

| summedValues |

summedValues := (Array new: 5) collect: [:a | 0].

self assert: ((self diagram charts at: 3) data collect: [:vector | vector y]) equals: #(3 2 3 2 3) asOrderedCollection.
self assert: ((self diagram charts at: 2) data collect: [:vector | vector y]) equals: #(7 3 5 6 4) asOrderedCollection.
self assert: ((self diagram charts at: 1) data collect: [:vector | vector y]) equals: #(8 5 6 8 5) asOrderedCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"class" : {
},
"instance" : {
"configureDiagram" : " Nils Urban 6/19/2024 17:25",
"testSum" : " Nils Urban 6/19/2024 17:25" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "StatisticsWorkbench-Tests",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SWStackedTest",
"pools" : [
],
"super" : "SWPreprocessingTest",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ testRemoveOnlyOneBarOnUserInput
| selectedDataPoint size |

self diagram openInWorld: self world.
size := self data size.
size := (self data select: [:vector | vector y ~= 0] ) size.
selectedDataPoint := self barChart bars detect: [:dataPoint | dataPoint vector x = 1 and: dataPoint vector y = 3 ].
self hand handleEvent: (self yellowMouseDownAt: (selectedDataPoint center)).
self assert: size = (self data size + 1)
self assert: size = ((self data select: [:vector | vector y ~= 0] ) size + 1)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"setUp" : "JB 6/8/2024 19:45",
"testRemoveBarOnUserInput" : "Nils Urban 5/27/2024 15:07",
"testRemoveBarOnUserInputInWindow" : "PAR 8/6/2021 13:11",
"testRemoveOnlyOneBarOnUserInput" : "FM 6/27/2021 16:09",
"testRemoveOnlyOneBarOnUserInput" : " Nils Urban 6/19/2024 17:46",
"testXYPopupCorrectLabel" : "FM 5/30/2021 10:34",
"testXYPopupOnHover" : "FM 5/30/2021 11:19" } }
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ testRemoveOnUserInput
size := self pieChart pieSlices size.
self assert: (self pieChart data contains: [:data | data x = 3 and: data y = 30]) .
selectedDataPoint := self pieChart pieSlices detect: [:dataPoint | dataPoint vector x = 3 and: dataPoint vector y = 30].
self hand handleEvent: (self yellowMouseDownAt: selectedDataPoint slice center + self clickOffset).
self hand handleEvent: (self yellowMouseDownAt: selectedDataPoint slice center "+ self clickOffset").
self diagram charts first removeFromData: selectedDataPoint.
self deny: (self pieChart data contains: [:data | data x = 3 and: data y = 30]).
self assert: self pieChart pieSlices size = (size - 1)
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ testRemoveOnlyOneOnUserInput
self diagram openInWorld: self world.
size := self pieChart pieSlices size.
selectedDataPoint := self pieChart pieSlices detect: [:dataPoint | dataPoint vector x = 3 and: dataPoint vector y = 30].
self hand handleEvent: (self yellowMouseDownAt: selectedDataPoint slice center + self clickOffset).
self diagram charts first removeFromData: selectedDataPoint.
self assert: self pieChart pieSlices size = (size - 1)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"pieChart" : "FM 6/27/2021 16:13",
"pieChart:" : "FM 6/27/2021 16:12",
"setUp" : "JB 6/8/2024 19:46",
"testRemoveOnUserInput" : "JB 6/19/2024 12:07",
"testRemoveOnUserInputInWindow" : "Nils Urban 5/27/2024 15:07",
"testRemoveOnlyOneOnUserInput" : "Nils Urban 5/27/2024 15:07",
"testRemoveOnUserInput" : " Nils Urban 6/19/2024 18:18",
"testRemoveOnUserInputInWindow" : " Nils Urban 6/19/2024 18:23",
"testRemoveOnlyOneOnUserInput" : " Nils Urban 6/19/2024 18:21",
"testRemoveOnlyOneOnUserInputInWindow" : "Nils Urban 5/27/2024 15:07" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
},
"instance" : {
"clickOffset" : "JB 6/19/2024 12:08",
"clickOffset" : " Nils Urban 6/19/2024 18:19",
"data" : "FM 6/27/2021 16:03",
"data:" : "FM 6/27/2021 16:04",
"diagram" : "FM 6/27/2021 16:06",
Expand Down

0 comments on commit 561a469

Please sign in to comment.