2022-04-19 18:55:39 +00:00
|
|
|
accessing
|
|
|
|
exportRetweetsHistogram
|
|
|
|
|
2022-04-20 21:59:57 +00:00
|
|
|
| retweetsOccurrences labels retweetColor diagram retweetsHistogram |
|
2022-04-19 18:55:39 +00:00
|
|
|
|
2022-04-20 20:49:50 +00:00
|
|
|
retweetsOccurrences := self retweetsSortedByOccurrences.
|
2022-04-19 18:55:39 +00:00
|
|
|
retweetColor := (Color r:(217/255) g:(56/255) b: (124/255)).
|
2022-04-20 21:27:54 +00:00
|
|
|
labels := retweetsOccurrences keys.
|
2022-04-28 04:51:53 +00:00
|
|
|
labels := labels collect: [ :profiles | ('@', profiles) ].
|
2022-04-19 18:55:39 +00:00
|
|
|
retweetsHistogram := RSChart new.
|
|
|
|
retweetsHistogram extent: 800@200.
|
2022-04-20 21:59:57 +00:00
|
|
|
diagram := RSBarPlot new
|
|
|
|
x: (1 to: retweetsOccurrences size)
|
|
|
|
y: retweetsOccurrences values.
|
2022-04-19 18:55:39 +00:00
|
|
|
diagram color: retweetColor.
|
|
|
|
retweetsHistogram addPlot: diagram.
|
|
|
|
retweetsHistogram addDecoration: (RSHorizontalTick new
|
2022-04-20 21:27:54 +00:00
|
|
|
fromNames: labels;
|
|
|
|
labelRotation: 0;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /retweetsOccurrences size;
|
2022-04-20 21:27:54 +00:00
|
|
|
yourself).
|
2022-04-19 18:55:39 +00:00
|
|
|
retweetsHistogram addDecoration: (RSVerticalTick new
|
2022-04-20 21:27:54 +00:00
|
|
|
integer;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /retweetsOccurrences size).
|
2022-04-19 18:55:39 +00:00
|
|
|
retweetsHistogram build.
|
|
|
|
|
|
|
|
retweetsHistogram canvas pdfExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'retweets-histogram.pdf')fullName;
|
|
|
|
export.
|
|
|
|
retweetsHistogram canvas pngExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'retweets-histogram.png')fullName;
|
|
|
|
export.
|
|
|
|
^ self folder / 'retweets-histogram.png'
|