Platform
Resources
Pricing
Sign in
Contact us
Lukas Hermann
Dataviz @ databricks
Workspace
Fork
Public
By
Lukas Hermann
Edited
Jan 26, 2023
Insert cell
Insert cell
data
=
await
require
(
"vega-datasets"
)
Insert cell
weatherdata
=
(
await
data
[
"seattle-weather.csv"
]
(
)
)
.
filter
(
(
{
date
}
)
=>
date
.
getFullYear
(
)
>
2014
&&
date
.
getMonth
(
)
>
8
)
Insert cell
temp_max_width
=
{
let
min
=
Number
.
MAX_VALUE
;
for
(
let
i
=
0
;
i
<
weatherdata
.
length
-
1
;
i
++
)
{
}
return
min
;
}
Insert cell
vl
.
markBar
(
{
width
:
{
expr
:
`scale('x')`
}
}
)
.
data
(
weatherdata
)
.
encode
(
vl
.
x
(
)
.
fieldT
(
"date"
)
,
vl
.
y
(
)
.
fieldQ
(
"precipitation"
)
)
.
width
(
width
)
.
height
(
500
)
.
toString
(
)
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
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
weatherdata
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
temp_max_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