flint-chart README

The project's README from github.com/microsoft/flint-chart. As one markdown file: README.md.

Flint: A Visualization Language for the AI Era

npm: flint-chart npm: flint-chart-mcp arXiv: 2607.20775 CI License: MIT

Please visit: Flint Project Site | Visual Themes | MCP Server Guide | 中文主页

Flint is a visualization intermediate language that lets AI agents turn simple, human-editable chart specs into expressive, polished visualizations. Rather than requiring agents to hardcode verbose parameters for scales, axes, spacing, labels, and layout, Flint derives those decisions from a high-level semantic specification, the data, and an optional visual theme (e.g., New York Times, Economist, Swiss, and McKinsey). A compact spec compiles to native Vega-Lite, ECharts, Chart.js, Plotly specs, or editable Excel charts.

This repo contains two main components:

Try it in your agent

Try Flint with your agent using our hosted MCP server. Clients that support remote HTTP MCP servers include GitHub Copilot in VS Code (MCP: Add Server → HTTP) and Claude (Customize → Connectors → Add custom connector). Point either client at:

https://flint.data-formulator.ai/mcp

Then ask your agent to find some public data and visualize it, for example:

Go to Yahoo Finance, find today's percentage change for the Magnificent Seven
tech stocks, and compare their performance with Flint in Economist style.

For a local MCP server (recommended for large datasets), check the MCP Server Guide for details.

A wall of charts produced by Flint across its supported visualization backends.

Features

Updates

See the changelog for complete release notes.

Flint compiling a compact chart spec into a Vega-Lite spec and rendered heatmap visualization.
Flint turns compact chart specs into backend-native specs and rendered visualizations.

Install

# Use Flint in your JavaScript/TypeScript codebase
npm install flint-chart

# For agents and MCP clients
npx -y flint-chart-mcp

Python package: to be released. The current Python port is a source-only preview in this repo.

Use Flint As A Library

Every backend accepts the same ChartAssemblyInput and returns the target library's native spec object.

import { assembleVegaLite } from 'flint-chart';

const spec = assembleVegaLite({
  data: { values: myData },
  semantic_types: { weight: 'Quantity', mpg: 'Quantity', origin: 'Country' },
  chart_spec: {
    chartType: 'Scatter Plot',
    encodings: { x: { field: 'weight' }, y: { field: 'mpg' }, color: { field: 'origin' } },
    baseSize: { width: 400, height: 300 },
  },
});
// → a ready-to-render Vega-Lite spec

Swap the backend without changing the input shape:

import { assembleECharts, assembleChartjs, assemblePlotly, assembleExcel } from 'flint-chart';

const echartsOption = assembleECharts(input);
const chartjsConfig = assembleChartjs(input);
const plotlyFigure = assemblePlotly(input);
const excelArtifact = assembleExcel(input);

Apply Visual Themes

theme_spec sits beside chart_spec: the chart spec defines what the chart means, while the theme defines how that meaning is presented. A theme can guide layout, labels, legends, axes, mark geometry, typography, and color as one coherent visual system.

Use one of Flint's ten built-in presets:

const themedSpec = assembleVegaLite({
  ...input,
  theme_spec: 'economist',
});

Or inherit a preset and override only the decisions that belong to your brand:

const brandedSpec = assembleVegaLite({
  ...input,
  theme_spec: {
    extends: 'economist',
    id: 'our-brand',
    ink: {
      series: { single: '#6b3fa0' },
    },
  },
});

Nested objects merge; arrays and scalar values replace the inherited value. ThemeSpec currently affects Vega-Lite output. Compare all presets on the theme explorer. See Using themes for the complete custom and inherited-theme reference.

Twelve charts rendered with Flint's Economist theme.
Economist — compact editorial graphics with a strong red accent.

Twelve charts rendered with Flint's Swiss theme.
Swiss — typographic structure, restrained color, and a clear visual grid.

Twelve charts rendered with Flint's Pop theme.
Pop — bold color, emphatic marks, and playful graphic contrast.

See the API reference, backend references for Vega-Lite, ECharts, Chart.js, Plotly, and Excel, plus the live editor for more library examples.

Use Flint As An MCP Server

Install flint-chart-mcp as a Model Context Protocol server when you want an agent to create charts in the same conversation where the question starts. It can open an interactive chart view, return static PNG/SVG output, or produce backend-native chart specs.

For setup, start with the Flint MCP project page. It includes client configuration, usage examples, and links to deeper references.

Agent chat showing Flint Chart as an MCP App with a grouped bar chart preview and chart options.

MCP calls let agents embed rows directly as data.values, or read local JSON, CSV, or TSV files by data.url. For agent workflows without MCP, use the standalone agent skill.

Repository overview

