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

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.
Learn more