Notebooks 2.0 is here.
Read the preview announcement
Platform
Resources
Pricing
Sign in
Get started
Dylan
Senior Software Engineer at the Center for Spatial Data Science, UChicago. Lead engineer on the US Covid Atlas
Workspace
Fork
Published
By
Dylan
Edited
May 6, 2019
1 fork
Insert cell
md
`# Random Fox Generator`
Insert cell
d3
=
require
(
'd3'
)
Insert cell
$
=
require
(
'jquery'
)
Insert cell
url
=
"https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=ea61f3692f37cf92a8df83f3df1d9d9d&tags=vulpes+vulpes&safe_search=1&per_page=200"
Insert cell
html
`<div id="images"></div>`
Insert cell
{
var
src
;
$
.
getJSON
(
url
+
"&format=json&jsoncallback=?"
,
function
(
data
)
{
let
item
=
data
.
photos
.
photo
[
Math
.
floor
(
Math
.
random
(
)
*
Object
.
keys
(
data
.
photos
.
photo
)
.
length
)
]
;
src
=
"http://farm"
+
item
.
farm
+
".static.flickr.com/"
+
item
.
server
+
"/"
+
item
.
id
+
"_"
+
item
.
secret
+
"_m.jpg"
;
$
(
"<img/>"
)
.
attr
(
"src"
,
src
)
.
appendTo
(
"#images"
)
;
}
)
;
}
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
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
url
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