Skip to content
Merged

Next #64

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions docs/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ description: You can learn about the configuration in the documentation of the D

Configure the Pivot table and the Configuration panel through the following API:

- [`config`](api/config/config-property.md) define the structure of the Pivot table and how data is aggregated
- [`render-table`](api/events/render-table-event.md) change the table configuration on the fly
- [`tableShape`](api/config/tableshape-property.md) configure the look of the Pivot table
- [`columnShape`](api/config/columnshape-property.md) configure the look and behavior of columns
- [`headerShape`](api/config/headershape-property.md) configure the look and behavior of headers
- [`configPanel`](api/config/configpanel-property.md) control the visibility of the Configuration panel
- [`setLocale`](api/methods/setlocale-method.md) apply a locale (see [Localization](guides/localization.md))
- [`data`](api/config/data-property.md), [`fields`](api/config/fields-property.md) load data and field metadata
- [`predicates`](api/config/predicates-property.md) pre-process data before aggregation
- [`methods`](api/config/methods-property.md) define custom aggregation methods
- [`limits`](api/config/limits-property.md) cap the number of rows and columns in the final dataset
- [`config`](api/config/config-property.md) - define the structure of the Pivot table and how data is aggregated
- [`render-table`](api/events/render-table-event.md) - change the table configuration on the fly
- [`tableShape`](api/config/tableshape-property.md) - configure the look of the Pivot table
- [`columnShape`](api/config/columnshape-property.md) - configure the look and behavior of columns
- [`headerShape`](api/config/headershape-property.md) - configure the look and behavior of headers
- [`configPanel`](api/config/configpanel-property.md) - control the visibility of the Configuration panel
- [`setLocale`](api/methods/setlocale-method.md) - apply a locale (see [Localization](guides/localization.md))
- [`data`](api/config/data-property.md), [`fields`](api/config/fields-property.md) - load data and field metadata
- [`predicates`](api/config/predicates-property.md) - pre-process data before aggregation
- [`methods`](api/config/methods-property.md) - define custom aggregation methods
- [`limits`](api/config/limits-property.md) - cap the number of rows and columns in the final dataset

For instructions on working with data, see [Working with data](guides/working-with-data.md).

