Rainbow Nation / / No Comments The New York Times has published An American Mosaic, an interactive map visualising the self-identified ancestry of Americans using data from the U.S. Census Bureau’s American Community Survey. The map is accompanied by an article which explores how today’s America reflects centuries of immigration and migration.The map uses colour to show the dominant ancestry in each census tract, drawing on Maps Mania… more → Posted in: Interactive Maps Tagged with: Nation, Rainbow
Building Custom Form Selection Boxes – Working on Accessibility / / No Comments Whenever I find myself needing to update a previous blog post, I either correct it inline and add a small note on top, for small tweaks, or write a whole new piece for larger changes. My last blog post talked about how to use CSS to style a "block" such that it acted like a form radio button. When I worked on that demo, I was a bit worried about accessibility. I did one quick check with an online tool, and thought I was ok. I was not. When I shared my post on LinkedIn, Kevin Bonett shared this feedback with me: I would argue that, despite using correct semantic HTML, the “custom” radio buttons are inaccessible. If you’re a sighted keyboard user, how will you know... more → Posted in: JavaScript Tagged with: accessibility, Boxes, building, custom, form, Selection, working
Building Custom Form Selection Blocks – no JS, all CSS / / No Comments I apologize for what may be a slightly misleading title. The topic for this post is something I’ve had on my list of things to explore for some time now, and while I wait for the new job to start, I’ve found myself with time to kill. Let me explain what I’m talking about and hopefully it will make a bit more sense. You are, dear reader, familiar with form controls and how to build forms both big and small. One type of user interface I’ve seen from time to time is the ability to select an item where the "item" is an arbitrary block of code. What do I mean by that? Typically a choice element in a form is either a select, checkbox, or radio set. But I’ve seen... more → Posted in: JavaScript Tagged with: Blocks, building, custom, form, Selection
Geographical Overlords / / No Comments This morning I listened to the song Geographical Overlord by MastaMic and Titus Chan. What immediately grabbed my attention was that the song’s lyrics are a series of questions and statements that might be found in a school geography exam about Hong Kong, e.g.,”Is Lion Rock higher than Fei Ngo Shan?Is Tai Mo Shan higher than Phoenix Mountain?…Gascoigne Road to Hung Hom Tunnel is incredibly Maps Mania… more → Posted in: Interactive Maps Tagged with: Geographical, Overlords
Use AI to not use AI (as much) / / No Comments This squarely falls into the "everyone probably knows this but it didn’t click with me right away" category so please feel free to laugh at my ignorance, but it’s something I realized over the past few months, and as I just used this technique this morning, I figured I’d share it on the blog. The idea is simple – it’s trivial to ask a Gen AI tool to do something for you – and depending on the ask, may work great. But what I realized a few months back, especially in regards to having AI parse data, is that you can also use the opportunity to generate a tool (like a Python or Node script) so you don’t need to return to the AI tool again. This... more → Posted in: JavaScript Tagged with: Much
This is Not Normal / / No Comments In the UK, the hottest June day on record has been broken three days in a row. And it’s not just the UK experiencing unprecedented levels of heat. France, Switzerland, Spain, Germany, Belgium and the Netherlands have also recorded their highest-ever June temperatures in the past week.You can get a sense of the scale of the heat dome currently sitting over Europe with the European Heat Maps Mania… more → Posted in: Interactive Maps Tagged with: Normal, this
Decoding VINs with an API / / No Comments Today’s post took a bit of a pivot. I decided to work on a demo idea I had created way back in March. As I worked on it, I ran into multiple roadblocks, and while that original idea for a demo may still see the light of the day, I figured I’d at least share something that did work. What’s a VIN? A VIN is a vehicle identification number. It’s a standard that dates back to 1954 and identifies a particular car by manufacturer, make, model, year, and a heck of a lot more. A VIN is 17 characters avoiding the letters O, I, U, and Q to avoid confusion with some numbers. You can break down a VIN into various components if you want – but would still need to know various lookup... more → Posted in: JavaScript Tagged with: Decoding, VINs
Parsing Arbitrary Dates in Strings with Chrono and a Web Component / / No Comments Yesterday I had an idea for a possible experiment using Chrome’s built-in AI support – looking for "date" references in strings. So for example: "I will have my new job in 12 days". Could the AI model recognize "12 days" as a date and determine what the actual date is, assuming a reference date of now? I was about to start working on a simple POC when I thought… wait… is there already a JavaScript library for this? Of course there is. The aptly named Chrono library does just that. It can parse a string with one assumed date and return the date, so for example: import * as chrono from 'chrono-node'; chrono.parseDate('An appointment on Sep... more → Posted in: JavaScript Tagged with: Arbitrary, Chrono, Component, Dates, Parsing, Strings