23 lines
733 B
Smalltalk
23 lines
733 B
Smalltalk
accessing
|
|
repliesByWeeksTimeSpan
|
|
|
|
| tweetsByTimeSpan xAxis labels |
|
|
self replies isEmpty
|
|
ifTrue: [ ^ { OrderedDictionary new.
|
|
('[''', '0', ''']').
|
|
('[''', 'No replies', ''']')} ].
|
|
tweetsByTimeSpan := self collectMessages: [ self replies ] byTimeSpanSplits: self tweetsDivisionsByWeeks.
|
|
xAxis := OrderedCollection new.
|
|
(tweetsByTimeSpan values collect: [ :collection | collection size ]) do: [ :number |
|
|
xAxis add: ($' asString), (number asString), ($' asString)
|
|
].
|
|
labels := OrderedCollection new.
|
|
tweetsByTimeSpan keys do: [ :string |
|
|
labels add: ($' asString), string, ($' asString)
|
|
].
|
|
^ {
|
|
tweetsByTimeSpan.
|
|
('[', (',' join: xAxis), ']').
|
|
('[', (',' join: labels), ']').
|
|
}
|
|
|