Platform
Resources
Pricing
Sign in
Contact us
Shirley Wu
Award-winning creative focused on data-driven art and visualizations, trying to push the boundaries of the web one visual story at a time ✨
Workspace
Fork
Public
By
Shirley Wu
Edited
Mar 3, 2023
1 fork
3 stars
Insert cell
1
Insert cell
width
=
512
Insert cell
{
const
canvas
=
DOM
.
canvas
(
width
,
width
)
;
const
gl
=
canvas
.
getContext
(
"canvas"
)
;
return
canvas
;
}
Insert cell
class
Particle
{
constructor
(
)
{
this
.
position
=
vec2
.
create
(
)
;
this
.
velocity
=
vec2
.
create
(
)
;
this
.
acceleration
=
vec2
.
create
(
)
;
}
}
Insert cell
import
{
initShaderProgram
,
initPositionBuffer
,
setPositionAttribute
}
from
"@sxywu/00-webgl-setup"
Insert cell
import
{
vec2
,
vec3
}
from
"@sxywu/00-3-nature-of-code-utilities"
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
Show 1 comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
width
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Particle
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