Platform
Resources
Pricing
Sign in
Get started
Fil
Vocateur.
Workspace
Fork
Published
By
Fil
Edited
Apr 4, 2022
9 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
heatmap
(
r
,
{
width
,
color
}
)
Insert cell
r
=
Uint8ClampedArray
.
from
(
{
length
:
width
*
height
}
,
(
_
,
i
)
=>
{
const
a
=
(
i
%
width
)
/
step
;
const
b
=
Math
.
floor
(
i
/
width
)
/
step
;
return
a
*
n
-
b
*
n
===
(
a
-
b
)
*
n
;
}
)
Insert cell
heatmap
(
truth
,
{
width
,
color
}
)
Insert cell
truth
=
Uint8ClampedArray
.
from
(
{
length
:
width
*
height
}
,
(
_
,
i
)
=>
{
const
a
=
(
i
%
width
)
/
step
;
const
b
=
Math
.
floor
(
i
/
width
)
/
step
;
return
a
*
n
-
b
*
n
+
b
*
n
===
a
*
n
;
}
)
Insert cell
Insert cell
r2
=
Uint8ClampedArray
.
from
(
{
length
:
width
*
height
}
,
(
_
,
i
)
=>
{
const
a
=
(
i
%
width
)
/
step
;
const
b
=
Math
.
floor
(
i
/
width
)
/
step
;
return
a
*
n
-
b
*
n
===
d3
.
fsum
(
[
a
,
-
b
]
)
*
n
;
}
)
Insert cell
heatmap
(
r2
,
{
width
,
color
}
)
Insert cell
Insert cell
import
{
heatmap
}
from
"@fil/heatmap"
Insert cell
color
=
(
t
)
=>
(
t
?
"#fff"
:
"#000"
)
Insert cell
height
=
width
Insert cell
a
=
1.2
Insert cell
b
=
1.64
Insert cell
(
a
-
b
)
*
n
Insert cell
a
*
n
-
b
*
n
Insert cell
d3
.
fsum
(
[
a
,
-
b
]
)
*
n
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
step
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
n
Edit
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
r
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
truth
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
r2
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
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
color
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
a
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
b
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML