Platform
Resources
Pricing
Sign in
Contact us
Jan Žák
Freelance Data Visualization Engineer / Consultant · High-performance Geospatial and Node-Link Graph Visualizations
Workspace
Fork
Published
Libraries
By
Jan Žák
Edited
Apr 5, 2020
Importers
1 star
Libraries
Utils
FPS meter
Inputs Form
Insert cell
Insert cell
formatInt
=
value
=>
new
Intl
.
NumberFormat
(
'en-US'
,
{
maximumFractionDigits
:
0
}
)
.
format
(
value
)
Insert cell
formatFloat
=
value
=>
new
Intl
.
NumberFormat
(
'en-US'
)
.
format
(
value
)
Insert cell
offset
=
(
i
,
start
,
step
)
=>
start
+
i
*
step
;
Insert cell
range
=
n
=>
new
Array
(
n
)
.
fill
(
undefined
)
.
map
(
(
_
,
i
)
=>
i
)
Insert cell
uniq
=
items
=>
Array
.
from
(
new
Set
(
items
)
)
Insert cell
randomNumber
=
(
min
,
max
)
=>
Math
.
floor
(
Math
.
random
(
)
*
(
max
-
min
+
1
)
)
+
min
Insert cell
randomString
=
(
)
=>
Math
.
floor
(
Math
.
random
(
)
*
10e12
)
.
toString
(
36
)
Insert cell
randomUuid
=
(
)
=>
{
return
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
.
replace
(
/[xy]/g
,
c
=>
{
const
r
=
(
Math
.
random
(
)
*
16
)
|
0
;
const
v
=
c
===
"x"
?
r
:
(
r
&
0x3
)
|
0x8
;
return
v
.
toString
(
16
)
;
}
)
;
}
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
formatInt
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
formatFloat
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
offset
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
uniq
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
randomNumber
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
randomString
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
randomUuid
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML