Platform
Resources
Pricing
Sign in
Get started
Vega
Data Visualization Languages & Tools
Workspace
Fork
Published
By
Jeffrey Heer
Edited
Apr 19, 2019
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
// A simple function to show a Vega specification in an Observable cell, and
// bind the Vega View instance as the value property of the container div.
plot
=
function
(
spec
)
{
const
div
=
html
`<div></div>`
;
div
.
value
=
new
vega
.
View
(
vega
.
parse
(
spec
)
)
.
renderer
(
'svg'
)
.
initialize
(
div
)
.
run
(
)
;
return
div
;
}
Insert cell
// use addArrowFormat utility, see import below
vega
=
addArrowFormat
(
await
require
(
'vega@5'
)
)
Insert cell
import
{
addArrowFormat
}
from
'@vega/vega-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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
view
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plot
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
vega
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