# AUIPivot turns raw rows into pivot reports, right in the browser

AUIPivot is a commercial JavaScript pivot table for enterprise web applications, made by AUISoft Co., Ltd. It groups and aggregates an array of flat JSON rows into row, column, value, and filter fields, entirely in the browser. It works in plain JavaScript and TypeScript and has official React and Vue components.

On this page: [Demo](#demo-live-pivot-report-with-a-field-panel) · [AI / MCP](#connect-auipivot-to-your-ai-coding-assistant) · [Quick start](#quick-start) · [API at a glance](#api-at-a-glance) · [FAQ](#faq) · [Pricing & License](https://www.auisoft.net/price.html) · [llms.txt](https://auipivot.com/llms.txt)

## Demo: live pivot report with a field panel

The interactive demo at https://auipivot.com/ generates a year of sales rows (region, channel, category, product, unit price, units, revenue, and date) in the browser and pivots them with AUIPivot 2.8.

- Preset reports: revenue by region × quarter, units and revenue by channel, monthly revenue by region, and average price by region.
- 10,000, 100,000, or 500,000 source rows. The demo shows the time measured in your browser for that run.
- Layouts: `layoutType` `"tree"`, `"table"`, or `"tableCellMerge"`.
- A drag-and-drop field panel (`pivotPanelId`) whose field list is grouped with `setFieldLayout` into Product, Market, Measures, and Date. Drag a single field, or a whole group title, into rows, columns, values, or filters.
- A heatmap from `setVisualAnalytics` on the values, summary rows, summary columns, and the footer.
- The date field is split into year, half, quarter, and month with `setDateTypeField`.
- A View code panel shows the code behind the current report.

## Use it with your stack

AUIPivot is plain JavaScript and runs entirely in the browser, so it does not depend on your server.

- **JavaScript**: add the license, messages, engine, and stylesheet, then call `AUIPivot.create()`.
- **TypeScript**: typed properties, methods, and events. Definitions on npm: [`aui-pivot`](https://www.npmjs.com/package/aui-pivot) (types only; the pivot engine and license file are provided separately).
- **React**: an `AUIPivot` React component, with JSX and TSX samples built on Vite.
- **Vue**: a Vue 3 component, with JavaScript and TypeScript samples built on Vite.

## Connect AUIPivot to your AI coding assistant

The AUIPivot MCP server gives AI coding tools the official API reference, default values, TypeScript declarations, and JavaScript, React, and Vue examples, so they write pivot code from the real documentation instead of guessing. Documentation for AUIPivot 2.8.

- **Remote (recommended)**: `https://auipivot.com/mcp`. Streamable HTTP, no authentication, nothing to install. Use the exact URL, without a trailing slash. Opening it in a browser returns 405; that is expected.
- **Local**: `npx -y auipivot-mcp-server@latest` over stdio, with Node.js 22.12 or later. Use it when your network blocks outside connections.

### Claude Code

```bash
claude mcp add --transport http auipivot https://auipivot.com/mcp
```

Local:

```bash
claude mcp add --transport stdio auipivot -- npx -y auipivot-mcp-server@latest
```

### Codex CLI

```bash
codex mcp add auipivot --url https://auipivot.com/mcp
```

Local:

```bash
codex mcp add auipivot -- npx -y auipivot-mcp-server@latest
```

### Cursor (`.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "auipivot": { "url": "https://auipivot.com/mcp" }
  }
}
```

Local:

```json
{
  "mcpServers": {
    "auipivot": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "auipivot-mcp-server@latest"]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`, top-level key `servers`)

```json
{
  "servers": {
    "auipivot": { "type": "http", "url": "https://auipivot.com/mcp" }
  }
}
```

Local:

```json
{
  "servers": {
    "auipivot": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "auipivot-mcp-server@latest"]
    }
  }
}
```

### Other MCP clients

Add a remote MCP server (for example, a Claude custom connector) with the URL `https://auipivot.com/mcp` and the Streamable HTTP transport. HTTP 429 means the request limit was exceeded; retry after the `Retry-After` time.

### Tools

