Platform
Resources
Pricing
Sign in
Contact us
charlie ✨
design / code / architecture
Workspace
Fork
Published
sketches
By
charlie ✨
Edited
May 30, 2021
Fork of
gen 053021-1c
•
1 fork
sketches
Eames color blocks
Bullseye Animation
basic circles
p5.js
gen 092020-1a
gen 092020-1b
gen 052921-1a
gen 052921-1b
gen 052921-1c
gen 052921-1d
gen 052921-1e
gen 053021-1a
gen 053021-1b
gen 053021-1c
gen 053021-1d
gen 053021-1e
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
palette
=
getRandomPalette
(
)
Insert cell
d3
=
require
(
"d3@6"
)
Insert cell
Insert cell
//https://observablehq.com/@karlsluis/rotating-polygons
toRadians
=
(
angle
)
=>
{
return
angle
*
(
Math
.
PI
/
180
)
;
}
Insert cell
// // helper method to make translating easier, via https://observablehq.com/@sjengle/zillow-affordability-heatmap
translate
=
function
(
x
,
y
)
{
return
"translate("
+
x
+
","
+
y
+
")"
;
}
;
Insert cell
array
=
n
=>
new
Array
(
n
)
.
fill
(
0
)
.
map
(
(
d
,
i
)
=>
i
)
Insert cell
random
=
(
a
,
b
)
=>
{
if
(
Array
.
isArray
(
a
)
)
return
a
[
Math
.
random
(
)
*
a
.
length
|
0
]
if
(
!
a
&&
a
!==
0
)
return
Math
.
random
(
)
if
(
!
b
&&
b
!==
0
)
return
Math
.
random
(
)
*
a
if
(
a
>
b
)
[
a
,
b
]
=
[
b
,
a
]
// swap values
return
a
+
Math
.
random
(
)
*
(
b
-
a
)
}
Insert cell
randInt
=
(
a
,
b
)
=>
~
~
random
(
a
,
b
)
Insert cell
shuffle
=
arr
=>
{
let
copy
=
[
...
arr
]
// create a copy of original array
for
(
let
i
=
copy
.
length
-
1
;
i
;
i
--
)
{
let
randomIndex
=
randInt
(
i
+
1
)
;
[
copy
[
i
]
,
copy
[
randomIndex
]
]
=
[
copy
[
randomIndex
]
,
copy
[
i
]
]
// swap
}
return
copy
}
Insert cell
range
=
(
start
,
end
,
step
=
1
)
=>
array
(
Math
.
ceil
(
(
end
-
start
+
1
)
/
step
)
)
.
map
(
(
d
,
i
)
=>
start
+
i
*
step
)
Insert cell
import
{
palettes
,
scales
,
getRandomPalette
}
from
'@makio135/give-me-colors'
Insert cell
import
{
slider
}
from
"@jashkenas/inputs"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
svg
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
iris
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
boxCount
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
boxSpacing
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
nSides
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
rotIncrements
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
palette
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
toRadians
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
translate
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
array
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
random
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
randInt
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
shuffle
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
range
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML