A couple of weeks ago, I published a post about how partisan approaches to Social Security may be influenced differences in by age, rate of Social Security benefit receipt, and earnings between Republican- and Democrat-led congressional districts. The centerpiece of the post was a pair of interactive beeswarm charts showing benefit receipt with one dot per district.
This post explains how I built those charts, because the path was a little unusual: a Flourish chart, a printout, Claude, and finally, a custom Flourish template.

Where Flourish got me, and where it stopped
I started where I usually do. I set up the data, which I pulled from the Social Security Administration, Census Bureau, and Ballotpedia (yes, I still do my data work in Stata), and built the first version of the chart in Flourish. Creating the first draft was easy once the data were in shape: drop in the values, assign a column to color, and done—a clean, interactive chart with tooltips.

But I wanted to take my chart past the basic Flourish template. Ideally, I would add a vertical line for the reader to drag across the chart, highlighting every district above a certain share. For example, if a user wanted to see every district where at least 18 percent of residents received Social Security, they could drag the line to that value, then the chart would highlight the dots in question and display a horizontal bar chart breaking down the districts by Republican and Democratic representation.
Adding this customization required a bit of creative thinking.
Step one: Markers, a scanner, and Claude
First, I went analog. I downloaded a static version of the Flourish chart, printed it out, and drew what I wanted right on the page: the draggable cutoff line, the outlines on the dots above it, and a small bar chart at the top counting Democratic and Republican districts.

Step two: from a one-off chart to a Flourish template
With my HTML version done, a member of the Friends of Flourish Slack workspace (a community of Flourish enthusiasts) then suggested I ask Claude to push the that version back into Flourish as a template.
I had not yet explored the Flourish SDK (Software Development Kit), but this provided a perfect use case. A Flourish template creates a reusable chart type behind a visualization: some JavaScript plus a configuration file. Once the visualization is published, you (or anyone on your team) can make new charts with the template by swapping in data and changing settings, no code required. The catch has always been that building a template takes real JavaScript and knowledge of how Flourish’s modules fit together—skills I don’t have.
This is where the SDK AI Starter Kit came in handy. It’s a set of instructions, starter templates, and technical notes written for AI coding assistants. I pointed Claude Code at the kit’s starting prompt, my HTML chart, and the original Flourish beeswarm, and asked it to rebuild the chart as a template. Here’s roughly what happened:
- Claude checked that my setup was ready (Node.js, the Flourish SDK, and my Flourish login).
- It picked the right starter template (a chart with an x-axis, so the scatter starter) and read its source code.
- It laid out a plan: which Flourish modules to keep (colors, legends, popups, axes, number formatting), which to add (it added a Cutoff menu, which is so cool!), which to drop, and how the data columns would map to the chart.
- It carried over the beeswarm layout from the HTML version, then rebuilt the draggable cutoff, the counter bar chart, and the direction labels under the axis.
- It ran the template locally, took its own screenshots at desktop and phone widths, simulated dragging the slider and hovering over dots, and fixed what it found.
The numbers checked out against the data. At an 18 percent cutoff, 198 of the 432 districts were highlighted: 137 of 218 Republican and 61 of 214 Democratic. And because it’s now a proper template, almost every component appeared as a setting. I could update the starting cutoff, the panel text (which updates as you drag), the bar chart presentation, the colors, fonts, and the header and footer text all within Flourish.
Publishing takes two commands. flourish publish –prerelease puts a test version in Flourish where I can upload real data. Once it looks right, flourish publish –release makes the stable version I build charts from (which I have yet to do; I might want to use different data for the final template).
What I took away from this exercise
- Sketch first, then prompt. For me, a marked-up printout was easier and faster than trying to write a detailed description of what I wanted to see. The drawing kept the conversation anchored to the design, not the code.
- Build the one-off before the template. I didn’t know about the SDK before I started, but the Github documentation is very straightforward and clear, so creating a Flourish template directly was relatively easy. In the future, I might still follow this approach—Flourish (or another off-the-shelf tool), annotate, HTML, SDK—because it enables me to see and test the final version quickly before going through the steps to build the Flourish template.
- Starter instructions matter. The starter kit told Claude which chart to start with, which Flourish modules to use, and which common mistakes to avoid. That structure is a big part of why the first build needed only a couple of fixes.
- Test like a reader. The most useful part of the build was Claude checking its own screenshots, including at phone width. That’s where it caught problems, like labels landing in the wrong place, that the code alone wouldn’t reveal.
- You need to know what you want. While Claude handled the JavaScript, all the decisions about what the chart should show, what the slider should count, and how it should read were still mine. Claude helped fill in the technical gaps, but I still needed to apply the principles of effective data visualization.
Try it yourself
You can read the full post on age, Social Security, and earnings across congressional districts, and drag the slider yourself.
If you want to build your own Flourish template this way, use with the SDK AI Starter Kit and your AI coding assistant of choice. And keep a few markers handy.
Don’t miss out! Subscribe to the PolicyViz Substack newsletter to get extra posts, links, and other special content delivered to your inbox.