flint-chart/
├── packages/
│   ├── flint-js/            npm package `flint-chart` (TypeScript)
│   │   └── src/
│   │       ├── core/        semantics, themes, layout, decisions, shared types
│   │       ├── chart-types/ shared chart definitions and template metadata
│   │       ├── vegalite/    Vega-Lite backend
│   │       ├── echarts/     ECharts backend
│   │       ├── chartjs/     Chart.js backend
│   │       ├── plotly/      Plotly backend
│   │       ├── excel/       native Excel backend
│   │       ├── gallery/     gallery assembly and generated references
│   │       └── test-data/   fixtures and stress-test generators
│   ├── flint-mcp/           MCP server, MCP App UI, assets, and tests
│   └── flint-py/            Python port preview (package to be released)
├── site/                    Vite + React project site, gallery, editor, and docs
├── agent-skills/            chart- and theme-authoring skills for agents
├── agents/                  agent and MCP server configuration
├── shared/test-data/        JSON fixtures shared across JS and Python
├── scripts/                 reference generation and theme audit tooling
├── docs/                    user, API, backend, and architecture documentation
└── design-docs/             design proposals and implementation research

Documentation

The project site is the main entry point for examples, the live editor, and concept docs. For source-level references, start with the API reference, the theme guide, the Flint MCP project page, or the Development guide. See the changelog for notable changes in each release.


Contributing

Contributions are welcome! See .github/CONTRIBUTING.md and the Development guide.

git clone https://github.com/microsoft/flint-chart
cd flint-chart
npm install            # root workspaces: packages/flint-js + flint-mcp + site

npm run typecheck      # typecheck packages/flint-js + packages/flint-mcp
npm run test           # Vitest (packages/flint-js + packages/flint-mcp)
npm run build          # build packages/flint-js + packages/flint-mcp
npm run site           # demo site (gallery + editor) at http://localhost:5274/

Node 18+ is required. The demo site aliases flint-chart to packages/flint-js/src, so library edits hot-reload in the gallery and editor without rebuilding dist/.

We especially welcome contributions that add new chart templates or new rendering backends.

This project has adopted the Microsoft Open Source Code of Conduct. See SECURITY.md to report vulnerabilities.

Contributor

Flint is built by Microsoft Research in collaboration with the IDEAS Lab, Renmin University of China. We welcome you to join us — see Contributing to get involved.

A research paper describing Flint is coming soon.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third parties' policies.

License

MIT © Microsoft Corporation

flint-chart (microsoft/flint-chart)

Searching Database…

这是什么?Flint 是一种可视化中间语言,让 AI 智能体把简单、人类可编辑的图表规格变成精致、富有表现力的图表,而不必手写比例尺、坐标轴和布局。
这是图表库还是 MCP 服务器?两者都是:仓库提供 flint-chart——一个把 Flint 规格编译为 Vega-Lite、ECharts、Chart.js、Plotly 或 Excel 原生输出的 JS/TS 库;以及 flint-chart-mcp——一个 MCP 服务器,让智能体能在聊天或编程环境里创建、验证和渲染这些图表。
怎么开始在我的智能体里用 Flint?把支持 MCP 的客户端(VS Code 里的 GitHub Copilot 或 Claude 的自定义连接器)指向 Flint 的托管 MCP 服务器,或按 MCP Server Guide 的说明在本地运行 flint-chart-mcp 以处理大型数据集;要当普通库用,就导入 flint-chart 并向你要用的后端传入 ChartAssemblyInput。
用这个 JS 库之前需要装什么吗?构建和运行该项目需要 Node 18+。
Python 版本已经能用了?还没有,Python 包尚未发布——当前的 Python 移植只是仓库里的仅源码预览版,而且 ThemeSpec 目前只影响 Vega-Lite 输出。
Flint 是为谁打造的?它面向 AI 智能体,以及构建智能体工作流、需要生成可靠又好看的图表而不想手写冗长图表库参数的开发者。
Flint 能编译到哪些图表后端?一份 Flint 规格可以编译为 Vega-Lite、ECharts、Chart.js、Plotly 的后端原生输出,或原生的可编辑 Excel 图表。
Flint 的视觉主题是做什么的?ThemeSpec 把布局、标签、图例、坐标轴、标记几何、排版和颜色定义成一个连贯的系统;你可以用十个内置预设之一(如 New York Times、Economist、Swiss、McKinsey),或只继承并覆盖你需要的部分。
为什么不直接硬编码图表库参数?Flint 从高层语义规格(70 多种语义类型,如 Rank、Price、Country)加上数据和可选主题,推导出比例尺、坐标轴、间距和布局决策,智能体因此不必手动调冗长的图表参数。
Creator
microsoft
Size
43.8 MB
Stars
4.4K
Age
5mo
Commits · 90 Days