diff --git a/packages/Sandblocks-Babylonian/SBCluster.class.st b/packages/Sandblocks-Babylonian/SBCluster.class.st index 67893ea4..cd0c8841 100644 --- a/packages/Sandblocks-Babylonian/SBCluster.class.st +++ b/packages/Sandblocks-Babylonian/SBCluster.class.st @@ -66,7 +66,7 @@ SBCluster >> newCellMorph [ ^ self morphResizer applyOn: ( Morph new - color: Color blue; + color: Color transparent ; changeTableLayout; listDirection: #topToBottom; listCentering: #center; @@ -79,7 +79,7 @@ SBCluster >> newCellMorph [ SBCluster >> newContainerMorph [ ^ Morph new - color: Color banana; + color: Color transparent ; changeTableLayout; listDirection: #topToBottom; hResizing: #shrinkWrap; diff --git a/packages/Sandblocks-Babylonian/SBExploriantsView.class.st b/packages/Sandblocks-Babylonian/SBExploriantsView.class.st index 103d9f5b..b0214dcf 100644 --- a/packages/Sandblocks-Babylonian/SBExploriantsView.class.st +++ b/packages/Sandblocks-Babylonian/SBExploriantsView.class.st @@ -15,10 +15,16 @@ SBExploriantsView class >> block: aSBBlock named: aString [ self shouldNotImplement ] +{ #category : #util } +SBExploriantsView class >> deepSubclasses: aClass [ + + ^ {aClass}, ((aClass subclasses collect: [:aSubclass | self deepSubclasses: aSubclass]) flatten) +] + { #category : #'instance creation' } SBExploriantsView class >> getTabs [ - ^ self subclasses collect: #new + ^ (self subclasses collect: [:mySubClass | self deepSubclasses: mySubClass]) flatten collect: #new ] { #category : #accessing } diff --git a/packages/Sandblocks-Babylonian/SBGrid.class.st b/packages/Sandblocks-Babylonian/SBGrid.class.st index d8fd6cd9..792d84e2 100644 --- a/packages/Sandblocks-Babylonian/SBGrid.class.st +++ b/packages/Sandblocks-Babylonian/SBGrid.class.st @@ -10,7 +10,7 @@ Class { { #category : #constants } SBGrid class >> cellInsetValue [ - ^ 5 + ^ 2 ] { #category : #'initialize-release' } @@ -58,5 +58,5 @@ SBGrid >> resizeContents: aSBMorphResizer [ { #category : #visualisation } SBGrid >> updateWidthToPersistColumns [ - self width: (columnCount * (self submorphs first width + (2 * self class cellInsetValue))) + self width: (columnCount * (self submorphs first width + (2 * self cellInset))) ] diff --git a/packages/Sandblocks-Babylonian/SBGridResultsView.class.st b/packages/Sandblocks-Babylonian/SBGridResultsView.class.st new file mode 100644 index 00000000..5bebec02 --- /dev/null +++ b/packages/Sandblocks-Babylonian/SBGridResultsView.class.st @@ -0,0 +1,26 @@ +Class { + #name : #SBGridResultsView, + #superclass : #SBResultsView, + #category : #'Sandblocks-Babylonian' +} + +{ #category : #building } +SBGridResultsView >> buildPermutationFor: aPermutation collectingWatchesFrom: aCollectionOfMethodBlocks [ + + self block addAllMorphsBack: { SBOwnTextMorph new contents: aPermutation asString. + self applyButtonFor: aPermutation. + (self containerRow listDirection: #leftToRight) + addMorph: (( + SBPermutationCluster + newFromWatches: (self allWatchesIn: aCollectionOfMethodBlocks) + havingSize: (SBMorphResizer newSmall))). + LineMorph from: 0@0 to: 50@0 color: Color black width: 2} +] + +{ #category : #initialization } +SBGridResultsView >> initialize [ + + super initialize. + + self name: 'Grid View' +] diff --git a/packages/Sandblocks-Babylonian/SBPermutationCluster.class.st b/packages/Sandblocks-Babylonian/SBPermutationCluster.class.st index c916d836..6588cfce 100644 --- a/packages/Sandblocks-Babylonian/SBPermutationCluster.class.st +++ b/packages/Sandblocks-Babylonian/SBPermutationCluster.class.st @@ -4,16 +4,32 @@ Class { #category : #'Sandblocks-Babylonian' } +{ #category : #visualisation } +SBPermutationCluster >> extractColumnsFrom: anExampleWatch [ + + ^ anExampleWatch exampleToDisplay collect: [:anExampleValueDisplay | | watchview | + watchview := anExampleValueDisplay display copy. + self flag: #todo. "Another way besides turning into an image to keep interactions.-jb" + ImageMorph new + on: #click send: #exploreValues to: watchview; + newForm: ( + self newCellMorph + listDirection: #leftToRight; + wrapDirection: #topToBottom; + addAllMorphsBack: watchview displayedMorphs; + iconOrThumbnailOfSize: self newCellMorph extent)]. +] + { #category : #visualisation } SBPermutationCluster >> extractedLeftHeadingsFrom: aCollectionOfSBExampleWatches [ - ^ (aCollectionOfSBExampleWatches collect: [:aWatch | aWatch expression]) + ^ (aCollectionOfSBExampleWatches collect: [:aWatch | aWatch expression copy]) ] { #category : #visualisation } SBPermutationCluster >> extractedTopHeadingsFrom: aCollectionOfSBExampleWatches [ - ^ (aCollectionOfSBExampleWatches first exampleToDisplay values collect: [:aDisplay | aDisplay labelMorph]) + ^ (aCollectionOfSBExampleWatches first exampleToDisplay values collect: [:aDisplay | aDisplay labelMorph copy]) ] { #category : #visualisation } @@ -23,10 +39,15 @@ SBPermutationCluster >> watchesAsMatrix: aCollectionOfSBExampleWatches [ matrix := Matrix rows: aCollectionOfSBExampleWatches size + 1 columns: (aCollectionOfSBExampleWatches first examples size) + 1. - matrix atRow: 1 put: ({self newTopLeftCornerPlaceholder}, (self extractedTopHeadingsFrom: aCollectionOfSBExampleWatches)). - matrix atColumn: 1 put: ({self newTopLeftCornerPlaceholder}, (self extractedLeftHeadingsFrom: aCollectionOfSBExampleWatches)). + + matrix atRow: 1 put: ({self newTopLeftCornerPlaceholder}, + (self extractedTopHeadingsFrom: aCollectionOfSBExampleWatches)). + matrix atColumn: 1 put: ({self newTopLeftCornerPlaceholder}, + (self extractedLeftHeadingsFrom: aCollectionOfSBExampleWatches)). + aCollectionOfSBExampleWatches withIndexDo: [:aWatch :row | - aWatch exampleToDisplay withIndexDo: [:exampleDisplayAssc :column | . - matrix at: row+1 at: column+1 put: (exampleDisplayAssc display)]]. + (self extractColumnsFrom: aWatch) withIndexDo: [:aCellMorph :column| + matrix at: row+1 at: column+1 put: aCellMorph]]. + ^ matrix ] diff --git a/packages/Sandblocks-Babylonian/SBResultsView.class.st b/packages/Sandblocks-Babylonian/SBResultsView.class.st index ceb0768e..bd221626 100644 --- a/packages/Sandblocks-Babylonian/SBResultsView.class.st +++ b/packages/Sandblocks-Babylonian/SBResultsView.class.st @@ -85,11 +85,8 @@ SBResultsView >> buildPermutationFor: aPermutation collectingWatchesFrom: aColle self block addAllMorphsBack: { SBOwnTextMorph new contents: aPermutation asString. self applyButtonFor: aPermutation. - (self containerRow listDirection: #leftToRight) - addMorph: (( - SBPermutationCluster - newFromWatches: (self allWatchesIn: aCollectionOfMethodBlocks) - havingSize: (SBMorphResizer newSmall))). + (self containerRow listDirection: #leftToRight) + addAllMorphsBack: (self allWatchesIn: aCollectionOfMethodBlocks). LineMorph from: 0@0 to: 50@0 color: Color black width: 2} ] @@ -98,7 +95,7 @@ SBResultsView >> initialize [ super initialize. - self name: 'Possible Results' + self name: 'Simple View' ] { #category : #building } diff --git a/packages/Sandblocks-Watch/SBLineChart.class.st b/packages/Sandblocks-Watch/SBLineChart.class.st index c3429539..e52501c7 100644 --- a/packages/Sandblocks-Watch/SBLineChart.class.st +++ b/packages/Sandblocks-Watch/SBLineChart.class.st @@ -34,7 +34,7 @@ SBLineChart >> datapointDefaultColor [ { #category : #'visualization - constants' } SBLineChart >> datapointExtent [ - ^ 5@5 + ^ 4@4 ] { #category : #visualization } @@ -164,7 +164,7 @@ SBLineChart >> scaleYOffset [ { #category : #'visualization - constants' } SBLineChart >> spaceBetweenPoints [ - ^ 15 + ^ 10 ] { #category : #visualization } diff --git a/packages/Sandblocks-Watch/SBWatchView.class.st b/packages/Sandblocks-Watch/SBWatchView.class.st index 97ad503f..f7fb96ea 100644 --- a/packages/Sandblocks-Watch/SBWatchView.class.st +++ b/packages/Sandblocks-Watch/SBWatchView.class.st @@ -216,7 +216,7 @@ SBWatchView >> layoutCommands [ { #category : #layout } SBWatchView >> maxWidth [ - ^ 10 + ^ 350 ] { #category : #accessing }