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 e15934e commit 796a281
Show file tree
Hide file tree
Showing 54 changed files with 157 additions and 118 deletions.
35 changes: 8 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,33 +134,14 @@ graph showMean.

You can also interact with the diagram, for example by right-clicking on data points to delete them from the diagram. This functionality can be used to exclude outliers.

## List of all currently available charts:

**Charts for single y-axis:**
- Piechart
- Barchart
- LineCharts
- AreaChart
- Scatterplot
- SpiderChart
- Normalized BarChart
- Normalized AreaChart

**Charts that are capable of multiple y-axes:**
- Barchart
- LineCharts
- AreaChart
- Scatterplot
- SpiderChart
- Normalized BarChart
- Normalized AreaChart

Here is an example of how to create a stacked chart for multiple y-axes:
```smalltalk
(SWDiagram new stacked: true;
visualizeAll: dataCollection with: SWBarChart) openInWindowLabeled: ''
```
Here "dataCollection" is of type OrderedCollection with elemets from SWDataLabeled or SWDataUnlabeled.
Another way of accesing the StatisticsWorkBench tool is the brand new user interface. This can be opened by calling

```smalltalk
SWMainformModel open.
```

This brings up a small window, where you can choose a CSV file, that you want to open. Then you can type in the delimeter and escape character used in the file and choose the axes that you want to use. You can also categorize the data, if it contains more than two dimensions. After picking the chart types you want to visualize by clicking on them in the menu you can click the visualize button and a window opens.
f type OrderedCollection with elemets from SWDataLabeled or SWDataUnlabeled.

## The Statistic Workbench UI
Another way of accesing the StatisticsWorkBench tool is the brand new user interface. This can be opened by calling
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
x

^ self first
^ self asPoint x
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
">" : "ds 6/19/2020 18:36",
">=" : "ds 6/19/2020 18:36",
"addToSWData:" : "ds 6/19/2020 18:36",
"asPoint" : "JB 6/19/2024 11:47",
"asPoint" : "Nils Urban 6/13/2024 10:28",
"at:put:" : "ds 6/19/2020 18:36",
"dimensions" : "ds 6/19/2020 18:36",
"hasSameLabelName:" : "ds 6/19/2020 18:36",
Expand All @@ -20,6 +20,6 @@
"labelName:" : "ds 6/19/2020 19:26",
"misc" : "PAR 6/8/2021 10:19",
"misc:" : "PAR 6/7/2021 21:57",
"x" : "JB 6/19/2024 11:52",
"y" : "JB 6/19/2024 11:53",
"x" : "Nils Urban 5/28/2024 13:35",
"y" : "ds 6/19/2020 18:36",
"z" : "Nils Urban 6/13/2024 10:03" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ as yet unclassified
createLineMorph

^ PolygonMorph new
borderWidth: self class defaultBorderWidth;
borderColor: self class defaultBorderColor;
color: self class defaultBorderColor;
yourself
borderWidth: self class defaultBorderWidth;
borderColor: self class defaultBorderColor;
color: self class defaultBorderColor;
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"create" : "Nils Urban 5/28/2024 10:10" },
"instance" : {
"addDatapointsToLine" : "Nils Urban 6/12/2024 14:38",
"createLineMorph" : "JB 6/18/2024 22:50",
"createLineMorph" : "Nils Urban 6/7/2024 09:59",
"createVertices" : "Nils Urban 5/28/2024 10:47",
"initialize" : "Nils Urban 6/12/2024 14:39",
"update" : "Nils Urban 6/7/2024 10:04" } }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
as yet unclassified
receiveValue: aValue
recieveValue: aValue

self threshold: aValue.
self update.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
as yet unclassified
scaledBubbleSize: aSize

