Platform
Resources
Pricing
Sign in
Get started
Sylvain Lesage
Software engineer at Hugging Face. Prototyping here with JS, d3, three.js.
Workspace
Fork
Published
2 collections
By
Sylvain Lesage
Edited
Apr 13, 2020
TIL
d3.group can take an arbitrary number of keys
drawImage respects canvas transparency
CSV rows can be selected with an URL fragment
Create an histogram in one line of code
Canvas equality by value
threejs Plane.constant is reversed!
Also listed in…
Image
Insert cell
Insert cell
canvasA
=
{
const
ctx
=
DOM
.
context2d
(
w
,
h
)
;
ctx
.
strokeStyle
=
'steelblue'
;
ctx
.
lineWidth
=
8
;
ctx
.
strokeRect
(
w
/
4
,
h
/
4
,
w
/
2
,
h
/
2
)
;
return
ctx
.
canvas
;
}
Insert cell
Insert cell
canvasB
=
{
const
ctx
=
DOM
.
context2d
(
w
,
h
)
;
ctx
.
strokeStyle
=
'red'
;
ctx
.
lineWidth
=
8
;
ctx
.
strokeRect
(
w
/
8
,
h
/
8
,
w
/
4
,
(
3
*
h
)
/
4
)
;
return
ctx
.
canvas
;
}
Insert cell
Insert cell
canvasC
=
{
const
ctx
=
DOM
.
context2d
(
w
,
h
)
;
// drawImage respects the transparency
ctx
.
drawImage
(
canvasA
,
0
,
0
,
w
,
h
)
;
ctx
.
drawImage
(
canvasB
,
0
,
0
,
w
,
h
)
;
return
ctx
.
canvas
;
}
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
Listed in...
TIL
Sylvain Lesage
Image
Sylvain Lesage
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
canvasA
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
canvasB
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
canvasC
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
w
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
h
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML