Socialmetrica/Socialmetrica.package/NitterUser.class/instance/quotesReportData.st

18 lines
522 B
Smalltalk
Raw Normal View History

accessing
quotesReportData
| tempDict labels xAxis |
tempDict := self quotesSortedByOccurrences.
2022-06-09 21:02:35 +00:00
tempDict size > 10 ifTrue: [
tempDict := (tempDict associations copyFrom: 1 to: 10) asOrderedDictionary ].
2022-06-09 21:02:35 +00:00
labels := tempDict keys.
labels := labels collect: [ :profile | ($' asString), '@', profile, ($' asString) ].
xAxis := tempDict values.
xAxis := xAxis collect: [ :value | ($' asString), (value asString), ($' asString) ].
^ {
tempDict.
('[', (',' join: xAxis), ']').
('[', (',' join: labels), ']').
}