^ (aSize) / (self diagram globalMaximum: #z) * (self dynamicMaxBubbleSize)
^ (aSize)/(self diagram globalMaximum: #z) * (self dynamicMaxBubbleSize)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"createDataPoint:" : " Nils Urban 6/17/2024 15:36",
"dynamicMaxBubbleSize" : " Nils Urban 6/19/2024 13:21",
"initialize" : "Nils Urban 6/13/2024 11:27",
"receiveValue:" : "JB 6/19/2024 02:39",
"scaledBubbleSize:" : "JB 6/19/2024 02:38",
"recieveValue:" : "Nils Urban 6/13/2024 11:21",
"scaledBubbleSize:" : "Nils Urban 6/13/2024 14:18",
"threshold" : "Nils Urban 6/13/2024 11:20",
"threshold:" : "Nils Urban 6/13/2024 11:20" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
adding/removing
receiveValue: aValue
recieveValue: aValue

^ self subclassResponsibility
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"needsLegend" : "PAR 7/2/2021 11:58",
"originalData" : "Nils Urban 6/12/2024 15:29",
"originalData:" : "Nils Urban 6/12/2024 15:30",
"receiveValue:" : "JB 6/19/2024 02:39",
"recieveValue:" : "Nils Urban 6/13/2024 11:19",
"remove:" : "ds 6/19/2020 18:52",
"removeAll" : "ds 6/19/2020 18:52",
"removeFrom:" : "jk 8/4/2020 18:12",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
datapointIndex

^ datapointIndex
^datapointIndex
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ event handling
doubleClick: anEvent

| explorer |

explorer := ToolBuilder build: (ObjectExplorer explore: self).
explorer openInHand
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
round: aNumber to: aBaseNumber

| result |
|result|
result := aNumber roundTo: aBaseNumber.
(result truncated = result) ifTrue: [result := result truncated].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"class" : {
},
"instance" : {
"datapointIndex" : "JB 6/19/2024 02:27",
"datapointIndex" : "Nils Urban 6/13/2024 00:33",
"datapointIndex:" : "Nils Urban 6/13/2024 00:33",
"doubleClick:" : "JB 6/19/2024 02:27",
"doubleClick:" : "jk 6/18/2020 19:02",
"handlesMouseDown:" : "ds 6/19/2020 19:12",
"mouseDown:" : " Nils Urban 6/17/2024 15:56",
"round:to:" : "JB 6/19/2024 02:28",
"round:to:" : "Nils Urban 6/12/2024 14:32",
"vector" : "ds 6/19/2020 19:12",
"vector:" : "ds 6/19/2020 19:12" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultBounds

^ (0 @ 0) corner: (0 @ 0)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"class" : {
"create" : "FM 7/11/2021 13:41",
"defaultBounds" : "ds 6/19/2020 20:00",
"defaultBoundsThreshold" : "JB 6/9/2024 00:24",
"defaultColor" : "ds 6/19/2020 20:00",
"defaultLength" : "ds 6/19/2020 20:00",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ visualization
buttonHighlighting: aButton

| highlight unhighlight |
highlight := [aButton color: Color veryVeryLightGray].
highlight := [aButton color: Color veryLightGray].
unhighlight := [aButton color: Color white].
aButton on: #mouseEnter send: #value to: highlight.
aButton on: #mouseLeave send: #value to: unhighlight.
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
visualization
createIMGExportBtn

| button icon titleBarHeight |

titleBarHeight := self getTitleBarHeight.
| button icon |
button := SimpleButtonMorph new.
button
label: '';
color: Color white;
extent: (1.8 * titleBarHeight) @ (0.8 * titleBarHeight);
extent: 45 @ 35;
target: self;
actionSelector: #exportIMG;
position: self position + (2 * titleBarHeight @ 0 - titleBarHeight);
position: self position;
cornerStyle: #rounded;
borderWidth: 0.1 * titleBarHeight.
borderWidth: 3;
borderColor: Color black.
icon := self loadExportIconFor: button.
icon position: button position + (button extent - icon extent // 2).
button addMorph: icon.
icon position: button position + (button extent - icon extent // 2).
self
buttonHighlighting: button;
exportButton: button;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
adding/removing
deleteChart: aSWChart

| chartType |
|chartType|
chartType := aSWChart class.
self dataCollection remove: (aSWChart originalData).
aSWChart delete.
self charts do: [:aChart | aChart delete].
self charts do:[:aChart | aChart delete].
self charts removeAll.
self visualizeAll: (self dataCollection) with: (chartType).
self update
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
geometry
extent: aPoint
|width|
width := 0.
self submorphsDo: [:each | each class = SWKey ifTrue: [width := each submorphs last extent x]].

super extent: aPoint.
self resizeCharts.
self updateHPILogo.
(self hasLegend)
ifTrue:[self updateLegend.self updateLegend].
(self hasCoordinateSystem)
ifTrue: [self coordinateSystem extent: aPoint - (width @ 20)].
ifTrue: [self coordinateSystem extent: aPoint].
(self hasChart)
ifTrue: [self updateCharts]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ accessing
sendToCharts: aValue

| newValueString |
self charts do: [:aChart | aChart receiveValue: aValue].
self charts do: [:aChart | aChart recieveValue: aValue].
newValueString := (aValue roundTo: 0.01) asString.
newValueString := newValueString copyFrom: 1 to:(newValueString size min: 4).
self sliderValueMorph contents: (Text fromString: newValueString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ showMean
meanData := SWDataUnlabeled create.

0 to: (self charts first data size) do: [:i | meanData add: (Array with: i with: meanValue)].
self visualize: meanData with: SWLineChart.
self visualize: meanData with: SWLineChart create.

^ meanData
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ updating
updateLegend

self legend topLeft: self topRight.
self legend key topRight: self topRight.
self legend key topLeft: self topRight.
self removeLegend.
(self hasChart) ifTrue: [
self legend drawKeyFor: self collectKeyData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ visualize: aSWData original: aSWOriginalData with: aSWChart
chart diagram: self.
(chart isKindOf: SWSpiderChart)
ifTrue: [chart data: (self transformToSpiderData: aSWData)]
ifFalse: [chart data: aSWData].
chart originalData: aSWOriginalData.
ifFalse: [chart data: aSWData. chart originalData: aSWOriginalData].

(chart needsCoordinateSystem)
ifTrue: [self coordinateSystem diagram: self]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ visualize: aSWData with: aSWChart
chart diagram: self.
(chart isKindOf: SWSpiderChart)
ifTrue: [chart data: (self transformToSpiderData: aSWData)]
ifFalse: [chart data: aSWData].
chart originalData: aSWData.
ifFalse: [chart data: aSWData. chart originalData: aSWData].

(chart needsCoordinateSystem)
ifTrue: [self coordinateSystem diagram: self]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"addSlider" : " Nils Urban 6/19/2024 13:13",
"applyColorTheme:" : "JB 6/9/2024 23:22",
"axisColor:" : "ds 6/19/2020 20:01",
"buttonHighlighting:" : "JB 6/18/2024 20:11",
"buttonHighlighting:" : "JB 6/9/2024 00:05",
"centerAxes" : "jk 7/15/2020 15:58",
"charts" : "jk 6/25/2020 22:26",
"charts:" : "ds 6/19/2020 20:02",
Expand All @@ -19,20 +19,19 @@
"colorTheme:" : "ds 6/19/2020 20:02",
"coordinateSystem" : "ds 6/19/2020 20:02",
"coordinateSystem:" : "jk 6/24/2020 15:40",
"createIMGExportBtn" : "JB 6/18/2024 20:12",
"createLegend" : "JB 6/19/2024 01:48",
"createIMGExportBtn" : "JB 6/10/2024 22:08",
"createLegend" : "PAR 7/13/2021 12:38",
"dataCollection" : "Nils Urban 6/12/2024 14:58",
"dataCollection:" : "Nils Urban 6/12/2024 14:59",
"deleteChart:" : "JB 6/19/2024 03:01",
"deleteChart:" : "Nils Urban 6/12/2024 16:32",
"deleteCoordinateSystem" : "jk 8/4/2020 18:11",
"dimensionNames" : "jk 8/4/2020 17:03",
"disableBordersOnFocus" : "FM 5/10/2021 20:59",
"exportButton" : "JB 6/9/2024 00:40",
"exportButton:" : "JB 6/9/2024 00:40",
"exportIMG" : "JB 6/9/2024 01:06",
"extent:" : "NK 6/18/2024 11:51",
"extent:" : "JB 6/9/2024 23:12",
"getColor:for:" : "FM 8/2/2021 19:30",
"getTitleBarHeight" : "JB 6/18/2024 19:53",
"globalMaximum:" : "Nils Urban 6/13/2024 14:15",
"globalMinimum:" : "Nils Urban 6/13/2024 14:16",
"handlesMouseDown:" : "FM 5/10/2021 20:42",
Expand All @@ -44,7 +43,7 @@
"insertHPILogo" : "JB 6/9/2024 23:17",
"legend" : "JB 6/9/2024 00:41",
"legend:" : "PAR 7/2/2021 12:23",
"loadExportIconFor:" : "JB 6/18/2024 20:04",
"loadExportIconFor:" : "JB 6/8/2024 23:58",
"logo" : "JB 6/9/2024 23:08",
"logo:" : "JB 6/9/2024 23:08",
"maximumDimension" : "FM 7/11/2021 16:47",
Expand All @@ -58,10 +57,10 @@
"removeLegend" : "PAR 7/13/2021 12:17",
"resetButtonColor" : "JB 6/8/2024 23:30",
"resizeCharts" : "JB 6/9/2024 22:55",
"sendToCharts:" : "JB 6/19/2024 02:39",
"sendToCharts:" : "Nils Urban 6/13/2024 12:24",
"seriesCount" : "JB 6/10/2024 22:10",
"seriesCount:" : "JB 6/10/2024 22:11",
"showMean" : "JB 6/19/2024 01:56",
"showMean" : "jk 8/4/2020 17:57",
"sliderMorph" : " Nils Urban 6/19/2024 13:12",
"sliderMorph:" : " Nils Urban 6/19/2024 13:12",
"sliderValueMorph" : "Nils Urban 6/13/2024 11:44",
Expand All @@ -77,9 +76,9 @@
"updateColors" : "jk 8/4/2020 18:16",
"updateCoordinateSystem" : "jk 7/15/2020 15:49",
"updateHPILogo" : "JB 6/9/2024 23:14",
"updateLegend" : "NK 6/18/2024 11:15",
"updateLegend" : "PAR 7/13/2021 13:21",
"visualize:and:with:and:" : "ds 6/19/2020 20:05",
"visualize:original:with:" : "JB 6/19/2024 01:25",
"visualize:with:" : "JB 6/19/2024 01:25",
"visualize:original:with:" : "Nils Urban 6/14/2024 15:05",
"visualize:with:" : "Nils Urban 6/14/2024 15:05",
"visualize:with:and:" : "JB 6/8/2024 17:56",
"visualizeAll:with:" : " Nils Urban 6/17/2024 16:27" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultStepInterval

^ 3
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
adding/removing
add: aSWVector

self vertices add: aSWVector asPoint.
self vertices add: aSWVector key asPoint.
self changed: self
Loading

0 comments on commit 796a281

Please sign in to comment.