Public
Edited
May 18, 2023
1 fork
1 star
Insert cell
Insert cell
laxstats = FileAttachment("ncaa_stats_May17.csv").csv({typed: true})
Insert cell
import { vl } from "@vega/vega-lite-api" // Draw the chart

Insert cell
viewof varriousCharts = {

const ct_gb = vl.markCircle() // Make a scatter chart
.data(laxstats)
.title("Ground Balls and Turnovers by Non-FOGO's (FO Taken <30)")
.transform(
vl.filter('datum["Faceoffs Taken"] < 30'),
)
.encode(
vl.x().fieldQ("Ground Balls"),
vl.y().fieldQ("Caused Turnovers"),
vl.tooltip([vl.fieldN("Full Name"), vl.fieldO("Team"), vl.fieldN("Caused Turnovers"), vl.fieldN("Ground Balls")]),
)
.height(500)
.width(600);

const points_by_d = vl.markCircle() // Make a scatter chart
.data(laxstats)
.title("Points By Defensemen")
.transform(
vl.filter('datum.Position == "D"'),
)
.encode(
vl.x().fieldQ("Points"),
vl.y().fieldQ("Ground Balls"),
vl.tooltip([vl.fieldN("Full Name"), vl.fieldO("Team"), vl.fieldN("Caused Turnovers"), vl.fieldN("Ground Balls")]),
)
.height(500)
.width(600);
return vl.vconcat(vl.hconcat(ct_gb, points_by_d)).render()
}
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