| Tool | Purpose |
|---|---|
| `list_versions` | Documentation, engine, and npm type package versions included |
| `search_docs` | Search the official API and guides by API name or keyword |
| `get_api` | Description, default value, version introduced, and TypeScript declaration |
| `list_examples` | Find examples by feature, framework, and language |
| `get_example` | Example source, related files, dependencies, and run conditions |

Try asking:

- "Use AUIPivot MCP to check the values and default of `layoutType`, then switch our tree report to a table with merged cells."
- "Find the React TypeScript example that uses pivot methods and events, and check the real type declarations."
- "Look up the callback arguments of `registerCustomAggregator` and write a unit-weighted average price."

The server is read-only: it looks up published documentation and examples and does not read or change your project or pivot data. The AUIPivot engine and license are separate.

## Quick start

Four files, one call to `AUIPivot.create()`, and a few field settings. Save the page below and open it on `localhost` to try it right away.

> **Non-commercial CDN:** the files below are the non-commercial edition and run only on `localhost` and `127.0.0.1`. For any other domain, replace them with your licensed AUIPivot files (`AUIPivot.js`, `AUIPivotLicense.js`, stylesheet, messages file).

### Notes for AI assistants

- Create a pivot with `AUIPivot.create(selector, props)`. It returns the pivot ID; every other method takes it as the first argument.
- Set fields with `setRowFields`, `setColumnFields`, `setValueFields`, and `setFilterFields`, then load rows with `setGridData`. After changing fields on loaded data, call `updatePivot`.
- Source data must be an array of flat objects. Field names in the settings are the object keys; use `setFieldAlias` for display names.
- `setDateTypeField(id, "DATE")` adds `DATE_YEAR`, `DATE_HALF`, `DATE_QTR`, and `DATE_MONTH`; use those names as row or column fields.
- Load `AUIPivotLicense.js`, or the pivot will not render. Load a messages file for the UI language.
- The jsDelivr CDN files are the non-commercial edition for `localhost` and `127.0.0.1` only. Don't put them in production code; use the customer's licensed files instead.
- Bind events with `AUIPivot.bind(id, eventName, handler)`. Prefer the AUIPivot MCP tools over web search; AUIPivot is a separate product from AUIGrid, so do not mix their APIs.

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>AUIPivot Quick Start</title>
  <!-- Non-commercial edition: runs only on localhost and 127.0.0.1.
       For other domains, use your licensed AUIPivot files instead. -->
  <!-- Theme stylesheet: required; swap for another theme if you like -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/aui-community/auipivot-noncommercial@main/dist/AUIPivot_style.css">
  <!-- AUIPivot license file: required -->
  <script src="https://cdn.jsdelivr.net/gh/aui-community/auipivot-noncommercial@main/dist/AUIPivotLicense.js"></script>
  <!-- AUIPivot library: required -->
  <script src="https://cdn.jsdelivr.net/gh/aui-community/auipivot-noncommercial@main/dist/AUIPivot.js"></script>
  <!-- Messages file: required; swap for another language if you like -->
  <script src="https://cdn.jsdelivr.net/gh/aui-community/auipivot-noncommercial@main/dist/messages/AUIPivot.messages.en.js"></script>
