What it is

Some Swift Charts effects are easy to get almost right. Two Agent Skills turn two of them into a repeatable workflow: scan the project, check what the SDK and the deployment target allow, propose a plan where each item cites a source, and change code only after approval.

The first skill builds the TradingView-style scrub: everything to the left of the finger at full strength, the rest dimmed. The same technique gives a highlighted range, actual against forecast on one line, and a reveal up to a date. It comes from Anton Gubarenko’s article SwiftUI Charts: Dynamic Masking: do not change the data to show part of it, plot complete copies and change only what a mask shows.

The second skill builds a hexagonal heatmap: many points counted into hexagonal cells, each cell coloured by its count. It comes from Matthaus Woolard’s article Visualising data with a hexagonal heatmap in Swift Charts.

The skills work in any tool that supports the Agent Skills open format, so Claude Code, Cursor and Codex all run them.

Install

npx skills add https://github.com/alexey1312/Swift-Charts-Agent-Skill

Claude Code takes the plugin instead:

/plugin marketplace add alexey1312/Swift-Charts-Agent-Skill
/plugin install swift-charts-skills@swift-charts-skills

Then ask for a plan, for example: Use the Swift Charts dynamic masking skill to plan a scrub effect for this chart.

The two skills

SkillWhat it does
swift-charts-dynamic-maskingThe scrub, range highlights, actual against forecast; selection snapping, series, accessibility, iOS 16–18 variants
swift-charts-hexagonal-heatmapAxial binning, a hexagon symbol that tiles, explicit domains, a symmetric-log colour scale, an equal-area projection, iOS 16–18 variants

What the measurements changed

Each skill ships a probe that renders the technique and compares pixels. Some of its results change the code you would otherwise write:

  • A mask that starts at the first data point cuts that point in half: 68 px of its symbol and line cap, in the probe. A mask from the edges of a padded domain leaves the chart pixel-identical.

  • Nothing clamps a selection. At the padded edge of the plot it was already 6.3 hours outside the data. A snap to the nearest point clamps it for free.

  • Two plots that hold the solid and the dashed half of one line, without distinct series, draw as one solid line.

  • The article’s size formula for hexagons leaves 29 % of the map empty. symbolSize(CGSize) sets the width and the height directly, and the cells tile with no gap and no overlap.

  • Rounding q and r on their own puts 16.8 % of points in the wrong cell. Cube rounding puts none.

The SDK adds two more. ChartSymbolShape requires perceptualUnitRect, so the article’s first hexagon does not compile, and .symmetricLog needs iOS 16.4, not 16.0. Each Swift sample in the references compiles for the iOS version on its tag and fails for the version before it.

Plan before patch

“Make the chart work like TradingView” is permission to investigate, not to rewrite. Each recommendation arrives with a stable item ID, the finding at file:line, the session, documentation page or measurement behind it, whether the deployment target allows the API, and the selection states to verify. Nothing changes until you approve item IDs. A state that was not rendered is reported as not verified, never as passed.

Benchmark

Five cases, three runs each, with and without the dynamic masking skill: 0.95 with the skill against 0.69 without. Three of the four misses with the skill were errors of the judge, and the write-up in the repository says which. The heatmap skill ships five eval cases of its own, but they are not benchmarked yet.