Creative coding

A cheeky little data visualization of vanity plates the New York DMV said no to, served up on a plate drawn in CSS.A cheeky little data visualization of plates the DMV said no to.

Creative Coding

Rejected Plates

They didn’t make it onto the road, but they made it here.

· 5 min readData visualization, CSS art

Tap the plate for another hard no.

Intro

One person’s dream plate, the DMV’s hard pass! Stumbling across this dataset of vanity plates rejected by the New York DMV felt like finding the archives of a very niche hobby. As a New Yorker with an ever-growing collection of ridiculous plates in my camera roll, I couldn’t leave this one alone. I recreated a New York plate in pure CSS and gave the rejects their moment.

Some are clever, some are a stretch, and some… well, I’m with the DMV on those. You have to admire the commitment to squeezing something questionable into eight characters. Below, I’ll walk through how I built it and where the DMV draws the line.

The data

The plates come courtesy of WNYC’s Data News team. My favorite radio station, enabling my niche interests yet again. In July 2014, they filed a Freedom of Information Law (FOIL) request with the New York DMV and obtained plate application data covering October 2010 through September 2014. They published it on GitHub as datanews/license-plates (opens in a new tab), and wrote a fun story about what New Yorkers put on their plates (opens in a new tab).

The rejected list is short and sweet: 1,646 plates, each with the date someone applied. The repo also has the approved plates and the “Red Guide,” the DMV’s list of plates that get turned down automatically.

Getting it into my site

The data is a CSV with just two columns, date and plate. I used a tiny Node script to turn it into JSON, then tucked a copy into my project. Now the page imports it like any other file:

import plates from "./_data/rejected-plates.json";

// [{ date: "2010-10-02", plate: "00DADDY" }, …]

Drawing the plate

The plate is just one div with three lines of text and some creative CSS.

Stripes from one gradient

The navy bands and thin pinstripes are one linear-gradient. Giving adjacent colors the same stop position creates a sharp stripe instead of a gradual blend. No extra elements needed.

.plate {
  background-image: linear-gradient(
    to bottom,
    var(--plate-color2) 0 25%,
    var(--plate-color) 25% 27%,
    var(--plate-color2) 27% 28%,
    var(--plate-color) 28% 93%,
    var(--plate-color2) 93% 94%,
    var(--plate-color) 94% 96%,
    var(--plate-color2) 96%
  );
}

Pressed-in letters

Two text-shadows give the plate number a little dimension. A dark shadow below and a light one above fake the edges of stamped metal catching the light.

#plate-num {
  text-shadow:
    3px 2px 2px rgb(138, 89, 12),
    -3px -2px 2px rgba(255, 255, 255, 0.7);
}

Bolt slots

The four little bolt slots are ::before and ::after on the state and motto headings, so they don’t need any extra markup. An inset shadow makes them look cut into the plate, and a little transform nudges each one into place.

h2::before {
  content: "";
  position: absolute;
  height: 10px;
  width: 40px;
  border-radius: 5px;
  background-color: white;
  box-shadow: inset 2px 2px 2.5px rgb(18, 18, 18);
  transform: translateY(0.6em) translateX(-1em);
}

One plate, any size

My original plate is a fixed 500 by 250 pixels. Here, I wanted it to fill the column instead, which meant the pixel sizes inside it had to grow and shrink with it. So for this page, I swapped them for cqi units, a percentage of the plate’s width, and made the plate a size container. Bigger plate, bigger letters.

/* Original */
#plate-num {
  font-size: 90px;
}

/* On this page */
.plate {
  width: 100%;
  container-type: inline-size;
}

.plate-number {
  font-size: 18cqi; /* 90px on a 500px plate */
}

Picking a plate

Remember the current plate

State keeps track of which plate is on screen. I started with LILB00TY because it’s one of my faves, and a fixed first plate means the server and the browser agree on what to show. The questionable choices are random after that.

const [currentPlate, setCurrentPlate] = useState({
  date: "",
  plate: "LILB00TY",
});

Pick a new one

Math.random() gives a decimal between 0 and 1. Multiplying by the number of plates and rounding down with Math.floor() gives us an index into the list. The loop keeps picking until it lands on a different plate, so every tap shows something new.

function pickNewPlate() {
  let next = currentPlate;
  // Keep picking until it's different from the one showing
  while (next.plate === currentPlate.plate) {
    next = plates[Math.floor(Math.random() * plates.length)];
  }
  setCurrentPlate(next);
}

Announce it

Sighted visitors see the new plate right away. For screen reader users, a hidden live region reads it out after each click. It stays empty until the first click, so nothing is announced when the page loads.

<p className="sr-only" aria-live="polite">
  {currentPlate.date && `Rejected plate: ${currentPlate.plate}`}
</p>

Patterns in the data

A few things stood out in this little collection of rejects:

  • Spring is rejection season. Across the dataset, March and April each had about 200 rejections, roughly twice as many as December.
  • Numbers get creative. About 58% of rejected plates include a number. Some do a little disguise work, with 0 standing in for O, 3 for E, or 8 for B.
  • A recurring theme. “69” appears in 30 plates, including LUVN69, RATEDR69, and the very committed I696969I. The DMV was not amused.
  • Some people don’t give up. A55 appears in 15 plates, like WISEA55, SMRTA55 and UDUMBA55. BAD2SS was rejected three times...

TODO: a chart of rejections by month.

A closer look at the Red Guide

Before a human ever sees your plate, it gets checked against the Red Guide (opens in a new tab), the DMV’s list of about 1,800 automatic no’s. Most of it is exactly what you’d expect (33 ways to spell F***). But some entries are surprising.

JAYLENO is banned, no explanation. So is DMV, which feels personal. NONE and NOPLATES are out, could make for some confusing paperwork. IMDRUNK is a no, which, fair. And FART, OLDFART and FARTMAN are all off the table.

Keep going

A few ideas I’d love to try next:

  • Would your plate get rejected? Type a plate and check it against the DMV’s Red Guide.
  • Approved or rejected? A guessing game using the approved plates from the same dataset.
  • Other states. California’s data includes what applicants said their plate meant, and what reviewers thought it meant.

Where the data comes from, if you want to dig in yourself:

Back to topNext · CSS Battle