Public
Edited
Feb 1, 2023
11 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vl.markCircle()
.data(df)
.transform(vl.filter('datum.Name == "New York"')) /* filter to show only states */
.encode(
vl.y().fieldQ('Resident_Population'),
vl.x().fieldO('Year').scale({zero: false}),
vl.color().fieldN('Name')
)
.render({renderer: 'svg'})
Insert cell
Insert cell
vl.markLine()
.data(df)
.transform(vl.filter('datum.Name == "New Jersey"')) /* filter to show only states */
.encode(
vl.y().fieldQ('Resident_Population'),
vl.x().fieldO('Year').scale({zero: false}),
vl.color().fieldN('Name')
)
.height(600)
.width(400)
.render({ renderer: "svg" })
Insert cell
Insert cell
vl
.markCircle()
.data(df)
.transform(vl.filter('datum.Geography_Type == "State"')) /* filter to show only states */
.encode(
vl.y().fieldN("Name"),
vl.x().fieldO("Year").scale({ zero: false }),
vl.color().fieldQ("Number_of_Representatives"),
vl.size().fieldQ("Resident_Population")
)
.render({ renderer: "svg" })
Insert cell
Insert cell
vl.markRect()
.data(df)
.transform(vl.filter('datum.Geography_Type == "State"')) /* filter to show only states */
.encode(
vl.y().fieldN('Name'),
vl.x().fieldO('Year').scale({zero: false}),
vl.color().fieldQ('Resident_Population')
)
.width(400)
.render({renderer: 'svg'})
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.
Learn more