Skip to content
Skills Library
Programming · Building & coding

visuals

/visuals

Use when user wants to incorporate charts, graphs, data grid, or other visual representations of data into their project. Use VegaVisual and DataGrid components to create these visuals, utilizing the shared data types, formatting, theme, and interactivity hooks.

Repository
rayfin ↗
Licence
MIT
Last repository change
13.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when user wants to incorporate charts, graphs, data grid, or other visual representations of data into their project. Use VegaVisual and DataGrid components to create these visuals, utilizing the shared data types, formatting, theme, and interactivity hooks.

Original author description

Use when user wants to incorporate charts, graphs, data grid, or other visual representations of data into their project. Use VegaVisual and DataGrid components to create these visuals, utilizing the shared data types, formatting, theme, and interactivity hooks.

How it works

  1. Types of visuals
  2. Packages & Imports
  3. Data Format
  4. Formatting & Theme
  5. Custom visuals
  6. Container Layout
  7. Interactivity
Original SKILL.md headings · 100 lines, 726 words
SKILL.md preview
---
name: visuals
description: >
  Use when user wants to incorporate charts, graphs, data grid, 
  or other visual representations of data into their project.
  Use VegaVisual and DataGrid components to create these visuals, 
  utilizing the shared data types, formatting, theme, and interactivity hooks.
---

# Visuals

## Types of visuals

There are 2 different types of visuals that can be used in a project:
1. Charts and Graphs: These are used to represent data in a visual format, such as bar charts, line charts, pie charts, etc. These are built using vega-lite, see [references/vega-lite-visual.md](references/vega-lite-visual.md) for more details.
2. Data Grids: These are used to display tabular data in a structured format, allowing for sorting, filtering, and pagination. See [references/data-grid-visual.md](references/data-grid-visual.md) for more details.

## Packages & Imports

The visual components are provided by three packages. **Always use these package imports when creating visuals.**

| Package | Primary exports | Example import |
|---|---|---|
| `@microsoft/fabric-visuals` | `VegaVisual`, types: `VisualizationSpec`, `VegaLiteConfig`, `VegaVisualProps` | `import { VegaVisual } from "@microsoft/fabric-visuals"` |
| `@microsoft/fabric-datagrid` | `DataGrid`, types: `GridColumnDef`, `Row`, `CellValue`, `DataGridProps`, `DataGridTheme`, `SortConfig` | `import { DataGrid } from "@microsoft/fabric-datagrid"` |
| `@microsoft/fabric-visuals-core` | `isDataTable`, `convertDataTableToRows`, design tokens | `import { isDataTable } from "@microsoft/fabric-visuals-core"` |

The `DataTable` type (used by both components) is defined in `@microsoft/fabric-visuals-core` and re-exported by the visual packages' type definitions.

## Data Format

The chart and data grid components share a unified `data` prop of type `DataTable` (from `@microsoft/fabric-visuals-core`). This structured format carries column metadata (`displayName`, `format`, `semanticType`) that the components use for axis titles, grid headers, number formatting, and tooltips.

**Using `DataTable`**: Pass a `DataTable` via the `data` prop. The visual uses its column metadata for formatting, axis titles, and tooltips.

**Static/inline data**: For static data, transformed data, or plain arrays, put `data: { values: [...] }` directly in the Vega-Lite spec and omit the `data` prop.

**Multiple tables in one visual**: the `data` prop also accepts a `Record<string, DataTable>` for specs that need to reference more than one dataset by name. See [references/multi-data-input.md](references/multi-data-input.md) for the syntax and caveats.

```tsx
import { VegaVisual, useCssTheme } from "@microsoft/fabric-visuals";
import { DataGrid } from "@microsoft/fabric-datagrid";
import type { DataTable } from "@microsoft/fabric-visuals-core";

// useCssTheme() reads --color-* vars from the page and updates automatically
// when the theme changes (e.g. dark-mode toggle adds/removes the .dark class).
const theme = useCssTheme();

// Charts — pass a DataTable and Vega-Lite spec
<VegaVisual spec={vegaLiteSpec} data={dataTable} theme={theme} />

// Grids — displayName becomes column headers, format applies to cells
<DataGrid data={dataTable} theme={theme} />

// Static/inline data — no data prop needed
const inlineSpec = {
  data: { values: [{ x: 1, y: 2 }, { x: 3, y: 4 }] },
  mark: "point",
  encoding: { ... },
};

<VegaVisual spec={inlineSpec} theme={theme} />
```

