microsoft/microsoft-ui-reactor/charting
Claude Code and agent skill by microsoft/microsoft-ui-reactor
- vendor
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install microsoft/microsoft-ui-reactor/chartingSKILL.md
The same SKILL.md was published earlier as microsoft/microsoft-ui-reactor/charting.
ReactorCharting Chart Authoring Guide
ReactorCharting is a C# port of D3.js that renders charts as Reactor Element trees on WinUI3 Canvas. Charts are pure functions: data => Element. The goal is a single return D3Canvas(...) expression per chart with no imperative mutation.
Imports
Every chart file needs these:
The Ideal Shape
The best charts follow this structure — one return, one collection expression, data transforms via LINQ, all primitives from the DSL:
Key elements: D3Canvas wraps everything, [.. spread] composes flat element lists, .Select() / .SelectMany() map data to elements, with { } sets visual properties.
Scales
Scales map data values to pixel positions. Create them, then call .Map(value) in accessors.
Always call .Nice() on Y scales to get clean tick numbers. The Y range goes from [bottom, top] (inverted) so larger values map to smaller Y pixel values.
DSL Primitives
All return Reactor Elements. Customize with with { } for Fill, Stroke, etc.
Use named parameters for fontSize:, foreground:, r:, width:, alpha:, opacity: — bare numeric literals are ambiguous without names.
Generator Helpers
Use the one-shot DSL helpers instead of constructing generator instances:
Always use named parameters x:, y:, y0:, y1:, value: on these helpers — three consecutive lambdas are unreadable without names.
For pie charts with labels, use the static one-shot + D3ArcPath:
Composite Helpers
Color Helpers
Palette is D3Color.Category10 — 10 categorical colors. Access with Palette[i % Palette.Length] to avoid index errors.
Data-to-Elements Patterns
Simple projection — .Select()
When each data item produces one element:
The (Element) cast is sometimes needed for spread in collection expressions — this is a C# limitation, not a DSL issue.
Multi-element projection — .SelectMany()
When each data item produces multiple elements (e.g., bar + label):
Query syntax — from/let/select
When you need 3+ intermediate values before the final element, use query syntax instead of a multi-line lambda:
Keep .Select() for simple 1-line projections. Switch to query syntax at 3+ let bindings.
Stacked/grouped series
Things to Do
- Return a single `D3Canvas(W, H, [...])` expression — the entire chart is one return statement
- Use `[.. spread]` syntax to compose flat element arrays:
[.. grid, .. axes, .. bars, title] - Use LINQ `.Select()` / `.SelectMany()` to map data to elements — no for-loops
- Use `with { Fill = ..., Stroke = ... }` to set visual properties on elements
- Use named parameters on calls with multiple double/brush args:
fontSize:,foreground:,opacity:,alpha:,r:,x:,y:,y0:,y1:,value:,width: - Use `D3LinePath` / `D3AreaPath` instead of constructing LineGenerator/AreaGenerator instances
- Use `D3ArcPath` instead of constructing ArcGenerator instances
- Use `D3Grid` / `D3Axes` / `D3Legend` instead of manually building grid lines, axis labels, or legends
- Use `Palette[i % Palette.Length]` to avoid index-out-of-range on category colors
- Use `D3Extent.Extent(data, accessor)` for finding min/max — not manual loops
- Use `.Nice()` on scales to get clean tick boundaries
- Pre-compute brushes outside the element expression when reused:
var fill = Brush(Palette[0], opacity: 0.6);
Things to Avoid
- Don't construct generator instances (e.g.,
new ArcGenerator(),LineGenerator.Create(...)) when a DSL helper exists — useD3LinePath,D3AreaPath,D3ArcPath,D3Pieinstead - Don't use for-loops to build element arrays — use
.Select(),.SelectMany(), or query syntax - Don't use `XamlHostElement` or raw XAML — everything should go through the D3 DSL primitives
- Don't use `.Set(tb => tb.TextAlignment = ...)` — use
D3TextCenterorD3TextRightinstead - Don't use `Text(...).Foreground(...).Canvas(...)` — use
D3Text(x, y, text, fontSize:, foreground:)instead - Don't create mutable state — no
var elements = new List<Element>(); elements.Add(...)patterns - Don't use `Array.Empty<Element>()` in ternary spreads for null paths —
D3Pathaccepts null gracefully - Don't duplicate generators — e.g., creating two identical AreaGenerators when one suffices; or creating a separate
labelArcArcGenerator just for centroids (useArcGenerator.Centroid(...)static method instead) - Don't use `.Where().Select()` chains that shift indices — either inline the filter or use query syntax with
wherebeforeselectto preserve the original index - Don't write bare numeric literals for optional parameters —
Gray(100, 180)is ambiguous; writeGray(100, alpha: 180) - Don't use `Microsoft.UI.Xaml.Media.SolidColorBrush(Microsoft.UI.Colors.White)` — write
Brush("#ffffff") - Don't manually build legends with
SelectManyproducing(rect, text)pairs — useD3Legend(x, y, items) - Don't manually build grid lines with tick iteration — use
D3Grid(yScale, left, width) - Don't manually build axis labels when
D3Axes(xs, ys, ...)covers your case - Don't use `D3Color.Parse(...)` then `Brush(...)` — just use
Brush("#hex")directly
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 3 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/Reactor.Advanced/Charting/skill.md
Popularity
- Repository stars
- 660
- Repository forks
- 57
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/microsoft-ui-reactor/charting)