Creating replies by time span.

This commit is contained in:
ruidajo 2022-06-09 15:53:58 -05:00
parent c8e7509e6a
commit 33dccbc851
2 changed files with 20 additions and 1 deletions

View File

@ -4,7 +4,7 @@ asDictionaryForWeb
| tweets tweetsHistogramData repliesHistogramData quotesHistogramData retweetsHistogramData | | tweets tweetsHistogramData repliesHistogramData quotesHistogramData retweetsHistogramData |
tweets := self messages. tweets := self messages.
tweetsHistogramData := self tweetsByTimeSpan: 7. tweetsHistogramData := self tweetsByTimeSpan: 7.
repliesHistogramData := self repliesByWeeksTimeSpan. repliesHistogramData := self repliesByTimeSpan: 7.
quotesHistogramData := self quotesReportData. quotesHistogramData := self quotesReportData.
retweetsHistogramData := self retweetsReportData. retweetsHistogramData := self retweetsReportData.

View File

@ -0,0 +1,19 @@
accessing
repliesByTimeSpan: divisions
| tweetsByTimeSpan xAxis labels |
tweetsByTimeSpan := self collectMessages: [ self replies ] byTimeSpanSplits: divisions.
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), ']').
}