Published
Edited
Aug 31, 2020
3 stars
Insert cell
Insert cell
data = [
{ city: "seattle", state: "WA", population: 652405, land_area: 83.9 },
{ city: "new york", state: "NY", population: 8405837, land_area: 302.6 },
{ city: "boston", state: "MA", population: 645966, land_area: 48.3 },
{ city: "kansas city", state: "MO", population: 467007, land_area: 315 }
]
Insert cell
Insert cell
minLand = d3.min(data, function(d) {
return d.land_area;
})
Insert cell
maxLand = d3.max(data, d => d.land_area)
Insert cell
Insert cell
landExtent = d3.extent(data, d => d.land_area)
Insert cell
Insert cell
landAvg = d3.mean(data, d => d.land_area)
Insert cell
Insert cell
landMed = d3.median(data, d => d.land_area)
Insert cell
Insert cell
landSD = d3.deviation(data, d => d.land_area)
Insert cell
md`## Visualizing the data

You can also use [navio.dev](https://navio.dev) a visualization pluging that lets you summarize and explore large data with 4 lines of code, or 1 if you are in Observable.
`
Insert cell
import { navio } from "@john-guerra/navio"
Insert cell
viewof selected = navio(data)
Insert cell
md`You can also use it for filtering, try brushing the visualization, there are **${selected.length}** rows selected now.

Here is how Navio looks like with a larger dataset.

![Navio Demo with IEEEvis data](https://navio.dev/imgs/navio_thumb_v4.gif "Navio Demo with IEEEvis data")

Also check [this other notebook for loading your own data with a GUI](https://observablehq.com/@john-guerra/navio-load)`
Insert cell
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