API Reference

Functions

StateBins.statebinsFunction
statebins(data::DataFrame; kwargs...)

Create a statebins plot using a Makie.jl backend. Requires a Makie backend (e.g., using CairoMakie) to be loaded.

Example

using StateBins, CairoMakie, CSV, DataFrames

# Assuming you have a CSV file with state and value columns
df = CSV.read("database/votes.csv", DataFrame)

statebins(df, 
    state_col="state", 
    value_col="margin", 
    title="Election Results",
    colorscheme=:RdBu)

Data

The STATE_COORDS constant contains coordinate grid positions for all US states, DC, Puerto Rico, Virgin Islands, and New York City.

Module Index