Platform
Solutions
Resources
Pricing
Sign in
Sign up
Mike Bostock
Visualization toolmaker. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.
Workspace
Fork
Published
By
Mike Bostock
Edited
Sep 17, 2019
Fork of
Live selection
•
4 forks
12 stars
Insert cell
Insert cell
value
=
Generators
.
observe
(
notify
=>
{
const
signaled
=
(
name
,
value
)
=>
notify
(
value
)
;
chart
.
addSignalListener
(
"selection1"
,
signaled
)
;
notify
(
chart
.
signal
(
"selection1"
)
)
;
return
(
)
=>
chart
.
removeSignalListener
(
"selection1"
,
signaled
)
;
}
)
Insert cell
viewof
chart
=
vegalite
(
{
"width"
:
360
,
"data"
:
{
"values"
:
[
{
"a"
:
"A"
,
"b"
:
28
}
,
{
"a"
:
"B"
,
"b"
:
55
}
,
{
"a"
:
"C"
,
"b"
:
43
}
,
{
"a"
:
"D"
,
"b"
:
91
}
,
{
"a"
:
"E"
,
"b"
:
81
}
,
{
"a"
:
"F"
,
"b"
:
53
}
,
{
"a"
:
"G"
,
"b"
:
19
}
,
{
"a"
:
"H"
,
"b"
:
87
}
,
{
"a"
:
"I"
,
"b"
:
52
}
]
}
,
"mark"
:
"bar"
,
"encoding"
:
{
"x"
:
{
"field"
:
"a"
,
"type"
:
"ordinal"
}
,
"y"
:
{
"field"
:
"b"
,
"type"
:
"quantitative"
}
}
,
"selection"
:
{
"selection1"
:
{
"fields"
:
[
"a"
]
,
"on"
:
"mouseover"
,
"type"
:
"single"
}
}
}
)
Insert cell
vegalite
=
require
(
"@observablehq/vega-lite@0.2"
)
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
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
value
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
chart
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
vegalite
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML