microsoft/awesome-rayfin/visuals

Claude Code and agent skill by microsoft/awesome-rayfin

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when adding charts, KPIs, tables, slicers, or any visual to a dashboard. Charts are authored as Graphein chart specs — one chart = one JSON `ChartSpec` (type + tidy `data` + `encoding`) dropped into `<ChartCard spec={…} />`, which owns loading / empty / error and the app theme. Covers the spec model and the per-type recipes (line/area/bar/scatter/pie/heatmap/funnel/combo/histogram/ treemap/gauge/bullet/waterfall/calendarHeatmap/slope/dumbbell/table/matrix), declarative features (transform/annotations/insights/trendline/facet), the validate→repair→report self-check (graphein 0.16), headless preview against live data, the DAX→rows helpers (toChartData / toTable / topN / deriveKpi), `KpiCard`, `DataTableCard` (Graphein table/matrix), slicers (dropdown/list/search/date-range/range + FilterBar) with shared filter state, interactivity, layout, value formatting, and color tokens.

Install

npx vskill@latest install microsoft/awesome-rayfin/visuals

SKILL.md

The same SKILL.md was published earlier as microsoft/awesome-rayfin/visuals.

Visuals — author a Graphein spec, drop it in a tile

One chart = one JSON spec. You don't hand-write SVG or wire a charting library. You (1) map your DAX result into plain rows, (2) author a single Graphein `ChartSpec` — a type, a tidy data array, and an encoding that names the columns — and (3) drop it into <ChartCard spec={…} />. The card owns the loading / empty / error states and bridges the app theme, so a spec never needs a color or a size.

Charts are `graphein` 0.16. That means a broad chart catalog (combo/dual-axis,
histogram, treemap, gauge, bullet, waterfall, calendar-heatmap, slope, dumbbell
on top of the classics), in-spec transforms and annotations (reference
lines), and a self-correcting loop — validateSpec → repairSpec →
summarize plus a render report. Render each visual spec **headlessly
against live data to a PNG + report before ship: see the headless-preview**
skill. This is the agent validation loop; KPI/table/matrix/slicers/dashboard
rasterize to PNG too, so preview-validate every visual before shipping.

Three things are React surfaces around Graphein specs or state:

  • KPIs → <KpiCard> (big value + delta pill + sparkline).
  • Tabular data → <DataTableCard spec={tableOrMatrixSpec}> (Graphein

table / matrix — virtualized, sortable, conditional formatting, totals).

  • Filters → the slicers (FilterBar + DropdownSlicer/…) over shared

filter state; chart selections can bridge into the same state.

Everything is exported from one barrel: `@/components/dashboard`.

Fast path

Optimize time to wow: ship one real tile, preview, user review, iterate.

Phase 1 — Hero slice: render ONE real visual the simplest way — map the hero query with toChartData(...), author a spec, pass it to a ChartCard. Pass loading / error straight from the query hook. That's enough to ship.

tsx
import { ChartCard, toChartData } from "@/components/dashboard";
import { useSemanticModelQuery } from "@/hooks/use-semantic-model-query";
const { data, isLoading, error } = useSemanticModelQuery({ connection, query });
<ChartCard
title="Revenue"
subtitle="Last 12 months"
loading={isLoading}
error={error}
spec={{
type: "line",
data: toChartData(data, { columns: { month: "Date[Month]", revenue: "Total Revenue" } }),
points: true,
encoding: {
x: { field: "month", type: "temporal" },
y: { field: "revenue", type: "quantitative", format: "$,.0f" },
},
}}
/>

Phase 2 — Breadth: add the rest (metric band, more charts, a DataTableCard), wrapped in PageShell + StatStrip + DashboardGrid/Tile. Preview each visual as you add it before automatic ship.

Phase 3 — Polish: slicers, interactivity, multi-series, formatting, dark-mode review.

The data flow (map → author → drop in)

Every tile follows the same shape:

  1. Fetch with useSemanticModelQuery({ connection, query }) →

{ data, isLoading, error } (see the dax + fabric-data skills).

  1. Map the DAX result into the shape the visual wants. Helpers accept the

