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 monthus =FileAttachment("static/data/us-counties-10m.json").json();// taking various subsets to plot as different layersstatemesh = topojson.mesh(us, us.objects.states);states = topojson.feature(us, us.objects.states).features;nation = topojson.feature(us, us.objects.nation);// our store datastores =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 } ) ), ],});
---code-annotations: hover---# Day 9: Hexagons {.unnumbered}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](https://github.com/hrbrmstr/cvs-location-closures). 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.<style>td, h2 {border: none;border-bottom: none!important;}figure h2 {padding-bottom: 0px;line-height: 1em;}figure h3 {margin-top: 0px;}.cvs-ramp {display: block;background: transparent!important;height: auto;height: intrinsic;max-width: 100%;overflow: visible;}.cvs-ramp text {white-space: pre;}g[aria-label="tip"] {fill: #2b2b2b; }</style>## ```{ojs}Plot = require("@observablehq/plot")// This is a geojson file we'll see quite a bit of this monthus = FileAttachment("static/data/us-counties-10m.json").json();// taking various subsets to plot as different layersstatemesh = topojson.mesh(us, us.objects.states);states = topojson.feature(us, us.objects.states).features;nation = topojson.feature(us, us.objects.nation);// our store datastores = 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 } ) ), ],});```