@univerjs-pro/engine-pivot 0.21.1 → 0.22.0-insiders.20260513-09bbeca

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,57 +1,34 @@
1
1
  # @univerjs-pro/engine-pivot
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@univerjs-pro/engine-pivot)](https://npmjs.org/packages/@univerjs-pro/engine-pivot)
4
- [![license](https://img.shields.io/npm/l/@univerjs-pro/engine-pivot)](https://img.shields.io/npm/l/@univerjs-pro/engine-pivot)
3
+ [![npm version](https://img.shields.io/npm/v/@univerjs-pro/engine-pivot?style=flat-square)](https://npmjs.com/package/@univerjs-pro/engine-pivot)
4
+ [![downloads](https://img.shields.io/npm/dm/@univerjs-pro/engine-pivot?style=flat-square)](https://npmjs.com/package/@univerjs-pro/engine-pivot)
5
5
 
6
- ## Introduction
6
+ `@univerjs-pro/engine-pivot` provides pivot table calculation engine for Univer Pro.
7
7
 
8
- > Pivot table is a powerful data analysis tool that can quickly summarize, organize and analyze large amounts of data, thereby helping users discover patterns and trends in the data. This package contains the analyze logic for univer pivot.
8
+ ## Package Overview
9
9
 
10
- - 11 subtotal methods supported like excel
11
- - Dimension label filtering and sorting (using localCompare method), label value filter.
12
- - tabular layout
13
- - expand / collapse
14
- - Supports multiple value dimensions, and can customize the area (value position) and position (value index) of the multi-value dimension.
15
- - rename field & format filed
10
+ | Package | UMD global | CSS | Locales | Facade entry |
11
+ | --- | --- | :---: | :---: | :---: |
12
+ | `@univerjs-pro/engine-pivot` | `UniverProEnginePivot` | No | No | No |
16
13
 
17
- More info you can get from link [https://docs.univer.ai/guides/sheets/features/pivot-table#data-source](https://docs.univer.ai/guides/sheets/features/pivot-table#data-source)
14
+ ## Installation
18
15
 
19
- > This npm package does not depend on any third-party libraries.
20
-
21
- ## Usage
22
-
23
- We do not recommend using this npm package alone because it is pure calculation logic without any UI. You can use `@univerjs-pro/sheets-pivot` and `@univerjs-pro/sheets-pivot-ui` to get the complete experience, here are the reference links: [https://docs.univer.ai/en-US/guides/sheets/features/pivot-table
24
- ](https://docs.univer.ai/en-US/guides/sheets/features/pivot-table
25
- )
26
- ### Installation
27
-
28
- ```shell
29
- npm i @univerjs-pro/engine-pivot
16
+ ```sh
17
+ pnpm add @univerjs-pro/engine-pivot
18
+ # or
19
+ npm install @univerjs-pro/engine-pivot
30
20
  ```
31
21
 
32
- ## Performance of Pivot Table
33
- Test machine spec: a MacBook Pro with Apple Silicon M2 Pro.
22
+ Keep all `@univerjs/*` and `@univerjs-pro/*` packages on the same version.
34
23
 
35
- | Spreadsheet Cells Count | Read data (s) | Query time (s) |
36
- | :---------------------------------------------------------------------- | :------------ | :------------- |
37
- | 500k (1 pivot row dimension, 1 pivot col dimension, 2 value dimensions) | 0.252 | 0.040 |
38
- | 1M (1 pivot row dimension, 1 pivot col dimension, 2 value dimensions) | 0.376 | 0.078 |
39
- | 2M (1 pivot row dimension, 1 pivot col dimension, 2 value dimensions) | 0.732 | 0.140 |
40
- | 5M (1 pivot row dimension, 1 pivot col dimension, 2 value dimensions) | 3.200 | 0.415 |
41
-
42
- ## Custom Parameters
43
-
44
- The following config is global config for pivot engine.
24
+ ## Usage
45
25
 
46
- ```js
47
- import {setMaxLimitItemCount, setDateSystem, PivotDateGroupFieldDateSystemEnum, setDefaultSortType} from "@univerjs-pro/engine-pivot"
26
+ ```ts
27
+ import { PivotModel, PivotTable } from '@univerjs-pro/engine-pivot';
28
+ ```
48
29
 
49
- // use the 1904 date system
50
- setDateSystem(PivotDateGroupFieldDateSystemEnum.Date1904)
30
+ ## Resources
51
31
 
52
- // set the max field items count to 200, this case only use for some data has many no repeated items, the performance is bad and human unreadable
53
- setMaxLimitItemCount(200)
32
+ - [Documentation](https://docs.univer.ai/guides/pro)
33
+ - [NPM package](https://npmjs.com/package/@univerjs-pro/engine-pivot)
54
34
 
55
- // change the default pivot sort type, if the pivot table not set sort info, it will works as default
56
- setDefaultSortType('ascending')
57
- ```