Skip to content

Commit

Permalink
Merge origin/dev into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nu444 committed Jul 8, 2024
2 parents 0b9bb6f + fe5bb52 commit 1b39a0a
Show file tree
Hide file tree
Showing 118 changed files with 329 additions and 410 deletions.
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<p align="center"><img width="200" height="200" src="https://github.com/hpi-swa-teaching/StatisticsWorkbench/blob/745c8d8d15afdd32273f4cc16a225b2b77bbdb9c/sw_logo.png?raw=true" alt="StatisticsWorkbench-Logo"></p>

# Statistics Workbench
<h1 align="center" style=font-size:170px>StatisticsWorkbench</h1>

dev:
[![CI](https://github.com/hpi-swa-teaching/StatisticsWorkbench/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/hpi-swa-teaching/StatisticsWorkbench/actions/workflows/ci.yml)
[![Build Status](https://api.travis-ci.org/hpi-swa-teaching/StatisticsWorkbench.svg?branch=dev)](https://travis-ci.org/hpi-swa-teaching/StatisticsWorkbench)
[![Commit](https://img.shields.io/github/last-commit/hpi-swa-teaching/StatisticsWorkbench?style=flat)](https://github.com/hpi-swa-teaching/StatisticsWorkbenchStatisticsWorkbench/commits/)
[![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/StatisticsWorkbench/badge.svg?branch=dev)](https://coveralls.io/github/hpi-swa-teaching/StatisticsWorkbench?branch=dev)

(SWT21-Project-16)
[![CI](https://github.com/hpi-swa-teaching/StatisticsWorkbench/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/hpi-swa-teaching/StatisticsWorkbench/actions/workflows/ci.yml)

Statistics Workbench is a tool for the visualization and analyzation of data.
It offers multiple mathematical functions for finding the maximum, minimum, mean, mode, maximal deviation and more of a dataset, as well as multiple chart types, like barcharts and piecharts.
There are multiple ways of creating datasets from different inputs outlined below.


## Overview & Getting Started

Statistics workbench offers a large number of functionalities for displaying the different charts, however it is not complete yet and not all functionalities are supported by all chart types yet.
Expand Down Expand Up @@ -155,35 +154,40 @@ You can also interact with the diagram, for example by right-clicking on data po
- Normalized BarChart
- Normalized AreaChart

Here is an example of how to create a stacked chart for multiple y-axes:
Here are two examples of how to create stacked and normalized charts for multiple y-axes:
```smalltalk
(SWDiagram new
stacked: true;
visualizeAll: dataCollection with: SWBarChart) openInWindowLabeled: ''
```
```smalltalk
(SWDiagram new stacked: true;
(SWDiagram new
stacked: true;
normalized: true;
visualizeAll: dataCollection with: SWBarChart) openInWindowLabeled: ''
```
Here "dataCollection" is of 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

**Charts that suppot 3-dimensional data:**
- BubblePlot

Here is an examples of how to create a bubbleplot for 3-dimensional data:
```smalltalk
SWMainformModel open.
| data |
data := SWDataUnlabeled fromXValues: {1 . 2 . 3 . 4 . 5} versusYValues: {5 . 200 . 38 . 69 . 16} versusZValues: {17 . 14 . 5 . 8 . 3}.
(SWDiagram new visualize: data with: SWBubblePlot) openInWindowLabeled: ''
```
**Features:**
- Import CSV
- Export Charts as PNG
- Edit X, Y axis and columns in the editor
- Choose different themes for your charts
- View all types of charts without writing commands
It is also possible to visualize more than one data series within a BubblePlot by using the method ```SWDiagram new visualizeAll: dataCollection with: SWBubblePlot```.

### Difference between Single and Multiple Y-Axes

The statistics workbench is not just designed for charts with a single x and y-axis. You can add multiple y-axes using the editor or by importing them via CSV. All imported y-axis values will show up in the multiple text selector on the right side of the UI. You can also display multiple charts at the same time for the current x- and y-axes values by selecting different chart types.

If you want to remove or edit y-axis values, simply select the desired rows and click the corresponding button to make the changes.

#### Important Note:
If you only have one y-axis value in your UI field, you can visualize all charts. However, if you have multiple y-axis values, you can't visualize the pieChart and will get an error message because this chart type is not designed to have more y-axes. All other charts will be stacked as you would expect with additional y-axes.
lot: (scatterPlot charts first) plotOn: scatterPlot).
## Linear Regression
It is also possible to perform **Linear Regression** on a ScatterPlot.
```smalltalk
| data scatterPlot |
data := SWDataUnlabeled fromXValues: {1 . 2 . 3 . 4 . 5} versusYValues: {22 . 110 . 64 . 211 . 35}.
scatterPlot := SWDiagram new visualize: data with: SWScatterPlot.
(SWLinearRegression newFromScatterPlot: (scatterPlot charts first) plotOn: scatterPlot).
scatterPlot openInWindowLabeled: ''
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fromNamedColumns: aDictionary xValues: aString yValues: aString2
xValues := (aDictionary at: aString) collect: [:each | each asInteger].
yValues := (aDictionary at: aString2) collect: [:each | each asInteger].

data := self fromXValues: xValues versusYValues: yValues withLabels: (aDictionary at: #Labels).
data := self fromXValues: xValues versusYValues: yValues withLabels: (aDictionary at: #Label).

data enrichWith: aDictionary.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"fromDataPointCollections:" : "jvm 8/5/2020 09:32",
"fromNamedColumns:" : "PAR 6/27/2021 16:10",
"fromNamedColumns:xValues:yValues:" : "PAR 6/8/2021 10:38",
"fromNamedColumns:xValues:yValues:" : "JB 6/21/2024 14:41",
"fromXValues:versusYValues:withLabels:" : "jvm 8/2/2020 13:46",
"fromYValues:withLabels:" : "sjs 6/25/2020 16:45",
"processStringData:ofDataDimension:" : "ds 6/19/2020 18:32" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
as yet unclassified
createLineMorph

^ PolygonMorph new
borderWidth: self class defaultBorderWidth;
borderColor: self class defaultBorderColor;
color: self class defaultBorderColor;
yourself.
yourself
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
as yet unclassified
initialize
counter := 0.

super initialize.
self
self
lineMorph: self createLineMorph;
lineColor: self class defaultColor;
dataPoints: OrderedCollection new;
dataSuffix: ''
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"class" : {
"create" : "Nils Urban 5/28/2024 10:10" },
"instance" : {
"addDatapointsToLine" : " Nils Urban 7/8/2024 11:08",
"createLineMorph" : " Nils Urban 7/8/2024 14:51",
"addDatapointsToLine" : " Nils Urban 7/8/2024 22:26",
"createLineMorph" : "JB 6/18/2024 22:50",
"createVertices" : "Nils Urban 5/28/2024 10:47",
"initialize" : " Nils Urban 7/8/2024 14:51",
"update" : " Nils Urban 7/8/2024 15:02" } }
"initialize" : " Nils Urban 7/8/2024 22:26",
"update" : " Nils Urban 7/8/2024 22:26" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"commentStamp" : "",
"instvars" : [
"counter" ],
],
"name" : "SWAreaChart",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
limitedPrecisionSpecies

^ SWAxisRange
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"class" : {
},
"limitedPrecisionSpecies" : "JB 6/23/2024 14:43" },
"instance" : {
"balanceExtent" : "jk 8/7/2020 22:13",
"includeZero" : "jk 8/7/2020 22:13" } }
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"name" : "SWAxisRange",
"pools" : [
],
"super" : "Interval",
"super" : "LimitedPrecisionInterval",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accessing
caption: aString

self barLabelMorph: TextMorph new.
self barLabelMorph center: self barLabelMorph center + self defaultLabelOffset.

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

"DELETE THIS"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
captionString

"DELETE THIS"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
hasBottomCaption: aBool

"DELETE THIS"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
hasBottomCaption

"DELETE THIS"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
accessing
infoPopup: aTextMorph

infoPopup := aTextMorph
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
accessing
infoPopup

^ infoPopup
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
accessing
topCaption: aString

self barLabelMorph: TextMorph new.
self barLabelMorph center: self barLabelMorph center + self defaultLabelOffset.

self rotationMorph: TransformationMorph new.
self rotationMorph addMorph: self barLabelMorph.
self addMorph: self rotationMorph.

self barLabelMorph contents: aString.
self barLabelMorph color: self captionColor.

self rotationMorph topLeft: self topLeft.

(self isLabelHorizontal and: self isLabelTooLong)
ifTrue: [self rotateLabel].
(self isLabelHorizontal and: self isTextHigherThanBar)
ifTrue: [self raiseBarLabel]
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,38 @@
"barLabelMorph:" : "ds 6/19/2020 19:12",
"bottom" : "ds 6/19/2020 19:12",
"bottom:" : "ds 6/19/2020 19:12",
"bottomCaption:" : " Nils Urban 7/8/2024 11:14",
"bottomCaptionHeight" : " Nils Urban 6/21/2024 16:59",
"bottomLabelMorph" : " Nils Urban 6/21/2024 16:36",
"bottomLabelMorph:" : " Nils Urban 6/21/2024 16:36",
"caption:" : " Nils Urban 7/8/2024 11:18",
"bottomCaption:" : " Nils Urban 7/8/2024 22:30",
"bottomCaptionHeight" : "Nils Urban 6/21/2024 16:59",
"bottomLabelMorph" : "Nils Urban 6/21/2024 16:36",
"bottomLabelMorph:" : "Nils Urban 6/21/2024 16:36",
"caption:" : " Nils Urban 7/8/2024 22:31",
"captionColor" : "Nils Urban 6/13/2024 01:42",
"captionColor:" : "Nils Urban 6/13/2024 01:42",
"captionString" : " Nils Urban 7/8/2024 22:32",
"captionString:" : " Nils Urban 7/8/2024 22:32",
"defaultBarLabelOffset" : "ds 6/19/2020 19:13",
"defaultCharWidth" : "ds 6/19/2020 19:13",
"defaultLabelOffset" : "ds 6/19/2020 19:13",
"handlesMouseOver:" : "FM 5/30/2021 10:35",
"infoPopup" : " Nils Urban 7/8/2024 11:18",
"infoPopup:" : " Nils Urban 7/8/2024 11:18",
"initialize" : " Nils Urban 6/23/2024 21:53",
"isHidden" : " Nils Urban 7/8/2024 11:18",
"hasBottomCaption" : " Nils Urban 7/8/2024 22:32",
"hasBottomCaption:" : " Nils Urban 7/8/2024 22:33",
"infoPopup" : "FM 5/30/2021 10:40",
"infoPopup:" : "FM 5/30/2021 10:40",
"initialize" : " Nils Urban 7/8/2024 22:34",
"isHidden" : " Nils Urban 7/8/2024 22:34",
"isHidden:" : "Nils Urban 6/13/2024 01:18",
"isLabelHorizontal" : "ds 6/19/2020 19:13",
"isLabelHorizontal:" : "ds 6/19/2020 19:13",
"isLabelTooLong" : "ds 6/19/2020 19:38",
"isTextHigherThanBar" : "ds 6/19/2020 19:39",
"minimumLabelWidth" : "ds 6/19/2020 19:39",
"mouseDown:" : " Nils Urban 7/8/2024 11:19",
"mouseEnter:" : " Nils Urban 6/23/2024 22:35",
"mouseDown:" : " Nils Urban 7/8/2024 22:34",
"mouseEnter:" : " Nils Urban 7/8/2024 22:36",
"mouseLeave:" : "Nils Urban 6/14/2024 14:16",
"raiseBarLabel" : "ds 6/19/2020 19:39",
"rotateLabel" : "Nils Urban 6/14/2024 15:52",
"rotatedLabelOffset" : "ds 6/19/2020 19:39",
"rotatedLabelPosition" : "Nils Urban 6/14/2024 15:48",
"rotationMorph" : "ds 6/19/2020 19:39",
"rotationMorph:" : "ds 6/19/2020 19:39" } }
"rotationMorph:" : "ds 6/19/2020 19:39",
"topCaption:" : "Nils Urban 6/23/2024 12:53" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
hasBottomCaption: aBool

"DELETE THIS"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
hasBottomCaption

"DELETE THIS"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ update

self applyTheme: self diagram colorTheme.
self diagram updateCoordinateSystem.
self removeAll;
self
removeAll;
createBarsFrom: self data
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
"barWidth:" : "ds 6/19/2020 18:54",
"bars" : "ds 6/19/2020 18:54",
"bars:" : "ds 6/19/2020 18:54",
"createBarsFrom:" : " Nils Urban 7/8/2024 11:53",
"createBarsFrom:" : " Nils Urban 7/8/2024 22:36",
"dataColor" : "PAR 8/6/2021 13:30",
"dynamicBarWidth" : "JB 6/19/2024 22:33",
"initialize" : "Nils Urban 6/14/2024 15:56",
"hasBottomCaption" : " Nils Urban 7/8/2024 22:37",
"hasBottomCaption:" : " Nils Urban 7/8/2024 22:37",
"initialize" : " Nils Urban 7/8/2024 22:37",
"maxBarWidth" : "jk 7/31/2020 12:18",
"maxBottomCaptionHeight" : " Nils Urban 6/21/2024 17:03",
"maxBottomCaptionHeight" : "Nils Urban 6/21/2024 17:03",
"needsCoordinateSystem" : "ds 6/19/2020 18:55",
"remove:" : "CK 5/14/2021 15:06",
"removeAll" : "ds 6/19/2020 18:55",
"requiredCoordinateSystem" : "FM 7/9/2021 17:12",
"supportsShowMean" : "jk 8/4/2020 17:58",
"update" : " Nils Urban 7/8/2024 11:00" } }
"update" : "IK 5/18/2021 20:22" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ createDataPoint: aSWVector

dataPoint := SWDataPoint create: aSWVector at: (self coordinateSystem positionFor: aSWVector asPoint) size: (self scaledBubbleSize: (aSWVector third)).
dataPoint color: (self pointColor alpha: 0.7).

(aSWVector third > (self threshold)) ifTrue: [dataPoint height: 0. dataPoint width: 0].

^ dataPoint
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ data: dataSet
self threshold: (data maximum: #z).
self
update;
changed: self
changed: self
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"class" : {
"create" : "Nils Urban 6/13/2024 10:24" },
"instance" : {
"createDataPoint:" : " Nils Urban 7/8/2024 10:57",
"data:" : " Nils Urban 7/8/2024 11:09",
"diagram:" : " Nils Urban 6/21/2024 15:20",
"dynamicMaxBubbleSize" : " Nils Urban 6/21/2024 14:48",
"initialize" : " Nils Urban 6/21/2024 15:11",
"maxValuesPerData" : " Nils Urban 7/8/2024 10:58",
"maxValuesPerData:" : " Nils Urban 6/21/2024 14:48",
"receiveValue:" : " Nils Urban 7/8/2024 10:58",
"scaledBubbleSize:" : " Nils Urban 6/21/2024 15:23",
"threshold" : " Nils Urban 7/8/2024 10:58",
"createDataPoint:" : "JB 6/19/2024 21:45",
"data:" : " Nils Urban 7/8/2024 22:38",
"diagram:" : "Nils Urban 6/21/2024 15:20",
"dynamicMaxBubbleSize" : "Nils Urban 6/21/2024 14:48",
"initialize" : "Nils Urban 6/21/2024 15:11",
"maxValuesPerData" : " Nils Urban 7/8/2024 22:38",
"maxValuesPerData:" : "Nils Urban 6/21/2024 14:48",
"receiveValue:" : " Nils Urban 7/8/2024 22:38",
"scaledBubbleSize:" : "Nils Urban 6/21/2024 15:23",
"threshold" : " Nils Urban 7/8/2024 22:38",
"threshold:" : "Nils Urban 6/13/2024 11:20" } }
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"percentageBased:" : "Nils Urban 6/7/2024 22:40",
"positionAxes" : "JB 6/9/2024 01:56",
"positionFor:" : "jk 8/5/2020 20:11",
"rangeForDimension:" : "Nils Urban 6/7/2024 22:32",
"rangeForDimension:" : "Nils Urban 6/23/2024 11:30",
"startPoint" : "ds 6/19/2020 19:58",
"toggleCenteredAxes" : "jk 7/15/2020 15:53",
"toggleRaster" : "jk 7/15/2020 18:26",
"update" : "JB 6/9/2024 01:46",
"updateLegends" : " Nils Urban 7/8/2024 11:20",
"updateLegends" : "jk 8/5/2020 20:13",
"updateMaxX:maxY:" : "jk 8/5/2020 20:10",
"updateMinX:minY:" : "JB 6/9/2024 00:27",
"updateRanges" : "JB 6/9/2024 01:42",
"updateRasterSize" : " Nils Urban 7/8/2024 11:21",
"updateRasterSize" : " Nils Urban 7/8/2024 22:38",
"xAxis" : "ds 6/19/2020 19:58",
"xAxis:" : "ds 6/19/2020 19:59",
"yAxis" : "ds 6/19/2020 19:59",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"remove:" : "ds 6/19/2020 18:52",
"removeAll" : "ds 6/19/2020 18:52",
"removeFrom:" : "jk 8/4/2020 18:12",
"removeFromData:" : " Nils Urban 6/21/2024 15:45",
"removeFromData:" : "Nils Urban 6/21/2024 15:45",
"requiredCoordinateSystem" : "FM 7/9/2021 17:14",
"requiresXValues" : "JB 6/9/2024 20:33",
"supportsShowMean" : "jk 8/4/2020 17:58",
Expand Down

This file was deleted.

Loading

0 comments on commit 1b39a0a

Please sign in to comment.