query result, a raw QueryTable, or undefined — no status check:

  • Charts want tidy/long rows → toChartData(result, options?).
  • Tables want a Graphein table spec → toTable(result, { columns }).

Hand-author a matrix spec over toChartData(result) rows for pivots.

  1. Author + pass. Put rows in a spec's data and hand the spec to the card

with loading + error. Don't pre-render skeletons/empty states — the cards do it.

tsx
// DAX rows are positional (unknown[][]); toChartData keys them by column
// (short) name and coerces numerics. Prefer explicit aliases for stable keys
// (and when two columns share a short name, e.g. Date[Month] + Ship[Month]):
const rows = toChartData(data, {
columns: { month: "Date[Month]", revenue: "Total Revenue" },
});
// rows → [{ month: "2024-01", revenue: 84200 }, …]
Keep data tidy — split with series, don't pre-pivot

Graphein wants long/tidy data: one row per observation. To show multiple series (multi-line, grouped/stacked bars, stacked areas), add a series channel that points at the category column — do not widen the table into one column per category.

jsonc
// ✅ tidy — one row per (quarter, channel); split with series
[{ "quarter": "Q1", "channel": "Online", "revenue": 210 },
{ "quarter": "Q1", "channel": "Retail", "revenue": 180 }]
// encoding: { x:{field:"quarter"}, y:{field:"revenue"}, series:{field:"channel"} }

toChartData already returns long rows, so a normal DAX result drops straight in. (pivotChartData still exists for the rare case you truly need wide rows, but with Graphein you almost never do.)

Authoring a spec

A spec is a plain JSON object — no functions, no colors, no sizes:

jsonc
{
"type": "bar", // the discriminator
"data": [ /* tidy rows */ ], // required for every type
"encoding": { // names the columns → visual channels
"x": { "field": "quarter" },
"y": { "field": "revenue", "type": "quantitative", "format": "$,.0f" },
"series": { "field": "channel" }
},
"stack": true // per-type option
}
  • `encoding` is required for line/area/bar/scatter (x+y), pie

(theta+color), heatmap (x+y+color), funnel/waterfall (stage/value), treemap (category+value), calendarHeatmap (date+color), dumbbell (category+value+group), and combo (x + per-layer y). gauge/bullet take a value (not encoding). FieldDef.type is quantitative | temporal | ordinal | nominal (inferred when omitted).

  • Validate → repair → render. validateSpec(spec) → { valid, errors, warnings }

catches field-name typos and bad shapes; repairSpec(spec) auto-fixes many of them (returns the patched spec). Both are re-exported from the barrel. See Self-check below and the headless-preview skill. When a spec still renders wrong, set debug: true on it to swap the chart for a diagnostic view (live preview + resolved spec + data sample + validation + render report); clear the flag to render normally.

  • Don't author `theme`. ChartCard injects the app's CSS-token theme (brand

color + dark mode) automatically. Recolor via src/global.css tokens, never per-spec hex.

Pick a type
GoaltypeKey channels / options
Trend over timeline (area to emphasize volume)x temporal, y, optional series; points, curve
Part-to-whole over timearea + stack: truex, y, series
Compare categoriesbarx category, y, optional series; stack or grouped
Two measures, different scalescombo (dual-axis)encoding.x + layers[] each `{ mark, encoding.y, axis: "left"\"right" }`
Stage conversionfunnelstage, value, optional `percent: "first" \"previous"`
Running total / bridgewaterfallstage, value (signed); totals for absolute bars
Composition of a totalbar + stack, or pie/donutbar: series; pie: theta + color, donut, labels
Nested part-to-wholetreemapcategory, value, optional group, color
Correlation / 3rd dimscatterx, y, optional size, series; trendline
Distribution of one measurehistogramx (binned); bin controls
Density across two categoriesheatmapx, y, color, scheme
Value over a calendarcalendarHeatmapdate, color, scheme
Single value vs target/rangegauge / bulletvalue (+ min/max; bullet adds target)
Before/after, two points per rowdumbbellcategory, value, group (2 levels)
Rank change between two periodsslopex (2 values), y, series
Headline metric`KpiCard` (React)not a Graphein chart spec — see Cards
Raw / detail records`DataTableCard` with table spectoTable(result, { columns }); see Cards
Pivot / cross-tab`DataTableCard` with matrix specrows, columns, values, totals, conditional formatting

