// Requires the matching dashboard-enabled native development runtime.
// Run from the project root containing examples/fixtures/plot_boulder_missing.csv.
// Synthetic teaching counts and illustrative positions, not municipal observations.
import aner.data
import aner.plot

// Long format: counts may be missing; site/date/position metadata is required.
var schema = data.schema()
schema = data.column(schema, "date", "String", false)
schema = data.column(schema, "site", "String", false)
schema = data.column(schema, "longitude", "Float64", false)
schema = data.column(schema, "latitude", "Float64", false)
schema = data.column(schema, "count", "Float64", true)
let source = data.scan_csv("examples/fixtures/plot_boulder_missing.csv", schema, missing: "NA")
let bounded = data.bounded(source, max_scanned_rows: 11713,
    max_read_bytes: 8388608, timeout_ms: 5000)
let table = data.collect(bounded, max_rows: 11712,
    max_bytes: 4194304, batch_rows: 256)

// No map pack is needed. Positions and daily counts come from the collected table.
let dashboard = plot.site_dashboard_table(table)
    .title("Boulder: missing observations stay missing")
    .caption("Synthetic plot_boulder_missing.csv teaching counts, Oct 12-18 2026. NA and omitted records stay unknown; measured zero is retained. Illustrative sites.")
    .size(width: 1000, height: 600)
dashboard.show()

// Run in a writable folder with a fresh filename; existing files are never replaced.
// The exported snapshot preserves null counts and calendar gaps without reading CSV again.
dashboard.save("boulder-dashboard-missing.html")
