Platform
Resources
Pricing
Sign in
Get started
Toph Tucker
Workspace
Fork
Public
Sketches
By
Toph Tucker
Edited
May 30, 2023
1
Insert cell
Insert cell
str
=
"de156a2fc8"
Insert cell
Insert cell
str
.
length
Insert cell
Insert cell
"fd94de585b2c3ba5"
.
length
Insert cell
Insert cell
Math
.
random
(
)
.
toString
(
16
)
.
slice
(
2
,
2
+
str
.
length
)
Insert cell
Insert cell
chars
=
[
...
str
]
Insert cell
Plot
.
auto
(
chars
,
{
x
:
(
d
)
=>
d
}
)
.
plot
(
{
height
:
80
}
)
Insert cell
Insert cell
Plot
.
auto
(
chars
,
{
x
:
(
d
)
=>
d
}
)
.
plot
(
{
height
:
80
,
x
:
{
domain
:
d3
.
range
(
0
,
16
)
.
map
(
(
d
)
=>
d
.
toString
(
16
)
)
}
}
)
Insert cell
Insert cell
getRandomHex
=
(
)
=>
Math
.
random
(
)
.
toString
(
16
)
.
slice
(
2
,
2
+
str
.
length
)
Insert cell
ex
=
getRandomHex
(
)
Insert cell
Insert cell
usesDigitMultipleTimes
=
(
str
)
=>
d3
.
rollups
(
[
...
str
]
,
(
arr
)
=>
arr
.
length
,
(
d
)
=>
d
)
.
filter
(
(
[
,
count
]
)
=>
count
>
1
)
.
length
>
0
Insert cell
usesDigitMultipleTimes
(
ex
)
Insert cell
Insert cell
d3
.
range
(
10
)
.
map
(
getRandomHex
)
.
map
(
n
=>
[
n
,
usesDigitMultipleTimes
(
n
)
]
.
join
(
" "
)
)
.
join
(
"\n"
)
Insert cell
Insert cell
getFraction
=
(
n
,
generator
,
predicate
)
=>
d3
.
range
(
n
)
.
map
(
generator
)
.
filter
(
predicate
)
.
length
/
n
Insert cell
frac
=
getFraction
(
1000
,
getRandomHex
,
usesDigitMultipleTimes
)
Insert cell
d3
.
format
(
".1%"
)
(
frac
)
Insert cell
Insert cell
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
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
str
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chars
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getRandomHex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ex
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
usesDigitMultipleTimes
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
getFraction
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
frac
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML