Published
Edited
Jul 29, 2021
2 stars
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(data, {
x: "Height",
y: "Weight",
r: 3,
fill: "black",
fillOpacity: 0.1
})
]
})
Insert cell
If I force it to read the values as numbers, then the NAs are just not-shown. It would be nice to have some indication that data is not being shown, so that I as a user could decide to do something about that.
Insert cell
Plot.plot({
marks: [
Plot.dot(data, {
x: (d) => +d.Height,
y: (d) => +d.Weight,
r: 3,
fill: "black",
fillOpacity: 0.1
})
]
})
Insert cell
Insert cell
addTooltips(
Plot.plot({
marks: [
Plot.dot(data, {
x: (d) => (d.Height == "NA" ? -1 : +d.Height),
y: (d) => (d.Weight == "NA" ? -1 : +d.Weight),
r: 3,
fill: "black",
fillOpacity: 0.1,
title: (d) => d.Name + " " + d.Height + " " + d.Weight
})
],
width: width
})
)
Insert cell
isna = data.filter((d) => (d.Height == "NA") | (d.Weight == "NA"))
Insert cell
Inputs.table(isna) // Either height or weight is 'NA'
Insert cell
Insert cell
Insert cell
Insert cell
SummaryTable(data)
Insert cell
import { SummaryTable } from "@observablehq/summary-table"
Insert cell
import { addTooltips } from "@mkfreeman/plot-tooltip"
Insert cell
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