Platform
Solutions
Resources
Pricing
Sign in
Sign up
thometnanni
Workspace
Fork
Public
Teaching @ Weißensee Kunsthochschule
By
Giacomo Nanni
Edited
Oct 27, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
}
;
s
.
draw
=
function
(
)
{
s
.
background
(
255
)
;
s
.
stroke
(
255
,
0
,
0
)
;
s
.
ellipse
(
s
.
mouseX
,
s
.
mouseY
,
20
)
;
// x,y, radius
// ignore me: i am here just to show the mouse position :)
mutable
mouse
=
`${
s
.
mouseX
}, ${
s
.
mouseY
}`
;
}
;
}
)
Insert cell
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
s
.
stroke
(
255
,
0
,
0
)
;
}
;
s
.
draw
=
function
(
)
{
s
.
background
(
255
,
255
,
255
,
50
)
;
s
.
ellipse
(
s
.
mouseX
,
s
.
mouseY
,
20
)
;
}
;
}
)
Insert cell
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
}
;
s
.
draw
=
function
(
)
{
if
(
s
.
mouseIsPressed
)
{
s
.
stroke
(
"blue"
)
;
}
else
{
s
.
stroke
(
"red"
)
;
}
s
.
ellipse
(
s
.
mouseX
,
s
.
mouseY
,
20
)
;
}
;
}
)
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
}
;
s
.
draw
=
function
(
)
{
s
.
ellipse
(
s
.
mouseX
,
s
.
mouseY
,
20
,
20
)
;
}
;
s
.
mouseClicked
=
function
(
)
{
s
.
stroke
(
s
.
random
(
0
,
255
)
,
s
.
random
(
0
,
255
)
,
s
.
random
(
0
,
255
)
)
;
}
;
}
)
Insert cell
Insert cell
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
s
.
stroke
(
255
,
0
,
0
)
;
}
;
s
.
draw
=
function
(
)
{
mutable
pos
=
`${
s
.
mouseX
}, ${
s
.
mouseY
}`
;
s
.
ellipse
(
s
.
mouseX
,
s
.
mouseY
,
s
.
mouseX
/
5
,
s
.
mouseY
/
5
)
;
}
;
}
)
Insert cell
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
}
;
s
.
draw
=
function
(
)
{
s
.
noFill
(
)
;
s
.
stroke
(
s
.
random
(
0
,
255
)
,
120
,
255
)
;
s
.
ellipse
(
s
.
mouseX
,
s
.
mouseY
,
s
.
mouseX
/
5
,
s
.
mouseY
/
5
)
;
}
;
}
)
Insert cell
p5
(
(
s
)
=>
{
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
s
.
rectMode
(
s
.
CENTER
)
}
;
s
.
draw
=
function
(
)
{
s
.
noFill
(
)
;
s
.
stroke
(
s
.
random
(
0
,
255
)
,
s
.
random
(
0
,
255
)
,
s
.
random
(
0
,
255
)
)
;
s
.
rect
(
s
.
mouseX
,
s
.
mouseY
,
s
.
mouseX
/
5
,
s
.
mouseY
/
5
)
;
}
;
}
)
Insert cell
p5
(
(
s
)
=>
{
let
previousX
=
0
let
previousY
=
0
s
.
setup
=
function
(
)
{
s
.
createCanvas
(
width
,
400
)
;
s
.
colorMode
(
s
.
HSL
,
360
,
100
,
100
)
;
// Set color mode to HSL
}
;
s
.
draw
=
function
(
)
{
s
.
stroke
(
s
.
frameCount
%
360
,
100
,
50
)
;
s
.
line
(
previousX
,
previousY
,
s
.
mouseX
,
s
.
mouseY
)
previousX
=
s
.
mouseX
previousY
=
s
.
mouseY
}
;
}
)
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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
mouse
Edit
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
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
pos
Edit
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML