diff --git a/Socialmetrica.package/NitterUser.class/instance/asDictionaryForWeb.st b/Socialmetrica.package/NitterUser.class/instance/asDictionaryForWeb.st index c42e00d..3f24477 100644 --- a/Socialmetrica.package/NitterUser.class/instance/asDictionaryForWeb.st +++ b/Socialmetrica.package/NitterUser.class/instance/asDictionaryForWeb.st @@ -4,7 +4,7 @@ asDictionaryForWeb | tweets tweetsHistogramData repliesHistogramData quotesHistogramData retweetsHistogramData | tweets := self messages. tweetsHistogramData := self tweetsByTimeSpan: 7. - repliesHistogramData := self repliesByWeeksTimeSpan. + repliesHistogramData := self repliesByTimeSpan: 7. quotesHistogramData := self quotesReportData. retweetsHistogramData := self retweetsReportData. diff --git a/Socialmetrica.package/NitterUser.class/instance/repliesByTimeSpan..st b/Socialmetrica.package/NitterUser.class/instance/repliesByTimeSpan..st new file mode 100644 index 0000000..0a2902c --- /dev/null +++ b/Socialmetrica.package/NitterUser.class/instance/repliesByTimeSpan..st @@ -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), ']'). + } + \ No newline at end of file