This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Giving a color to a number | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
canvas := RSCanvas new. | |
scale := NSScale category20c. | |
r := Random seed: 42. | |
81 timesRepeat: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Connecting charts | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
g1 := RSChart new. | |
p1 := RSLinePlot new. | |
p1 y: #(5 10 3 -4 -5 15). | |
g1 addPlot: p1. | |
g1 addDecoration: (RSXLabelDecoration new title: 'Time'; offset: 0 @ 10). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Building and Visualizing graphs | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
numberOfNodes := 25. | |
numberOfLines := 90. | |
r := Random seed: 42. | |
graph := Dictionary new. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Normalizing over multiple values | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
values := 0 to: 1 count: 20. | |
scale := NSScale linear | |
range: { Color blue . Color gray . Color red }; | |
domain: { 0 . 0.5 . 1 }. | |
canvas := RSCanvas new. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Normalizing size and color | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
values := #(3 6 10 2). | |
canvas := RSCanvas new. | |
shapes := RSCircle models: values. | |
canvas addAll: shapes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Nesting lines | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
canvas := RSCanvas new. | |
1 to: 100 by: 10 do: [ :i | | |
g := RSCircle models: (1 to: i) forEach: [ :s :nb | s color: Color random translucent ]. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: dynamically computed control points of a bezier line | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
canvas := RSCanvas new. | |
box1 := RSBox new color: Color blue. | |
box2 := RSBox new color: Color red. | |
box2 translateTo: 100 @ -200. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Chimistry time | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
c := RSCanvas new. | |
svgPaths := | |
#('M17.46,22H6.54a4.55,4.55,0,0,1-3.42-7.54L9,7.75V4a1,1,0,0,1,2,0V8.12a1,1,0,0,1-.25.66l-6.12,7A2.54,2.54,0,0,0,6.54,20H17.46a2.54,2.54,0,0,0,1.91-4.22l-6.12-7A1,1,0,0,1,13,8.12V6.5a1,1,0,0,1,2,0V7.75l5.88,6.71A4.55,4.55,0,0,1,17.46,22Z' | |
'M15,4.12H9a1,1,0,0,1,0-2h6a1,1,0,0,1,0,2Z' | |
'M19,15H10a1,1,0,0,1,0-2h9a1,1,0,0,1,0,2Z' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Playing with the fonts | |
By Milton Mamani | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
text := 'La donna è mobile | |
Qual piuma al vento | |
Muta d''accento | |
E di pensiero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Script of the day: Normalizing color using a category scale | |
https://github.com/ObjectProfile/Roassal3 | |
https://twitter.com/Roassal1 | |
" | |
c := RSCanvas new. | |
shapes := (1 to: 150) collect: [ :n | RSEllipse new size: 20; model: (n % 5) ] as: RSGroup. | |
c addAll: shapes. | |
RSGridLayout on: shapes. |
NewerOlder