@datafe-open/markdown-chart-table

中文文档
0.4.1发布于 2026/10/31MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2680

Interactive AG Grid Community table renderer for Markdown Chart

原始使用文档

@datafe-open/markdown-chart-table

Interactive table renderer for Markdown Chart, built on AG Grid Community. It supports typed sorting and filters, on-demand quick search, pinned columns, structured number/date formatting, change indicators, bars, progress cells, and inline SVG sparklines.

Install it directly when building a custom registry:

pnpm add ag-grid-community @datafe-open/markdown-chart-table
import { ChartRendererRegistry } from '@datafe-open/markdown-chart';
import {
  createTableDataViewProvider,
  createTableRenderer,
} from '@datafe-open/markdown-chart-table';

const registry = new ChartRendererRegistry();
const options = { resolveDataRef, validateDataRef };
registry.register(createTableRenderer(options));
registry.registerDataViewProvider(createTableDataViewProvider(options));

The React and Vue zero-config components register both integrations automatically. The provider is loaded only when a user opens a tabular Data view. If it cannot load, the core HTML data view remains available.

Use renderer: "table" with canonical table data:

```markdown-chart
{
  "version": 1,
  "renderer": "table",
  "data": {
    "kind": "inline",
    "source": [
      { "region": "华东", "sales": 1280000, "growth": 0.18, "apr": 31, "may": 36, "jun": 42 },
      { "region": "华南", "sales": 960000, "growth": -0.04, "apr": 27, "may": 26, "jun": 25 }
    ]
  },
  "spec": {
    "title": "区域销售",
    "height": 420,
    "columns": [
      { "field": "region", "title": "区域", "pinned": "left" },
      { "field": "sales", "title": "销售额", "type": "number", "format": { "style": "currency", "currency": "CNY", "notation": "compact" } },
      { "field": "growth", "title": "同比", "type": "number", "format": { "style": "percent" }, "cell": { "kind": "change", "polarity": "higher-is-better" } },
      { "id": "trend", "title": "近三月", "cell": { "kind": "sparkline", "fields": ["apr", "may", "jun"], "labels": ["4月", "5月", "6月"], "scale": "column" } }
    ],
    "initialSort": [{ "field": "sales", "direction": "desc" }]
  }
}
```

columns accepts 1–50 entries. A column can bind a source field, or use an id for a derived sparkline. Types are string, number, date, and boolean; date columns require ISO dates or timestamps with a timezone and are displayed in UTC. Omitted types infer number only when every non-null value is numeric and boolean only when every non-null value is boolean; dates are never inferred.

The default table budget is 10,000 rows and 200,000 materialized cells (row count multiplied by the union of source fields). Inferred columns are capped at 50. Override the row and cell limits with createTableRenderer({ limits }) and pass the same options to createTableDataViewProvider. Search opens from the compact footer and closes with Escape or the toggle, clearing the quick filter. Column filters open from the headers; floating filter inputs are hidden. The UI does not offer export. The existing serializeTableCsv helper remains available to callers.

版本与发布记录

@datafe-open/markdown-chart-table 共发布 7 个版本,首次发布于 2026/09/18;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.1latest2026/10/3110 天前
0.4.02026/10/2220 天前
0.3.42026/09/221 个月前
0.3.32026/09/211 个月前
0.3.22026/09/201 个月前
0.3.12026/09/181 个月前

关于 @datafe-open/markdown-chart-table 的常见问题

@datafe-open/markdown-chart-table 是什么?

Interactive AG Grid Community table renderer for Markdown Chart

如何安装 @datafe-open/markdown-chart-table?

在项目目录运行 npm install @datafe-open/markdown-chart-table,或使用 pnpm add / yarn add / bun add。

@datafe-open/markdown-chart-table 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@datafe-open/markdown-chart-table 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@datafe-open/markdown-chart-table 可以商用吗?

@datafe-open/markdown-chart-table 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@datafe-open/markdown-chart-table 的下载量有多少?

根据 npm 官方下载统计,@datafe-open/markdown-chart-table 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,680 次,日均约 89 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@datafe-open/markdown-chart-table 还在维护吗?

最新版本 0.4.1 发布于 2026/10/31(10 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/09/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。