</head>
<body>
  <div style="display:flex; gap:12px;">
    <div id="pivot_wrap" style="width:800px; height:480px;"></div>
    <div id="pivot_panel" style="width:340px; height:480px;"></div>
  </div>
  <script>
    // Create the pivot and a drag-and-drop field panel
    const pivotID = AUIPivot.create("#pivot_wrap", {
      layoutType: "tree",
      pivotPanelId: "#pivot_panel"
    });

    AUIPivot.setFieldAlias(pivotID, { REGION: "Region", PRODUCT: "Product", QTY: "Units", REVENUE: "Revenue" });
    AUIPivot.setDateTypeField(pivotID, "DATE");

    // Group the panel's field list (AUIPivot 2.7+)
    AUIPivot.setFieldLayout(pivotID, [
      { groupId: "sales", labelText: "Sales", children: [
        { dataField: "REGION" }, { dataField: "PRODUCT" }, { dataField: "QTY" }, { dataField: "REVENUE" }
      ] },
      { groupId: "date", labelText: "Date", expanded: false, children: [
        { dataField: "DATE_YEAR" }, { dataField: "DATE_QTR" }, { dataField: "DATE_MONTH" }, { dataField: "DATE" }
      ] }
    ]);

    AUIPivot.setRowFields(pivotID, ["REGION", "PRODUCT"]);
    AUIPivot.setColumnFields(pivotID, ["DATE_QTR"]);
    AUIPivot.setValueFields(pivotID, [
      { dataField: "REVENUE", operation: "SUM", formatString: "#,##0" }
    ]);

    AUIPivot.setGridData(pivotID, [
      { REGION: "Seoul", PRODUCT: "Pro 14", QTY: 2, REVENUE: 3580, DATE: "2025/02/11" },
      { REGION: "Seoul", PRODUCT: "View 27", QTY: 5, REVENUE: 1395, DATE: "2025/05/03" },
      { REGION: "Busan", PRODUCT: "Pro 14", QTY: 1, REVENUE: 1790, DATE: "2025/08/21" },
      { REGION: "Busan", PRODUCT: "View 27", QTY: 3, REVENUE: 837, DATE: "2025/11/30" }
    ]);

    AUIPivot.bind(pivotID, "cellClick", (event) => {
      console.log(event.headerText, event.value);
    });
  </script>