For the `DataTable` schema and `ColumnDef` fields, see [references/data-table.md](references/data-table.md).

## Formatting & Theme

- **Formatting rules**: Number formatting, color palettes, chart-specific encoding rules, highlighting guidelines, and a default theme. See [references/formatting.md](references/formatting.md).

## Custom visuals

Always use the above mentioned ways to create visual when possible. If the user's request doesn't allow creation using the above methods, ask the user if they are ok with using another library for creating the visual. If they are ok with it, use the library to create the visual. If they are not ok with it, then build that visual from scratch using HTML, CSS, and JS/TS. Make sure to ask the user for any specific requirements they have for the visual, such as colors, labels, etc.

## Container Layout

- **`DataGrid`** — the direct parent must apply `overflow-auto` so content remains scrollable when it exceeds the container bounds (many rows).

## Interactivity

Both `VegaVisual` and `DataGrid` expose an `onInteraction` prop that emits structured, predicate-based events when the user clicks a data point or row.

**Always use the `onInteraction` prop** on `VegaVisual` and `DataGrid` to handle user interactions such as selections, cross-highlighting, and cross-filtering.

```tsx
import type { InteractionEvent } from "@microsoft/fabric-visuals-core";

function handleInteraction(source: string, events: InteractionEvent[]) {
    for (const event of events) {
        if (event.action === "select") {
            // event.selections describes the clicked data as predicates
        } else if (event.action === "clear") {
            // user deselected (re-clicked same item or clicked empty space)
        }
    }
}

<VegaVisual spec={spec} data={dataTable} theme={theme}
    onInteraction={(events) => handleInteraction("salesChart", events)} />
<DataGrid data={dataTable} theme={theme}
    onInteraction={(events) => handleInteraction("detailTable", events)} />
```

**Key concepts**:
- Clicking a different data point emits a new `select` (replaces the prior selection — no preceding `clear`).
- Re-clicking the same item or background space in a vega-lite visual emits `clear`.
- Predicates include all fields from the datum; consumers filter to the ones that are relevant to them.
Files in this package (6)
  • SKILL.md 6 KB
  • references/data-grid-visual.md 4 KB
  • references/data-table.md 4 KB
  • references/formatting.md 6 KB
  • references/multi-data-input.md 1 KB
  • references/vega-lite-visual.md 2 KB

Versions

RepositoryScoreLicence
This page · microsoft/rayfin100MIT
microsoft/fabric-apps-analytic-templates100MIT
microsoft/rayfin100MIT
harmix/open-stanley90MIT
phestplus/quint-ai-mcp90MIT

Database snapshot: 13.11.2026 · package version b6d2f81dfd13 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100kadal-ui
    Add Kadal UI's data grid — a power-user React data grid on TanStack Table v9 and shadcn/ui (Base UI) — to a project and use it well. Install it from the shadcn registry, build typed columns with createDataGridColumns, render <DataGrid>, compose the parts around useDataGrid, keep…
  • 100devextreme-datagrid
    Help developers use the DevExtreme DataGrid component (dxDataGrid) in Angular, React, Vue, jQuery, and ASP.NET Core Controls. Use when someone asks about DataGrid configuration, columns, data binding, editing, filtering, sorting, grouping, selection, paging, scrolling,…
  • 90visualization-builder
    Create effective, publication-ready data visualizations. Use when choosing chart types, designing presentation visuals, building dashboard charts, or applying visual design best practices to data output.
  • 100deneb-visuals
    Deneb visual creation, Vega/Vega-Lite spec authoring, and Deneb best practices for PBIR reports. Automatically invoke whenever the user mentions "Deneb" in any context, or asks about Vega/Vega-Lite specs in Power BI, Deneb cross-filtering, Deneb interactivity, pbiColor theme…
  • 90Power BI Visuals
    Add, configure, bind data to, and bulk-manage visuals on Power BI PBIR report pages using pbi-cli. Invoke this skill whenever the user mentions "add a chart", "bar chart", "line chart", "card", "KPI", "gauge", "scatter", "table visual", "matrix", "slicer", "combo chart", "bind…
  • 100deneb-visuals
    Deneb visual creation, Vega/Vega-Lite spec authoring, and Deneb best practices for PBIR reports. Automatically invoke whenever the user mentions "Deneb" in any context, or asks about Vega/Vega-Lite specs in Power BI, Deneb cross-filtering, Deneb interactivity, pbiColor theme…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.