Platform
Resources
Pricing
Sign in
Get started
John Alexis Guerra Gómez
I love to build dataviz for insight discovery. I also love to put technology to the service of humanity
Workspace
Fork
Published
By
John Alexis Guerra Gómez
Edited
May 5, 2022
Fork of
Vega Lite API Streamgraph without categories
4 stars
Insert cell
Insert cell
Plot
.
plot
(
{
x
:
{
type
:
"utc"
}
,
marks
:
[
Plot
.
areaY
(
data
,
Plot
.
stackY
(
{
offset
:
"center"
}
,
Plot
.
groupX
(
{
y
:
"sum"
}
,
{
y
:
"count"
,
x
:
"date"
,
fill
:
"steelblue"
}
)
)
)
]
}
)
Insert cell
Insert cell
Plot
.
plot
(
{
x
:
{
type
:
"utc"
}
,
marks
:
[
Plot
.
areaY
(
data
,
Plot
.
stackY
(
{
offset
:
"center"
}
,
Plot
.
binY
(
{
y
:
"sum"
,
thresholds
:
d3
.
utcHour
}
,
{
y
:
"count"
,
x
:
"date"
,
fill
:
"steelblue"
}
)
)
)
]
}
)
Insert cell
Insert cell
vl
.
markArea
(
)
.
encode
(
vl
.
x
(
)
.
fieldT
(
"date"
)
.
timeUnit
(
"yearmonthdate"
)
,
vl
.
y
(
)
.
sum
(
"count"
)
.
stack
(
"center"
)
.
axis
(
null
)
,
vl
.
detail
(
)
.
fieldN
(
"notAnAttribute"
)
)
.
width
(
width
*
0.8
)
.
data
(
data
)
.
title
(
"Total Unemployment data"
)
.
render
(
)
Insert cell
And some other solutions proposed by Mike
Insert cell
Plot
.
plot
(
{
x
:
{
type
:
"utc"
}
,
marks
:
[
Plot
.
areaY
(
data
,
Plot
.
groupX
(
{
y
:
"sum"
}
,
{
y
:
"count"
,
x
:
"date"
,
offset
:
"center"
}
)
)
]
}
)
Insert cell
Plot
.
plot
(
{
x
:
{
type
:
"utc"
}
,
marks
:
[
Plot
.
areaY
(
data
,
{
y
:
"count"
,
x
:
"date"
,
z
:
"series"
,
offset
:
"center"
}
)
]
}
)
Insert cell
import
{
vl
}
from
"@vega/vega-lite-api-v5"
Insert cell
data
=
(
await
require
(
"vega-datasets"
)
)
[
"unemployment-across-industries.json"
]
(
)
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
Compare fork
Fork
View
Export
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
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML