We started off this year’s challenge with a look at the impending mass closures of various Walgreens and Rite Aid stores.

They didn’t start the fire, though.

Two years ago, CVS started a store purge. That link goes to a repo that has scraping code and did initial scrapes to create a diff’able data set.

I grabbed that code and decided to use the Observable Plot hexbin capability to show the density of CVS stores at that time.

Perhaps, by the end of this year’s challenge, I’ll re-scrape the remaining stores and show a diff of the new data.

Code
Plot = require("@observablehq/plot")
// This is a geojson file we'll see quite a bit of this month
us = FileAttachment("static/data/us-counties-10m.json").json();

// taking various subsets to plot as different layers
statemesh = topojson.mesh(us, us.objects.states);
states = topojson.feature(us, us.objects.states).features;
nation = topojson.feature(us, us.objects.nation);

// our store data
stores = FileAttachment("static/data/cvs-stores.csv").csv({ typed: true });

cvsRed = "#DA1A00";

Plot.plot({
    className: "cvs",
    projection: "albers-usa",
    width: width,
  style: {
    background: "transparent"
  },
    r: { range: [0, 12] },
    color: {
        scheme: "reds",
        label: "CVS Store Density (binned count)",
        legend: true,
    },
    marks: [
        Plot.geo(statemesh, { strokeWidth: 0.25, strokeOpacity: 0.5 }),
        Plot.geo(nation, { strokeWidth: 0.5}),
        Plot.dot(
            stores,
            Plot.hexbin(
                { r: "count", fill: "count" },
                { x: "lng", y: "lat", stroke: "#c3c3c3", strokeWidth: 2 / 4, tip: true }
            )
        ),
    ],
});