Rules of thumb: prefer bar over pie beyond ~6 slices; stack for part-to-whole, grouped bars for direct comparison; combo only when two measures genuinely share an x but need different y-scales (don't reach for it by default).

Recipes (mirror the gallery)
jsonc
// Multi-series line — points + currency Y, split by metric
{ "type": "line", "data": rows, "points": true,
"encoding": { "x": { "field": "month", "type": "temporal" },
"y": { "field": "value", "type": "quantitative", "format": "$,.0f" },
"series": { "field": "metric" } } }
// Stacked area — quarterly channel mix
{ "type": "area", "data": rows, "stack": true,
"encoding": { "x": { "field": "quarter", "type": "ordinal" },
"y": { "field": "revenue", "type": "quantitative", "format": "$,.0f" },
"series": { "field": "channel" } } }
// Grouped bars (drop `stack` for grouped; add it to stack)
{ "type": "bar", "data": rows, "stack": true,
"encoding": { "x": { "field": "quarter" },
"y": { "field": "revenue", "type": "quantitative", "format": "$,.0f" },
"series": { "field": "channel" } } }
// Ranked bars — sort rows by value first (add "orientation":"horizontal" for long labels)
{ "type": "bar", "data": topN(rows, "revenue", 8),
"encoding": { "x": { "field": "region", "type": "nominal" },
"y": { "field": "revenue", "type": "quantitative", "format": "$,.2s" } } }
// Bubble scatter — size = a third measure
{ "type": "scatter", "data": rows,
"encoding": { "x": { "field": "price", "type": "quantitative", "format": "$,.0f" },
"y": { "field": "units", "type": "quantitative" },
"size": { "field": "margin", "title": "Margin" } } }
// Donut — theta = value, color = category
{ "type": "pie", "data": rows, "donut": 0.6,
"encoding": { "theta": { "field": "value", "type": "quantitative", "format": "$,.0f" },
"color": { "field": "category" } } }
// Pie with outside callout labels
{ "type": "pie", "data": rows,
"labels": { "placement": "outside", "content": "category-percent", "minShare": 0.03, "connector": "muted" },
"encoding": { "theta": { "field": "value", "type": "quantitative", "format": "$,.0f" },
"color": { "field": "category" } } }
// Funnel — ordered stage conversion, labels show % vs previous stage
{ "type": "funnel", "data": rows, "labels": true, "percent": "previous",
"encoding": { "stage": { "field": "stage" },
"value": { "field": "users", "type": "quantitative", "format": ",d" } } }
// Heatmap — category × category, colored by a measure
{ "type": "heatmap", "data": rows, "scheme": "teal",
"encoding": { "x": { "field": "quarter" }, "y": { "field": "region" },
"color": { "field": "revenue", "type": "quantitative", "format": "$,.2s" } } }
// Combo (dual-axis) — bars on the left scale, a line on the right
{ "type": "combo", "data": rows,
"encoding": { "x": { "field": "month", "type": "temporal" } },
"layers": [
{ "mark": "bar", "axis": "left", "encoding": { "y": { "field": "revenue", "format": "$,.0f" } } },
{ "mark": "line", "axis": "right", "encoding": { "y": { "field": "margin", "format": ".0%" } } } ] }
// Histogram — distribution of one measure (auto-binned)
{ "type": "histogram", "data": rows, "bin": { "maxbins": 20 },
"encoding": { "x": { "field": "orderValue", "type": "quantitative", "format": "$,.0f" } } }

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 19 Sep 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
95
Repository forks
24
7-day trend score
23

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
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/microsoft/awesome-rayfin/visuals/badge)](https://verified-skill.com/skills/microsoft/awesome-rayfin/visuals)

Something wrong with this skill or its page? Tell us.