flint-chart README

项目的 README,来自 github.com/microsoft/flint-chart。合并为一个 markdown 文件:README.md。

Flint: A Visualization Language for the AI Era

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

Project site · 中文主页 · MCP server · Gallery

Flint lets AI agents reliably create expressive, good-looking and interactive charts from simple, human-editable specs. Good-looking charts usually take verbose low-level settings that tangle visual, style and interaction logic together; Flint moves that work into a compiler, so the spec stays short.

Use it as an MCP server with your agent, or as an npm library in your app. Flint supports 52 chart types across 5 rendering backends (Vega-Lite, ECharts, Chart.js, Plotly and native Excel charts), with 14 preset themes and 23 interaction presets.

A wall of charts drawn by Flint from real data, each in a different preset theme: a globe of the Ring of Fire, a route map of Magellan's voyage, a US choropleth, ridgelines, a calendar heatmap, a waterfall, violins, a radar, a bump chart, a population pyramid, and everyday bar, line, scatter, area and donut charts.

https://github.com/user-attachments/assets/c1cda0fa-3ea7-41af-b3fd-a127bc83d641

🔊 Click the speaker icon for sound   Watch on YouTube

Updates

See the changelog for every release.

Quick start

With your agent (MCP server)

Paste this into your agent, such as GitHub Copilot, Claude Code, Codex or Cursor. It adds the Flint MCP server and draws your first chart:

Help me set up Flint as an MCP server named "flint"!

1. Add it to my client config, using whichever option my client supports:
   - a local (stdio) server: npx -y flint-chart-mcp
   - the hosted server over HTTP: https://flint.data-formulator.ai/mcp
2. Verify the setup by listing the available Flint chart types.
3. Show me a fun first chart: how many moons each planet has, in a Flint theme you like.

Then ask for charts in your own words, such as "compare today's change for the Magnificent Seven stocks in Economist style, and let me hover to read each one". The agent opens a live chart in the conversation, or returns a PNG, an SVG or a backend-native spec. To set it up by hand, see the MCP server guide.

An agent chat where the user asks for global temperatures since 1880 in a newspaper style with brushing, and Flint answers with a live, interactive line chart.

In your app (npm library)

npm install flint-chart
import type { ChartAssemblyInput } from 'flint-chart';
import { FlintChart } from 'flint-chart/react';

const spec: ChartAssemblyInput = {
  data: { values: [
    { Month: '2026-01', Users: 1200 },
    { Month: '2026-02', Users: 1800 },
  ] },
  semantic_types: { Month: 'YearMonth', Users: 'Quantity' },
  chart_spec: { chartType: 'Line Chart', encodings: { x: 'Month', y: 'Users' } },
  theme_spec: 'economist',
  interaction_spec: { interactions: [{ type: 'inspect-index' }] },
};

<FlintChart spec={spec} />

flint-chart comes with every backend it draws with; React is an optional peer, needed only for <FlintChart>. Without React, mountChart from flint-chart/interactive mounts the same chart in any page, and assembleVegaLite, assembleECharts, assembleChartjs, assemblePlotly and assembleExcel compile a spec into each library's own. To have your coding agent build it, point it at Flint's chart and interaction authoring skills.

How it works

A Flint spec is the data, semantic types, a chart spec, and optional theme and interaction specs. Instead of leaving the glue to you, the compiler resolves each part against the others and composes a complete spec for the backend.

A Flint spec with semantic types, theme and interaction compiled into a Vega-Lite spec and rendered as a temperature heatmap.

Documentation

A Python port is in preview as source in packages/flint-py; its package is not yet released.

Contributing

Contributions are welcome, especially new chart templates and rendering backends. See CONTRIBUTING, and the development guide for setup, commands and the repository layout. Pick up an issue, add a chart template or a theme, or share what you build.

Contributors to Flint

Community

Join the Flint Discord to ask questions, share your charts and follow releases.

Flint WeChat group
Flint WeChat user group QR code

Code of conduct, security and trademarks

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

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)

正在搜索数据库…

这是什么?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)加上数据和可选主题,推导出比例尺、坐标轴、间距和布局决策,智能体因此不必手动调冗长的图表参数。
作者
microsoft
大小
64.2 MB
星标
4.6K
时长
6个月
提交 · 90 天