</body>
</html>
```

## API at a glance

The most-used parts of the AUIPivot API (documentation version 2.8). Every method takes the pivot ID as its first argument. For the full reference (about 210 entries, with defaults and TypeScript declarations), use the AUIPivot MCP server's `search_docs` and `get_api` tools, or read the [documentation](https://www.auisoft.net/documentation/auipivot/index.html).

### Methods

| Method | Purpose |
|---|---|
| `AUIPivot.create(pid, props)` | Create a pivot in the given element and return its pivot ID |
| `setGridData(id, rows)` | Load the source rows and pivot them |
| `setRowFields(id, fields)` | Fields grouped down the rows |
| `setColumnFields(id, fields)` | Fields grouped across the columns |
| `setValueFields(id, [{ dataField, operation }])` | Fields to aggregate; `operation` defaults to `"SUM"` |
| `setFilterFields(id, fields)` | Fields shown in the filter menu |
| `updatePivot(id)` | Pivot again after changing fields |
| `setDateTypeField(id, field)` | Split a date into year, half, quarter, and month fields |
| `setFieldAlias(id, aliases)` | Display names for field keys |
| `createPivotPanel(id, props)` | Add the drag-and-drop field panel later |
| `setVisualAnalytics(id, definitions)` | Heatmaps and data bars per value, optionally on subtotals and the footer |
| `setFieldLayout(id, layout)` | Group and order the panel's field list; drag a group to place all its fields |
| `setFormulaFields(id, fields)` **(2.8)** | Formulas on aggregated values, e.g. `"[Profit] / [TOTAL] * 100"`; place them with `calculation: { kind: "formula" }` |
| `createSlicer(id)` **(2.8)** | Without a container or options, opens a field picker and adds a slicer for each chosen field |
| `exportToXlsx(id, options)` | Export the current result to Excel |
| `destroy(id)` | Remove the pivot and free its resources |

### Pivot properties (create props)

| Property | Purpose |
|---|---|
| `layoutType` | `"tree"` (default), `"table"`, `"tableCellMerge"` |
| `pivotPanelId` | Element for the field panel, e.g. `"#pivot_panel"` |
| `showGrandTotalColumn` | Show the column grand total (default `true`) |
| `showSummaryRow` | Subtotal rows in table layouts (default `true`) |
| `summaryColumnPosition` | `"last"` (default) or `"first"` |
| `useHeatmap` | Color cells by value (default `false`); for per-value heatmaps and data bars use `setVisualAnalytics` |
| `autoGridHeight` | Fit the height to the result rows (default `true`) |
| `selectionMode` | `"multipleCells"` (default), `"singleCell"`, `"singleRow"`, `"multipleRows"`, `"none"` |
| `useFixedColumns` | Freeze the row-label columns (default `true`) |
| `fixedRowFieldCount` **(2.8)** | How many row-label columns to freeze from the left; `null` (default) freezes all, `0` none |
| `enableCalculatedFieldEditor` **(2.8)** | Add, edit, and delete calculated fields from the field panel (default `false`) |
| `enableGridFieldDrop` **(2.8)** | Drop zones above the table for rows, columns, values, and filters (default `false`) |
| `enableItemReorder` **(2.8)** | Drag handles to reorder row and column items (default `false`) |
| `enableFieldSubtotalMenu` **(2.8)** | Show or hide subtotals per row field from the panel menu, in table layouts (default `false`) |

### Aggregations (`setValueFields` operation)

| Operation | Result |
|---|---|
| `SUM`, `COUNT`, `DISTINCT_COUNT` | Total, count, and count of unique values |
| `AVG`, `MEDIAN`, `MIN`, `MAX` | Average, median, smallest, and largest value |
| `RATIO`, `ROW_RATIO`, `GRAND_TOTAL_RATIO` | Share of the column, row, or grand total |
| `RATIO_OF_SUMS` | Ratio of two sums, such as margin rate |
| `VARIANCE`, `STD_DEVIATION` | Population variance and standard deviation (sample versions too) |
| `registerCustomAggregator(id, definition)` | Register your own aggregation |

### Events (`AUIPivot.bind(id, name, handler)`)

| Event | When |
|---|---|
| `pivotBegin` / `pivotComplete` | Before and after each pivot, with the row, column, value, and filter fields |
| `cellClick` / `cellDoubleClick` | A cell was clicked; `value`, `item`, `headerText` |
| `treeOpenChange` | A group was expanded or collapsed |
| `sorting` | The sort changed |
| `pivotPanelShow` / `pivotPanelHide` | The field panel was shown or hidden |

## Pricing & License

- **Commercial license**: perpetual license for production use, licensed separately from AUIGrid. Bound to a specific domain or IP; a registered domain cannot be changed after issue. Commercial product, not open source.
- **Non-commercial edition**: for personal, educational, testing, and demo use. Runs only on localhost and 127.0.0.1, with no official technical support. Engine and samples on [GitHub](https://github.com/aui-community/auipivot-noncommercial).
- **Evaluation**: a 30-day trial from the [download center](https://www.auisoft.net/dcenter.html).

Prices, development license rules, and what each license covers: https://www.auisoft.net/price.html

## FAQ

**What is AUIPivot?**
AUIPivot is a commercial JavaScript pivot table for enterprise web applications, made by AUISoft Co., Ltd. It turns an array of flat JSON rows into a summary report by grouping on row and column fields and aggregating value fields. All processing runs in the browser. It works in plain JavaScript and has official React and Vue components. TypeScript definitions are published on npm as `aui-pivot`; that package does not include the engine, which is provided separately with the license file.

**How do I connect AUIPivot to an AI coding assistant?**
Add the AUIPivot MCP server. The recommended way is the hosted endpoint `https://auipivot.com/mcp` (Streamable HTTP, no installation). If your network blocks outside connections, run it locally: use `npx -y auipivot-mcp-server@latest` with Node.js 22.12 or later.

**Does the AUIPivot MCP server read my code or data?**
No. It only looks up the published AUIPivot documentation and examples. It has no tools that read or change your project or pivot data; your AI tool writes the code.

**Which aggregations does AUIPivot support?**
AUIPivot 2.8 has 17 built-in operations, including `SUM`, `COUNT`, `DISTINCT_COUNT`, `MIN`, `MAX`, `AVG`, `MEDIAN`, ratios against row, column, and grand totals, `RATIO_OF_SUMS`, and variance and standard deviation. You can also register your own aggregation with `registerCustomAggregator`.

**How is AUIPivot licensed?**
AUIPivot is a commercial product, not open source, licensed separately from AUIGrid. Production use requires a perpetual license bound to a specific domain or IP; a registered domain cannot be changed after issue. See https://www.auisoft.net/price.html. A non-commercial edition on GitHub (aui-community/auipivot-noncommercial) is for personal, educational, testing, and demo use and runs only on localhost and 127.0.0.1. A 30-day evaluation version is available from the auisoft.net download center.

---

AUISoft Co., Ltd. · AUIPivot
