From 2a40868667910266b43f3a2cc271f6f883923645 Mon Sep 17 00:00:00 2001 From: Nils Urban Date: Mon, 8 Jul 2024 11:54:58 +0200 Subject: [PATCH] refactoring --- .../instance/addDatapointsToLine.st | 3 +- .../SWAreaChart.class/instance/initialize.st | 3 +- .../SWAreaChart.class/methodProperties.json | 4 +-- .../SWBar.class/instance/bottomCaption..st | 20 +++++++----- .../SWBar.class/instance/caption..st | 2 +- .../SWBar.class/instance/infoPopup..st | 1 + .../SWBar.class/instance/infoPopup.st | 1 + .../SWBar.class/instance/isHidden.st | 2 +- .../SWBar.class/instance/mouseDown..st | 3 +- .../SWBar.class/methodProperties.json | 12 +++---- .../instance/createBarsFrom..st | 5 ++- .../SWBarChart.class/instance/update.st | 3 +- .../SWBarChart.class/methodProperties.json | 4 +-- .../instance/createDataPoint..st | 1 - .../SWBubblePlot.class/instance/data..st | 3 +- .../instance/maxValuesPerData.st | 2 +- .../instance/receiveValue..st | 2 +- .../SWBubblePlot.class/instance/threshold.st | 2 +- .../SWBubblePlot.class/methodProperties.json | 10 +++--- .../instance/updateRasterSize.st | 2 +- .../methodProperties.json | 4 +-- .../SWDiagram.class/instance/addSlider.st | 27 ++++++---------- .../instance/configureSlider..st | 10 ++++++ .../SWDiagram.class/instance/exportIMG.st | 3 +- .../SWDiagram.class/instance/extent..st | 1 + .../SWDiagram.class/instance/getColor.for..st | 1 - .../instance/globalMaximum..st | 3 +- .../instance/globalMinimum..st | 3 +- .../SWDiagram.class/instance/legend..st | 1 + .../instance/normalizeData..st | 11 +++++++ .../SWDiagram.class/instance/normalized..st | 2 +- .../SWDiagram.class/instance/normalized.st | 2 +- .../instance/sliderValueMorph.st | 2 +- .../SWDiagram.class/instance/stackData..st | 9 ++++++ .../SWDiagram.class/instance/stacked.st | 2 +- .../SWDiagram.class/instance/updateLegend.st | 3 +- .../instance/visualizeAll.with..st | 27 ++++------------ .../SWDiagram.class/methodProperties.json | 31 ++++++++++--------- .../instance/createDataNameMorph.st | 4 +-- .../SWLineChart.class/methodProperties.json | 2 +- 40 files changed, 124 insertions(+), 109 deletions(-) create mode 100644 packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/configureSlider..st create mode 100644 packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalizeData..st create mode 100644 packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stackData..st diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/addDatapointsToLine.st b/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/addDatapointsToLine.st index 916df1f7..343d1d59 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/addDatapointsToLine.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/addDatapointsToLine.st @@ -6,7 +6,8 @@ addDatapointsToLine self removeAllDatapoints. 1 to: self data size do: [:index | dataPoint := SWDataPoint create: (self data at: index) at: (self vertices at: (index+1)). - dataPoint color: Color transparent; + dataPoint + color: Color transparent; suffix: self dataSuffix; position: dataPoint renderedPoint. self dataPoints add: dataPoint. diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/initialize.st b/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/initialize.st index 41c6ec7f..ff1c7c84 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/initialize.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/instance/initialize.st @@ -2,7 +2,8 @@ as yet unclassified initialize super initialize. - self lineMorph: self createLineMorph; + self + lineMorph: self createLineMorph; lineColor: self class defaultColor; dataPoints: OrderedCollection new; dataSuffix: '' \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/methodProperties.json index 1bea4679..7efc1cfe 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWAreaChart.class/methodProperties.json @@ -2,8 +2,8 @@ "class" : { "create" : "Nils Urban 5/28/2024 10:10" }, "instance" : { - "addDatapointsToLine" : "Nils Urban 6/12/2024 14:38", + "addDatapointsToLine" : " Nils Urban 7/8/2024 11:08", "createLineMorph" : "JB 6/18/2024 22:50", "createVertices" : "Nils Urban 5/28/2024 10:47", - "initialize" : "Nils Urban 6/12/2024 14:39", + "initialize" : " Nils Urban 7/8/2024 11:08", "update" : "Nils Urban 6/7/2024 10:04" } } diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/bottomCaption..st b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/bottomCaption..st index f9a09cd2..a18e6125 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/bottomCaption..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/bottomCaption..st @@ -1,13 +1,17 @@ accessing bottomCaption: aString - | bottomTextMorph | + | bottomTextMorph labelMorph | bottomTextMorph := TextMorph new. - bottomTextMorph contents: aString. - bottomTextMorph color: self captionColor. - self bottomLabelMorph: TransformationMorph new. - self bottomLabelMorph addMorph: bottomTextMorph. - self bottomLabelMorph angle: (0.25 * (Float pi)). - self bottomLabelMorph topRight: self bottomCenter. - self addMorph: self bottomLabelMorph. \ No newline at end of file + bottomTextMorph + contents: aString; + color: self captionColor. + labelMorph := TransformationMorph new. + labelMorph + addMorph: bottomTextMorph; + angle: (0.25 * (Float pi)); + topRight: self bottomCenter. + self + addMorph: labelMorph; + bottomLabelMorph: labelMorph \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/caption..st b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/caption..st index 5a37d11a..a557c079 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/caption..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/caption..st @@ -3,7 +3,7 @@ caption: 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. diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup..st b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup..st index 968b2cbf..0f6a1f4c 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup..st @@ -1,3 +1,4 @@ accessing infoPopup: aTextMorph + infoPopup := aTextMorph \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup.st b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup.st index 3d741db6..7b00788a 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/infoPopup.st @@ -1,3 +1,4 @@ accessing infoPopup + ^ infoPopup \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/isHidden.st b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/isHidden.st index 87bb604f..8436471d 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/isHidden.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/isHidden.st @@ -1,4 +1,4 @@ geometry isHidden - ^isHidden \ No newline at end of file + ^ isHidden \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/mouseDown..st b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/mouseDown..st index 6d35fe8a..7d15d596 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/mouseDown..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/instance/mouseDown..st @@ -5,8 +5,7 @@ mouseDown: anEvent ifTrue: [ owner data at: self datapointIndex put: (SWVector fromPoint: ((owner data at: self datapointIndex) x) @ 0). owner originalData at: self datapointIndex put: (SWVector fromPoint: ((owner originalData at: self datapointIndex) x) @ 0). - owner diagram redrawChangedData. - ]. + owner diagram redrawChangedData.]. (anEvent redButtonPressed) ifTrue: [self switchColor]. anEvent hand waitForClicksOrDrag: self event: anEvent diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/methodProperties.json index 9d720836..3bb2689b 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBar.class/methodProperties.json @@ -7,28 +7,28 @@ "barLabelMorph:" : "ds 6/19/2020 19:12", "bottom" : "ds 6/19/2020 19:12", "bottom:" : "ds 6/19/2020 19:12", - "bottomCaption:" : " Nils Urban 6/21/2024 16:56", + "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 6/21/2024 16:56", + "caption:" : " Nils Urban 7/8/2024 11:18", "captionColor" : "Nils Urban 6/13/2024 01:42", "captionColor:" : "Nils Urban 6/13/2024 01:42", "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" : "FM 5/30/2021 10:40", - "infoPopup:" : "FM 5/30/2021 10:40", + "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 6/13/2024 00:56", + "isHidden" : " Nils Urban 7/8/2024 11:18", "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 6/23/2024 22:30", + "mouseDown:" : " Nils Urban 7/8/2024 11:19", "mouseEnter:" : " Nils Urban 6/23/2024 22:35", "mouseLeave:" : "Nils Urban 6/14/2024 14:16", "raiseBarLabel" : "ds 6/19/2020 19:39", diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/createBarsFrom..st b/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/createBarsFrom..st index 8387f69f..77d5a794 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/createBarsFrom..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/createBarsFrom..st @@ -15,5 +15,8 @@ createBarsFrom: aSWData bottom: self barBottom; captionColor: self barLabelColor; yourself). - ((self data at: index) y = 0) ifFalse: ["bar caption: vector labelName." bar bottomCaption: vector labelName]. + ((self data at: index) y = 0) + ifFalse: [(self diagram stacked) + ifTrue: [bar caption: vector labelName.] + ifFalse: [bar bottomCaption: vector labelName.]]. self add: bar] diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/update.st b/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/update.st index 9f1c3a2f..e52bc9a3 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/update.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/instance/update.st @@ -3,6 +3,5 @@ update self applyTheme: self diagram colorTheme. self diagram updateCoordinateSystem. - self - removeAll; + self removeAll; createBarsFrom: self data diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/methodProperties.json index af229b56..0ffd371d 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBarChart.class/methodProperties.json @@ -18,7 +18,7 @@ "barWidth:" : "ds 6/19/2020 18:54", "bars" : "ds 6/19/2020 18:54", "bars:" : "ds 6/19/2020 18:54", - "createBarsFrom:" : " Nils Urban 6/21/2024 17:06", + "createBarsFrom:" : " Nils Urban 7/8/2024 11:53", "dataColor" : "PAR 8/6/2021 13:30", "dynamicBarWidth" : "JB 6/19/2024 22:33", "initialize" : "Nils Urban 6/14/2024 15:56", @@ -29,4 +29,4 @@ "removeAll" : "ds 6/19/2020 18:55", "requiredCoordinateSystem" : "FM 7/9/2021 17:12", "supportsShowMean" : "jk 8/4/2020 17:58", - "update" : "IK 5/18/2021 20:22" } } + "update" : " Nils Urban 7/8/2024 11:00" } } diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/createDataPoint..st b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/createDataPoint..st index c5ae32c7..5c7d9ba3 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/createDataPoint..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/createDataPoint..st @@ -5,7 +5,6 @@ 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 diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/data..st b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/data..st index 3ac0275c..f4653840 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/data..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/data..st @@ -5,5 +5,6 @@ data: dataSet data := dataSet. data addDependent: self. self threshold: (data maximum: #z). - self update; + self + update; changed: self \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/maxValuesPerData.st b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/maxValuesPerData.st index 5f279ba1..4b094fcd 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/maxValuesPerData.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/maxValuesPerData.st @@ -1,4 +1,4 @@ as yet unclassified maxValuesPerData - ^maxValuesPerData \ No newline at end of file + ^ maxValuesPerData \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/receiveValue..st b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/receiveValue..st index 8e38aa4b..59db3f20 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/receiveValue..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/receiveValue..st @@ -2,4 +2,4 @@ as yet unclassified receiveValue: aValue self threshold: aValue. - self update. \ No newline at end of file + self update \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/threshold.st b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/threshold.st index c846d737..320184a9 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/threshold.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/instance/threshold.st @@ -1,4 +1,4 @@ as yet unclassified threshold - ^threshold \ No newline at end of file + ^ threshold \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/methodProperties.json index 91a9d83a..6f9abbcc 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWBubblePlot.class/methodProperties.json @@ -2,14 +2,14 @@ "class" : { "create" : "Nils Urban 6/13/2024 10:24" }, "instance" : { - "createDataPoint:" : "JB 6/19/2024 21:45", - "data:" : " Nils Urban 6/23/2024 23:42", + "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 6/21/2024 15:04", + "maxValuesPerData" : " Nils Urban 7/8/2024 10:58", "maxValuesPerData:" : " Nils Urban 6/21/2024 14:48", - "receiveValue:" : "JB 6/19/2024 02:39", + "receiveValue:" : " Nils Urban 7/8/2024 10:58", "scaledBubbleSize:" : " Nils Urban 6/21/2024 15:23", - "threshold" : "Nils Urban 6/13/2024 11:20", + "threshold" : " Nils Urban 7/8/2024 10:58", "threshold:" : "Nils Urban 6/13/2024 11:20" } } diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/instance/updateRasterSize.st b/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/instance/updateRasterSize.st index 4a75855e..fdbcb6e8 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/instance/updateRasterSize.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/instance/updateRasterSize.st @@ -2,4 +2,4 @@ updating updateRasterSize self xAxis rasterLength: self yAxis length. - self yAxis rasterLength: self xAxis length. + self yAxis rasterLength: self xAxis length diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/methodProperties.json index be825380..9b6aeaa8 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWCartesianCoordinateSystem.class/methodProperties.json @@ -25,11 +25,11 @@ "toggleCenteredAxes" : "jk 7/15/2020 15:53", "toggleRaster" : "jk 7/15/2020 18:26", "update" : "JB 6/9/2024 01:46", - "updateLegends" : "jk 8/5/2020 20:13", + "updateLegends" : " Nils Urban 7/8/2024 11:20", "updateMaxX:maxY:" : "jk 8/5/2020 20:10", "updateMinX:minY:" : "JB 6/9/2024 00:27", "updateRanges" : "JB 6/9/2024 01:42", - "updateRasterSize" : "JB 6/9/2024 22:55", + "updateRasterSize" : " Nils Urban 7/8/2024 11:21", "xAxis" : "ds 6/19/2020 19:58", "xAxis:" : "ds 6/19/2020 19:59", "yAxis" : "ds 6/19/2020 19:59", diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/addSlider.st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/addSlider.st index e164dafd..63f79cf0 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/addSlider.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/addSlider.st @@ -7,26 +7,17 @@ addSlider valueMorph := TextMorph new. self addMorph: sliderMorph. self addMorph: valueMorph. - - sliderMorph - extent: (100 @ 500); - position: ((self position x - 150)@(self position y)); - orientation: #vertical; - minVal: (self globalMinimum: #z); - maxVal: (self globalMaximum: #z); - setValue: 1. - + self configureSlider: sliderMorph. valueMorph extent: (20@50); backgroundColor: Color white; position: ((self position x - 150)@(self position y + (sliderMorph height))); contents: (Text fromString: 'haloo'). - - self sliderValueMorph: valueMorph. - self sliderMorph: sliderMorph. - - self sendToCharts: sliderMorph getNumericValue. - - sliderMorph target: self. - sliderMorph arguments: OrderedCollection new. - sliderMorph actionSelector: #sendToCharts: \ No newline at end of file + self + sliderValueMorph: valueMorph; + sliderMorph: sliderMorph; + sendToCharts: sliderMorph getNumericValue. + sliderMorph + target: self; + actionSelector: #sendToCharts:; + arguments: OrderedCollection new \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/configureSlider..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/configureSlider..st new file mode 100644 index 00000000..09cf26d4 --- /dev/null +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/configureSlider..st @@ -0,0 +1,10 @@ +accessing +configureSlider: aSliderMorph + + aSliderMorph + extent: (100 @ 500); + position: ((self position x - 150)@(self position y)); + orientation: #vertical; + minVal: (self globalMinimum: #z); + maxVal: (self globalMaximum: #z); + setValue: 1 \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/exportIMG.st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/exportIMG.st index 1c341c1f..29698ec2 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/exportIMG.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/exportIMG.st @@ -10,5 +10,4 @@ exportIMG [PNGReadWriter putForm: (self imageForm) onFileNamed: filePath] on: Error do: [:error | self exportButton show. error pass]. - self exportButton show. - ] \ No newline at end of file + self exportButton show.] \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/extent..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/extent..st index 836f04fe..69ddb950 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/extent..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/extent..st @@ -1,5 +1,6 @@ geometry extent: aPoint + |width labelHeight| width := 0. labelHeight := 0. diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/getColor.for..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/getColor.for..st index bbc8b690..cd9edfbb 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/getColor.for..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/getColor.for..st @@ -2,7 +2,6 @@ visualization getColor: aCollection for: aChart | index | - index := self charts indexOf: aChart ifAbsent: 1. aCollection size >= index ifTrue: [^ aCollection at: index] diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMaximum..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMaximum..st index dcc8f289..864f5816 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMaximum..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMaximum..st @@ -2,7 +2,6 @@ adding/removing globalMaximum: aDimension |chartMaxima| - chartMaxima := charts collect: [:aChart | aChart data maximum: aDimension]. - ^chartMaxima max \ No newline at end of file + ^ chartMaxima max \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMinimum..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMinimum..st index 71748c40..516da3eb 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMinimum..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/globalMinimum..st @@ -2,7 +2,6 @@ adding/removing globalMinimum: aDimension |chartMaxima| - chartMaxima := charts collect: [:aChart | aChart data minimum: aDimension]. - ^chartMaxima min \ No newline at end of file + ^ chartMaxima min \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/legend..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/legend..st index 9ce4adcc..33224453 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/legend..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/legend..st @@ -1,3 +1,4 @@ accessing legend: anObject + legend := anObject \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalizeData..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalizeData..st new file mode 100644 index 00000000..8b5a1c1a --- /dev/null +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalizeData..st @@ -0,0 +1,11 @@ +visualization +normalizeData: aSWData + + | stack | + stack := (Array new: (aSWData first size)) collect: [:a | 0]. + aSWData do: [:aData | + aData doWithIndex: [:vector :index | + stack at: index put: (vector y + (stack at: index))]]. + aSWData do: [:aData | + aData doWithIndex: [:vector :index | + vector at: 2 put: (100 * (vector y) / stack at: index)]] \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized..st index fc136862..6cdf1e1a 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized..st @@ -1,4 +1,4 @@ adding/removing normalized: aBool - normalized:= aBool \ No newline at end of file + normalized := aBool \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized.st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized.st index 73461cdd..84cdb071 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/normalized.st @@ -1,4 +1,4 @@ adding/removing normalized - ^normalized \ No newline at end of file + ^ normalized \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/sliderValueMorph.st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/sliderValueMorph.st index 3d71bf53..89c5d63c 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/sliderValueMorph.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/sliderValueMorph.st @@ -1,4 +1,4 @@ accessing sliderValueMorph - ^sliderValueMorph \ No newline at end of file + ^ sliderValueMorph \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stackData..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stackData..st new file mode 100644 index 00000000..db03684f --- /dev/null +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stackData..st @@ -0,0 +1,9 @@ +visualization +stackData: aSWData + + | stack | + stack := (Array new: (aSWData first size)) collect: [:a | 0]. + aSWData do: [:aData | + aData doWithIndex: [:vector :index | + stack at: index put: (vector y + (stack at: index)). + vector at: 2 put: (stack at: index)]] \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stacked.st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stacked.st index 6074fd5d..c904fa5a 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stacked.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/stacked.st @@ -1,4 +1,4 @@ adding/removing stacked - ^stacked \ No newline at end of file + ^ stacked \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/updateLegend.st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/updateLegend.st index 168470d1..df7a8137 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/updateLegend.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/updateLegend.st @@ -5,5 +5,4 @@ updateLegend self legend key topRight: self topRight. self removeLegend. (self hasChart) ifTrue: [ - self legend drawKeyFor: self collectKeyData - ] \ No newline at end of file + self legend drawKeyFor: self collectKeyData] \ No newline at end of file diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/visualizeAll.with..st b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/visualizeAll.with..st index e8d2b3d2..b9b8742d 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/visualizeAll.with..st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/instance/visualizeAll.with..st @@ -1,29 +1,14 @@ visualization visualizeAll: aSWDataCollection with: aSWChartSubclass - | stack stackedData reverseCollection reverseOriginalCollection| + | processedData reverseCollection reverseOriginalCollection| self dataCollection: aSWDataCollection deepCopy. - stackedData := aSWDataCollection deepCopy. + processedData := aSWDataCollection deepCopy. - (self normalized) - ifTrue: [ - stack := (Array new: (aSWDataCollection first size)) collect: [:a | 0]. - stackedData do: [:aData | - aData doWithIndex: [:vector :index | - stack at: index put: (vector y + (stack at: index))]]. - stackedData do: [:aData | - aData doWithIndex: [:vector :index | - vector at: 2 put: (100 * (vector y) / stack at: index)]]]. - - (self stacked) - ifTrue: [ - stack := (Array new: (stackedData first size)) collect: [:a | 0]. - stackedData do: [:aData | - aData doWithIndex: [:vector :index | - stack at: index put: (vector y + (stack at: index)). - vector at: 2 put: (stack at: index)]]]. + (self normalized) ifTrue: [self normalizeData: processedData]. + (self stacked) ifTrue: [self stackData: processedData]. - reverseCollection := stackedData reversed. + reverseCollection := processedData reversed. reverseOriginalCollection := self dataCollection reversed. reverseCollection doWithIndex: [:swData :index | - self visualize: swData original: (reverseOriginalCollection at: index) with: aSWChartSubclass]. + self visualize: swData original: (reverseOriginalCollection at: index) with: aSWChartSubclass] diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/methodProperties.json index 24f241b0..f3a61e36 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWDiagram.class/methodProperties.json @@ -5,7 +5,7 @@ "add:" : "PAR 7/6/2021 07:53", "addChart:" : "jk 6/25/2020 22:27", "addCoordinateSystem:" : "jk 6/24/2020 15:36", - "addSlider" : "Nils Urban 6/19/2024 17:39", + "addSlider" : " Nils Urban 7/8/2024 11:26", "applyColorTheme:" : "JB 6/9/2024 23:22", "axisColor:" : "ds 6/19/2020 20:01", "buttonHighlighting:" : "JB 6/18/2024 20:11", @@ -16,6 +16,7 @@ "collectNewData" : "Nils Urban 6/13/2024 02:12", "colorTheme" : "ds 6/19/2020 20:02", "colorTheme:" : "ds 6/19/2020 20:02", + "configureSlider:" : " Nils Urban 7/8/2024 11:23", "coordinateSystem" : "ds 6/19/2020 20:02", "coordinateSystem:" : "jk 6/24/2020 15:40", "createIMGExportBtn" : "JB 6/20/2024 01:37", @@ -28,12 +29,12 @@ "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:" : " Nils Urban 6/21/2024 17:08", - "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", + "exportIMG" : " Nils Urban 7/8/2024 11:27", + "extent:" : " Nils Urban 7/8/2024 11:29", + "getColor:for:" : " Nils Urban 7/8/2024 11:29", + "getTitleBarHeight" : " Nils Urban 7/8/2024 11:29", + "globalMaximum:" : " Nils Urban 7/8/2024 11:29", + "globalMinimum:" : " Nils Urban 7/8/2024 11:29", "handlesMouseDown:" : "FM 5/10/2021 20:42", "hasChart" : "jk 6/25/2020 22:26", "hasCoordinateSystem" : "ds 6/19/2020 20:03", @@ -41,7 +42,7 @@ "initialize" : "JB 6/19/2024 22:39", "insertHPILogo" : "JB 6/9/2024 23:17", "legend" : "JB 6/9/2024 00:41", - "legend:" : "PAR 7/2/2021 12:23", + "legend:" : " Nils Urban 7/8/2024 11:30", "loadExportIconFor:" : "JB 6/18/2024 20:04", "logo" : "JB 6/9/2024 23:08", "logo:" : "JB 6/9/2024 23:08", @@ -49,8 +50,9 @@ "maximumOfAllChartsForDimension:" : "jk 8/4/2020 11:31", "minimumOfAllChartsForDimension:" : "jk 8/4/2020 11:32", "mouseDown:" : "FM 5/10/2021 21:18", - "normalized" : "Nils Urban 6/12/2024 14:48", - "normalized:" : "Nils Urban 6/12/2024 14:48", + "normalizeData:" : " Nils Urban 7/8/2024 11:40", + "normalized" : " Nils Urban 7/8/2024 11:30", + "normalized:" : " Nils Urban 7/8/2024 11:31", "redrawChangedData" : "Nils Urban 6/13/2024 02:18", "remove:" : "PAR 7/6/2021 07:49", "removeLegend" : "PAR 7/13/2021 12:17", @@ -61,9 +63,10 @@ "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 7/8/2024 11:33", "sliderValueMorph:" : "Nils Urban 6/13/2024 11:45", - "stacked" : "Nils Urban 6/12/2024 14:48", + "stackData:" : " Nils Urban 7/8/2024 11:46", + "stacked" : " Nils Urban 7/8/2024 11:33", "stacked:" : "Nils Urban 6/12/2024 14:48", "toggleRaster" : "ds 6/19/2020 20:04", "transformToSpiderData:" : "JB 6/10/2024 22:25", @@ -73,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" : " Nils Urban 7/8/2024 11:33", "visualize:and:with:and:" : "ds 6/19/2020 20:05", "visualize:original:with:" : " Nils Urban 6/21/2024 15:09", "visualize:with:" : "JB 6/20/2024 01:22", "visualize:with:and:" : "JB 6/8/2024 17:56", - "visualizeAll:with:" : "JB 6/12/2024 17:59" } } + "visualizeAll:with:" : " Nils Urban 7/8/2024 11:47" } } diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/instance/createDataNameMorph.st b/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/instance/createDataNameMorph.st index ed4153df..12e6e0cd 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/instance/createDataNameMorph.st +++ b/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/instance/createDataNameMorph.st @@ -3,10 +3,10 @@ createDataNameMorph | textMorph | - "textMorph := TextMorph new. + textMorph := TextMorph new. textMorph contents: self dataName; wrapFlag: true. self addMorph: textMorph; - dataNameMorph: textMorph" + dataNameMorph: textMorph diff --git a/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/methodProperties.json b/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/methodProperties.json index 82cc857b..360836f8 100644 --- a/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/methodProperties.json +++ b/packages/StatisticsWorkbench-Diagrams.package/SWLineChart.class/methodProperties.json @@ -9,7 +9,7 @@ "addDatapointsToLine" : "FM 8/6/2021 13:07", "applyDataColor" : "FM 8/6/2021 13:00", "applyTheme:" : "IK 5/20/2021 19:58", - "createDataNameMorph" : "Nils Urban 6/10/2024 15:37", + "createDataNameMorph" : " Nils Urban 7/8/2024 11:04", "createLineMorph" : "JB 6/18/2024 22:51", "createVertices" : "jvm 8/6/2020 11:11", "data:" : "FM 8/6/2021 13:05",