// Requires the updated native development runtime with city viewports and aner.geo.
// Install packs usa.co, usa.ca, usa.ny, usa.hi and usa.tx before running offline.
// Values are synthetic. Boundaries: generalized Census 2025 1:500,000 source.
// Run the matching notebook for one bounded output cell per city.
import aner.plot
import aner.geo

let cityCaption = "Synthetic index; Census 2025 place boundary. Missing places have no data."
let boulder = plot.map("usa.co.places", List("0807850"), List(8.0))
    .focus(key: "0807850", padding: 0.20)
    .projection("lambert_azimuthal_equal_area")
    .title("Boulder city, Colorado")
    .caption("Synthetic index; Census 2025 municipal boundary, distinct from Boulder County.")
boulder.show()

let california = plot.map(region: "usa.ca.places",
    keys: List("0667000", "0644000", "0655282"), values: List(12.0, 18.0, 9.0))
california.focus("0667000")
    .extent(west: -122.56, south: 37.68, east: -122.32, north: 37.84)
    .title("San Francisco urban extent")
    .caption("Synthetic index; Census 2025; urban viewport excludes offshore Farallon parts.").show()
california.focus("0644000").title("Los Angeles").caption(cityCaption).show()
california.focus("0655282").title("Palo Alto").caption(cityCaption).show()

// Geographic bounds use longitude/latitude degrees and can be reused across charts.
let bayArea = geo.extent(west: -122.65, south: 37.20, east: -121.70, north: 38.15)
california.extent(bounds: bayArea).projection("auto")
    .title("Bay Area places in a fixed geographic extent").caption(cityCaption).show()

plot.map("usa.ny.places", List("3651000"), List(11.0))
    .focus("3651000").title("New York City").caption(cityCaption).show()
plot.map("usa.hi.places", List("1571550"), List(7.0))
    .focus("1571550").title("Urban Honolulu, Hawaii").caption(cityCaption).show()
plot.map("usa.tx.places", List("4835000"), List(13.0))
    .focus("4835000").title("Houston, Texas").caption(cityCaption).show()
plot.map("usa.tx.counties", List("48201"), List(13.0))
    .projection("albers").title("Texas counties: Harris County highlighted")
    .caption("Synthetic index; Census 2025 counties. Albers is a spherical display projection.").show()

// All 50 states and DC have usa.<lowercase-postal>.counties and .places layers.
// Focus and extent retain the full chart color range and other nearby boundaries.
// Zoom cannot add streets or recover boundary detail absent from the source.