Expand Down Expand Up @@ -81,14 +81,14 @@ To set the width of specific columns, use the `width` parameter of the [`columnS

## Autosize columns to content

Use the `autoWidth` parameter of the [`columnShape`](api/config/columnshape-property.md) property to calculate column widths automatically. All `autoWidth` sub-parameters are optional — for full descriptions see the [`columnShape`](api/config/columnshape-property.md) reference.
Use the `autoWidth` parameter of the [`columnShape`](api/config/columnshape-property.md) property to calculate column widths automatically. All `autoWidth` sub-parameters are optional. For full descriptions, see the [`columnShape`](api/config/columnshape-property.md) reference.

The `autoWidth` object accepts the following parameters:

- `columns` object that selects which fields receive auto-calculated width
- `auto` adjusts the width to the header, the cell content, or both
- `maxRows` number of data rows analyzed to detect column size (default: 20)
- `firstOnly` if `true` (default), analyzes each field only once. When multiple columns are based on the same field (e.g., `oil` with `count` and `oil` with `sum`), only the first column is analyzed and the others inherit its width
- `columns` - object that selects which fields receive auto-calculated width
- `auto` - adjusts the width to the header, the cell content, or both
- `maxRows` - number of data rows analyzed to detect column size (default: 20)
- `firstOnly` - if `true` (default), analyzes each field only once. When multiple columns are based on the same field (e.g., `oil` with `count` and `oil` with `sum`), only the first column is analyzed and the others inherit its width

The following code snippet enables `autoWidth` for four fields and disables `firstOnly` so every column gets its own measurement:

Expand Down Expand Up @@ -460,7 +460,7 @@ widget.api.on("render-table", ({ config: tableConfig }) => {

## Sort in columns

Sorting in the UI is enabled by default users click a column header to sort. To disable it, set the `sort` parameter of the [`columnShape`](api/config/columnshape-property.md) property to `false`.
Sorting in the UI is enabled by default: users click a column header to sort. To disable it, set the `sort` parameter of the [`columnShape`](api/config/columnshape-property.md) property to `false`.

The following code snippet disables UI sorting:

Expand Down Expand Up @@ -727,10 +727,10 @@ For an alternative API, use the [`showConfigPanel`](api/methods/showconfigpanel-

The Configuration panel supports the following field operations:

- [`add-field`](api/events/add-field-event.md) add a field to an area
- [`delete-field`](api/events/delete-field-event.md) remove a field from an area
- [`update-field`](api/events/update-field-event.md) update a field's method or settings
- [`move-field`](api/events/move-field-event.md) reorder fields within an area
- [`add-field`](api/events/add-field-event.md) - add a field to an area
- [`delete-field`](api/events/delete-field-event.md) - remove a field from an area
- [`update-field`](api/events/update-field-event.md) - update a field's method or settings
- [`move-field`](api/events/move-field-event.md) - reorder fields within an area

**Related samples**:
- [Pivot 2. Adding text templates for table and header cells](https://snippet.dhtmlx.com/n9ylp6b2)
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ const table = new pivot.Pivot("#root", {

The constructor returns a Pivot instance. Call API methods on the returned instance:

- [`getTable`](api/methods/gettable-method.md) get access to the underlying Table widget instance
- [`setConfig`](api/methods/setconfig-method.md) update the current Pivot configuration
- [`setLocale`](api/methods/setlocale-method.md) apply a new locale to Pivot
- [`showConfigPanel`](api/methods/showconfigpanel-method.md) show or hide the Configuration panel
- [`getTable`](api/methods/gettable-method.md) - get access to the underlying Table widget instance
- [`setConfig`](api/methods/setconfig-method.md) - update the current Pivot configuration
- [`setLocale`](api/methods/setlocale-method.md) - apply a new locale to Pivot
- [`showConfigPanel`](api/methods/showconfigpanel-method.md) - show or hide the Configuration panel

## Configuration properties

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/integration-with-angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ng new my-angular-pivot-app
~~~

:::note
Disable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) when prompted by the Angular CLI — this guide assumes a client-rendered app.
Disable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) when prompted by the Angular CLI. This guide assumes a client-rendered app.
:::

The command installs all necessary tools. No additional commands are needed.
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/loading-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ Pivot accepts CSV data after you convert it to JSON with an external JS parsing

The example below uses the external [PapaParse](https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.min.js) library to load and convert data on a button click. The `convert()` helper takes the following parameters:

- `data` a string with CSV data
- `headers` an array of CSV field names
- `meta` an object mapping field names to data types
- `data` - a string with CSV data
- `headers` - an array of CSV field names
- `meta` - an object mapping field names to data types

The following code snippet creates Pivot, defines the `convert()` helper, and applies parsed CSV data through [`setConfig`](api/methods/setconfig-method.md) on a button click:

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/stylization.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ To style body or footer cells, use the `cellStyle` parameter of the [`tableShape
The example below applies styles to body and header cells:

- body cells receive a class based on cell values (e.g., `"Down"`, `"Up"`, `"Idle"` in the `status` field) and on total values (greater than 40 or less than 5)
- header cells receive a class based on the value of the `streaming` field `status-down` for `"no"` and `status-up` for any other value
- header cells receive a class based on the value of the `streaming` field: `status-down` for `"no"` and `status-up` for any other value

~~~jsx
const widget = new pivot.Pivot("#pivot", {
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/typescript-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: You can learn about using typescript with the DHTMLX JavaScript Piv

# TypeScript support

DHTMLX Pivot ships TypeScript definitions starting from v2.0. The definitions are ready to use no extra configuration needed.
DHTMLX Pivot ships TypeScript definitions starting from v2.0. The definitions are ready to use, with no extra configuration needed.

:::info
Try Pivot live in the [Snippet Tool](https://snippet.dhtmlx.com/y2buoahe).
Expand Down
52 changes: 26 additions & 26 deletions docs/guides/working-with-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This page describes how to aggregate, format, sort, filter, and pre-process data

## Define fields

Use the [`fields`](api/config/fields-property.md) property to declare the fields that Pivot can place in rows, columns, and values. Each item in the `fields` array describes one field its ID, label, and data type.
Use the [`fields`](api/config/fields-property.md) property to declare the fields that Pivot can place in rows, columns, and values. Each item in the `fields` array describes one field: its ID, label, and data type.

The following code snippet initializes Pivot with five fields:

Expand Down Expand Up @@ -127,7 +127,7 @@ For the `xlsx` export format, Pivot exports date and number fields as raw values

## Define Pivot structure

Use the [`config`](api/config/config-property.md) property to declare which fields appear as rows, columns, and aggregated values, and how the data is filtered. The `config` property has no predefined values you must set it to render any data. See the [`config`](api/config/config-property.md) reference for the full parameter list.
Use the [`config`](api/config/config-property.md) property to declare which fields appear as rows, columns, and aggregated values, and how the data is filtered. The `config` property has no predefined values, so you must set it to render any data. See the [`config`](api/config/config-property.md) reference for the full parameter list.

The following code snippet places `continent` and `name` in rows, `year` in columns, three aggregations in values, and a filter on `name`:

Expand Down Expand Up @@ -253,17 +253,17 @@ In the UI, filters appear as drop-down lists for each field.

Pivot supports the following filter conditions per data type:

- text fields `equal`, `notEqual`, `contains`, `notContains`, `beginsWith`, `notBeginsWith`, `endsWith`, `notEndsWith`, `includes`
- numeric fields `equal`, `notEqual`, `greater`, `greaterOrEqual`, `less`, `lessOrEqual`, `contains`, `notContains`, `beginsWith`, `notBeginsWith`, `endsWith`, `notEndsWith`
- date fields `equal`, `notEqual`, `greater`, `greaterOrEqual`, `less`, `lessOrEqual`, `between`, `notBetween`, `includes`
- text fields: `equal`, `notEqual`, `contains`, `notContains`, `beginsWith`, `notBeginsWith`, `endsWith`, `notEndsWith`, `includes`
- numeric fields: `equal`, `notEqual`, `greater`, `greaterOrEqual`, `less`, `lessOrEqual`, `contains`, `notContains`, `beginsWith`, `notBeginsWith`, `endsWith`, `notEndsWith`
- date fields: `equal`, `notEqual`, `greater`, `greaterOrEqual`, `less`, `lessOrEqual`, `between`, `notBetween`, `includes`

The `includes` rule restricts a filter to a specific set of allowed values.

#### Add a filter

To declare a filter, add the `filters` object to the [`config`](api/config/config-property.md) property, keyed by field ID. Each value is an object of filter conditions.

The following code snippet applies two filters one on `genre` (values containing `"D"`, restricted to `"Drama"`) and one on `title` (values containing `"A"`):
The following code snippet applies two filters, one on `genre` (values containing `"D"`, restricted to `"Drama"`) and one on `title` (values containing `"A"`):

~~~jsx
const table = new pivot.Pivot("#root", {
Expand Down Expand Up @@ -304,7 +304,7 @@ To filter data through the Table widget API instead, access the Table instance w
To prevent the component from hanging on very large datasets, cap the number of rows and columns in the final dataset with the [`limits`](api/config/limits-property.md) property. Pivot interrupts rendering once the limit is reached. The default cap is 10000 for rows and 5000 for columns.

:::note
Limits apply to large datasets. The numbers are approximate Pivot does not guarantee an exact row/column count.
Limits apply to large datasets. The numbers are approximate; Pivot does not guarantee an exact row/column count.
:::

The following code snippet caps the dataset at 10 rows and 3 columns:
Expand Down Expand Up @@ -337,19 +337,19 @@ const table = new pivot.Pivot("#root", {

Pivot includes the following built-in aggregation methods:

- `sum` (numeric values only) sums all selected values; ignores empty cells, logical values like `TRUE`, and text
- `min` (numeric and date values) returns the minimum value; ignores empty cells, logical values, and text. Returns `0` if the input contains no numbers
- `max` (numeric and date values) returns the maximum value; ignores empty cells, logical values, and text. Returns `0` if the input contains no numbers
- `count` (numeric, text, and date values) counts non-blank cells; this is the default method assigned to every newly added field
- `countunique` (numeric and text values) counts the number of unique values in the input
- `average` (numeric values only) calculates the arithmetic mean of the input; ignores empty cells, logical values, and text. Includes cells with the value zero
- `counta` (numeric, text, and date values) counts all non-blank values, including numbers, dates, and text
- `median` (numeric values only) returns the median of the input
- `product` (numeric values only) returns the product of all numbers in the input
- `stdev` (numeric values only) standard deviation, treating the input as a sample of a larger set
- `stdevp` (numeric values only) standard deviation, treating the input as the entire population
- `var` (numeric values only) variance, treating the input as a sample of a larger set
- `varp` (numeric values only) variance, treating the input as the entire population
- `sum` (numeric values only) - sums all selected values; ignores empty cells, logical values like `TRUE`, and text
- `min` (numeric and date values) - returns the minimum value; ignores empty cells, logical values, and text. Returns `0` if the input contains no numbers
- `max` (numeric and date values) - returns the maximum value; ignores empty cells, logical values, and text. Returns `0` if the input contains no numbers
- `count` (numeric, text, and date values) - counts non-blank cells; this is the default method assigned to every newly added field
- `countunique` (numeric and text values) - counts the number of unique values in the input
- `average` (numeric values only) - calculates the arithmetic mean of the input; ignores empty cells, logical values, and text. Includes cells with the value zero
- `counta` (numeric, text, and date values) - counts all non-blank values, including numbers, dates, and text
- `median` (numeric values only) - returns the median of the input
- `product` (numeric values only) - returns the product of all numbers in the input
- `stdev` (numeric values only) - standard deviation, treating the input as a sample of a larger set
- `stdevp` (numeric values only) - standard deviation, treating the input as the entire population
- `var` (numeric values only) - variance, treating the input as a sample of a larger set
- `varp` (numeric values only) - variance, treating the input as the entire population

The following code snippet shows the built-in method definitions:

Expand Down Expand Up @@ -572,12 +572,12 @@ const defaultPredicates = {

To add a custom predicate, configure the [`predicates`](api/config/predicates-property.md) property. Each entry pairs a predicate ID (the key) with a configuration object:

- `type` the field types this predicate accepts (`"number"`, `"date"`, `"text"`, or an array)
- `label` the predicate label shown in the GUI drop-down for a row/column
- `handler` function that transforms a value and returns the processed value
- `template` optional function that controls how the processed value is displayed
- `field` optional function that limits the predicate to specific fields
- `filter` optional filter configuration when the filter type should differ from `type`, or when the data format should differ from `template`
- `type` - the field types this predicate accepts (`"number"`, `"date"`, `"text"`, or an array)
- `label` - the predicate label shown in the GUI drop-down for a row/column
- `handler` - function that transforms a value and returns the processed value
- `template` - optional function that controls how the processed value is displayed
- `field` - optional function that limits the predicate to specific fields
- `filter` - optional filter configuration when the filter type should differ from `type`, or when the data format should differ from `template`

To use a custom predicate, set its ID as the `method` of the row or column where the predicate should apply.

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: You can explore how to start working with DHTMLX Pivot in the docum

# How to start

This clear and comprehensive tutorial will guide your through the steps you need to take in order to get a full-functional Pivot on a page.
This tutorial walks you through the steps needed to get a fully functional Pivot on a page.

![DHTMLX Pivot interface showing the Configuration panel and data table](/img/pivot-main.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: You can have an overview of DHTMLX JavaScript Pivot library in the

JavaScript Pivot library is a ready-made component for creating Pivot tables from large datasets. The widget API can be easily adjusted to the needs of your web application. It provides the end user with functionality for comparing and analyzing complex data within one table.

## Pivot structure­
## Pivot structure

The Pivot UI consists of the two main components: the Configuration panel and the table with data.

Expand Down
Loading
Loading