Skip to content

Commit 46891c6

Browse files
authored
Merge pull request #129 from DurieuxPol/feat/heatmap
More customizable heatmaps
2 parents 8f99e03 + b3a8991 commit 46891c6

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

src/MuTalk-Examples/MTAnalysis.extension.st

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ MTAnalysis class >> exampleWithHeatmap [
4444
| matrix |
4545
matrix := MTMatrix forClasses: { MyVehicle }.
4646
matrix build.
47-
matrix generateHeatmap
47+
matrix generateHeatmapByMethod
4848
]
4949

5050
{ #category : '*MuTalk-Examples' }

src/MuTalk-Utilities/MTAnalysis.extension.st

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
Extension { #name : 'MTAnalysis' }
22

33
{ #category : '*MuTalk-Utilities' }
4-
MTAnalysis >> generateHeatmap [
4+
MTAnalysis >> generateHeatmapByClass [
55

66
| matrix |
77
matrix := MTMatrix new analysis: self.
8-
matrix generateHeatmap
8+
matrix generateHeatmapByClass
9+
]
10+
11+
{ #category : '*MuTalk-Utilities' }
12+
MTAnalysis >> generateHeatmapByMethod [
13+
14+
| matrix |
15+
matrix := MTMatrix new analysis: self.
16+
matrix generateHeatmapByMethod
17+
]
18+
19+
{ #category : '*MuTalk-Utilities' }
20+
MTAnalysis >> generateHeatmapByOperator [
21+
22+
| matrix |
23+
matrix := MTMatrix new analysis: self.
24+
matrix generateHeatmapByOperator
925
]
1026

1127
{ #category : '*MuTalk-Utilities' }

src/MuTalk-Utilities/MTMatrix.class.st

+23-3
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,31 @@ MTMatrix >> fillMatrix [
213213
]
214214

215215
{ #category : 'rendering' }
216-
MTMatrix >> generateHeatmap [
216+
MTMatrix >> generateHeatmapByClass [
217+
218+
self generateHeatmapWithMutationsGroupedBy: [ :mutation |
219+
mutation originalClass ]
220+
]
221+
222+
{ #category : 'rendering' }
223+
MTMatrix >> generateHeatmapByMethod [
224+
225+
self generateHeatmapWithMutationsGroupedBy: [ :mutation |
226+
mutation originalMethod name ]
227+
]
228+
229+
{ #category : 'rendering' }
230+
MTMatrix >> generateHeatmapByOperator [
231+
232+
self generateHeatmapWithMutationsGroupedBy: [ :mutation |
233+
mutation operator species ]
234+
]
235+
236+
{ #category : 'rendering' }
237+
MTMatrix >> generateHeatmapWithMutationsGroupedBy: aBlock [
217238

218239
| heatmap mutationDictionary testDictionary |
219-
mutationDictionary := mutations groupedBy: [ :mutation |
220-
mutation operator species ].
240+
mutationDictionary := mutations groupedBy: aBlock.
221241
testDictionary := testCases groupedBy: #testCaseClass.
222242

223243
heatmap := self initializeHeatmap.

0 commit comments

Comments
 (0)