Skip to content

Commit d09cf17

Browse files
[update] grammar pass on API reference and guides
- grammar and wording fixes across API config/events/methods/table/internal docs - guides and news pages polished for clarity - rename update-value event to update-field (page and references) - restore heading anchors in guides broken by renamed headings
1 parent 0eaf2eb commit d09cf17

57 files changed

Lines changed: 362 additions & 361 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/api/config/columnshape-property.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ columnShape?: {
1919
[field: string]: number
2020
},
2121
autoWidth?: {
22-
columns?: {
22+
columns: {
2323
[field: string]: boolean
2424
},
25-
auto: boolean | "header" | "data",
25+
auto?: boolean | "header" | "data",
2626
maxRows?: number,
2727
firstOnly?: boolean
2828
}
@@ -34,9 +34,9 @@ columnShape?: {
3434
- `sort` - (optional) if **true** (default), the sorting is enabled in UI by clicking the column header; if **false**, the sorting is disabled
3535
- `width` - (optional) defines the width of a column; it's an object where each key is a field id and the value is the width of the column in pixels
3636
- `autoWidth` - (optional) an object that defines how column width should be calculated automatically. The default configuration uses 20 rows, and the width is calculated based on the header and data, with each field analyzed only once. The object parameters are the following:
37-
- `columns` - (optional) an object where each key is a field id and the boolean value defines whether column width should be calculated automatically
38-
- `auto` - (required) if set to **header**, adjusts the width to the header text; if set to **data**, adjusts the width to the cell with the widest content; if set to **true**, the width is adjusted to the content of both headers and cell.
39-
If autowidth is set to **false**, the `width` value is set or the value of the `columnWidth` from the [`tableShape`](/api/config/tableshape-property) property is applied.
37+
- `columns` - (required) an object where each key is a field id and the boolean value defines whether column width should be calculated automatically
38+
- `auto` - (optional) if set to **header**, adjusts the width to the header text; if set to **data**, adjusts the width to the cell with the widest content; if set to **true**, the width is adjusted to the content of both headers and cell.
39+
If autowidth is set to **false**, the `width` value is set or the value of the `columnWidth` from the [`tableShape`](api/config/tableshape-property.md) property is applied.
4040
- `maxRows` - (optional) the number of rows to be processed for the autoWidth calculation
4141
- `firstOnly` - (optional) if set to **true** (default), each field of the same data is analyzed only once to calculate the column width; in case of multiple columns based on the same data (e.g., the *oil* field with the *count* operation and the *oil* field with the *sum* operation), only data in the first one will be analyzed and the others will inherit this width
4242

docs/api/config/config-property.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ The `config` parameters are used to define which fields will be applied as rows
2727

2828
- `rows` - (optional) defines the rows of the Pivot table. The default value is an empty array. It can be a string which represents a single field ID or an object with the field ID and a method for data extraction; the object parameters are the following:
2929
- `field` - (required) the ID of a field
30-
- `method` - (optional) defines a method for data aggregation in the field; methods for the time-based data fields are available by default: year, month, day, hour, minute which group data by year/month/day/hour; here you can also add the name of a custom method ([see `predicates`](/api/config/predicates-property)) for the field of any data type
30+
- `method` - (optional) defines a method for data aggregation in the field; methods for the time-based data fields are available by default: "year", "quarter", "month", "week", "day", "hour", "minute" which group data accordingly; here you can also add the name of a custom method ([see `predicates`](api/config/predicates-property.md)) for the field of any data type
3131
- `columns` - (optional) defines columns for the Pivot table. It's an empty array by default. It can be a single field ID or an object with the field ID and a method for data extraction; the object parameters are the following:
3232
- `field` - (required) the ID of a field
3333
- `method` - (optional) defines a method for data processing (for time-based data fields).
34-
By default, methods are available for the time-based fields (the **date** type) with the next values: "year", "quarter", "month", "week", "day", "hour", "minute". Here you can also add the name of a custom method ([see `predicates`](/api/config/predicates-property)) for the field of any data type
34+
By default, methods are available for the time-based fields (the **date** type) with the next values: "year", "quarter", "month", "week", "day", "hour", "minute". Here you can also add the name of a custom method ([see `predicates`](api/config/predicates-property.md)) for the field of any data type
3535
- `values` - (optional) defines the data aggregation for the cells of the Pivot table. It's an empty array by default. Each element can be a string representing a data field ID and aggregation method or an object containing the field ID and the method for data aggregation. The object parameters are the following:
3636
- `field` - (required) the ID of a field
37-
- `method` - (required) defines a method for data extraction; for methods types and their description refer to [Applying methods](/guides/working-with-data#default-methods)
37+
- `method` - (required) defines a method for data extraction; for methods types and their description refer to [Applying methods](guides/working-with-data.md#default-methods)
3838

3939
<details>
4040

@@ -49,7 +49,7 @@ You can define `values` in either of the two equally valid ways:
4949
~~~jsx
5050
values: [
5151
"sum(sales)", // option one
52-
{ id: "sales", method: "sum" }, // option two
52+
{ field: "sales", method: "sum" }, // option two
5353
]
5454
~~~
5555

@@ -78,7 +78,7 @@ values: [
7878
- `includes` - (optional) an array of values to be displayed from those that are already filtered; available for text and dates values
7979

8080
:::info
81-
When config is processed by Pivot, its properties receive extra data and if you try to return the config state via the [`api.getState()`](/api/internal/getstate-method) method, the full object will look like this:
81+
When config is processed by Pivot, its properties receive extra data and if you try to return the config state via the [`api.getState()`](api/internal/getstate-method.md) method, the full object will look like this:
8282

8383
~~~jsx
8484
interface IParsedField {

docs/api/config/configpanel-property.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ const table = new pivot.Pivot("#root", {
5353
**Related sample:** [Pivot 2.0: Toggle visibility of configuration panel](https://snippet.dhtmlx.com/1xq1x5bo)
5454

5555
**Related articles:**
56-
- [`show-config-panel` event](/api/events/show-config-panel-event)
57-
- [`showConfigPanel()` method](/api/methods/showconfigpanel-method)
58-
- [Controlling visibility of Configuration panel](/guides/configuration#controlling-visibility-of-configuration-panel)
56+
- [`show-config-panel` event](api/events/show-config-panel-event.md)
57+
- [`showConfigPanel()` method](api/methods/showconfigpanel-method.md)
58+
- [Controlling visibility of Configuration panel](guides/configuration.md#controlling-visibility-of-configuration-panel)

docs/api/config/fields-property.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ Each object in the `fields` array should have the following properties:
3232

3333
- `id` - (required) the ID of a field
3434
- `label` - (optional) the field label to be displayed in GUI
35-
- `type` - (required) data type in a field ( "number", "date", or "string")
35+
- `type` - (required) data type in a field ( "number", "date", or "text")
3636
- `sort` - (optional) defines the default sorting order for the field. Accepts "asc", "desc", or a custom sorting function
37-
- `format` - (optional) allows customizing the format of numbers and dates in a field; the format will be also applied during [export](/guides/exporting-data)
37+
- `format` - (optional) allows customizing the format of numbers and dates in a field; the format will be also applied during [export](guides/exporting-data.md)
3838
- `string` - (optional) the format for dates (by default, Pivot uses `dateFormat` from locale)
3939
- `boolean` - (optional) if set to **false**, a number is displayed as is, without any formatting
4040
- `numberFormatOptions` - (optional) an object with options for formatting numeric fields; by default, numbers will be shown with a maximum of 3 decimal digits and group separation for the integer part is applied.
4141
- `minimumIntegerDigits`(number) - (optional) the minimum number of integer (for example, if the value is set to 2, the number 1 will be shown as "01"); the default is 1;
42-
- `minimumFractionDigits`(number) - (optional) the minimum number of fraction digits to use (for example, if the value is set to 2, the number 10.5 will be shown as "10.50"); the default is 1;
42+
- `minimumFractionDigits`(number) - (optional) the minimum number of fraction digits to use (for example, if the value is set to 2, the number 10.5 will be shown as "10.50"); the default is 0;
4343
- `maximumFractionDigits`(number) - (optional) the maximum number of fraction digits to use (for example, if the value is set to 2, the number 10.3333... will be shown as "10.33"); the default is 3;
4444
For more details about digit options refer to [Digit options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumintegerdigits)
4545
- `prefix` (string) - (optional) a string (before a number) for additional symbols like currency
4646
- `suffix` (string) - (optional) a string (after a number) for additional symbols like currency
4747

4848
:::info
49-
If a template is applied via the [`tableShape`](/api/config/tableshape-property) property, it will override the `format` settings.
49+
If a template is applied via the [`tableShape`](api/config/tableshape-property.md) property, it will override the `format` settings.
5050
:::
5151

5252
### Example
@@ -106,7 +106,7 @@ const table = new pivot.Pivot("#root", {
106106

107107
**Related articles**:
108108

109-
- [Number formatting](/guides/localization/#number-formatting)
110-
- [Applying formats to fields](/guides/working-with-data/#applying-formats-to-fields)
109+
- [Number formatting](guides/localization.md#number-formatting)
110+
- [Applying formats to fields](guides/working-with-data.md#applying-formats-to-fields)
111111

112112
**Related sample:** [Pivot 2. Defining fields formats](https://snippet.dhtmlx.com/77nc4j8v)

docs/api/config/headershape-property.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ new pivot.Pivot("#pivot", {
7676
**Related samples**:
7777
- [Pivot 2. Vertical orientation of text in grid headers](https://snippet.dhtmlx.com/4qroi8ka)
7878
- [Pivot 2. Collapsible columns](https://snippet.dhtmlx.com/pt2ljmcm)
79-
- [Pivot 2. Adding сustom CSS for table and header cells](https://snippet.dhtmlx.com/nfdcs4i2)
79+
- [Pivot 2. Adding custom CSS for table and header cells](https://snippet.dhtmlx.com/nfdcs4i2)
8080

8181
**Related articles**:
82-
- [Configuration](/guides/configuration)
83-
- [Cell style](/guides/stylization/#cell-style)
82+
- [Configuration](guides/configuration.md)
83+
- [Cell style](guides/stylization.md#cell-style)

docs/api/config/limits-property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: You can learn about the limits config in the documentation of the D
1010

1111
@short: Optional. Defines the maximum limit for the number of rows and columns in the final dataset
1212

13-
Please, also refer to [Limiting data](/guides/working-with-data#limiting-loaded-data).
13+
Please, also refer to [Limiting data](guides/working-with-data.md#limiting-loaded-data).
1414

1515
### Usage
1616

docs/api/config/locale-property.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ locale?: object;
1818

1919
### Default config
2020

21-
By default, Pivot uses the [English](/guides/localization/#default-locale) locale. You can set it to the custom locale as well.
21+
By default, Pivot uses the [English](guides/localization.md#default-locale) locale. You can set it to the custom locale as well.
2222

2323
:::tip
24-
To change the current locale dynamically, you can use the [`setLocale()`](/api/methods/setlocale-method) method of Pivot
24+
To change the current locale dynamically, you can use the [`setLocale()`](api/methods/setlocale-method.md) method of Pivot
2525
:::
2626

2727
### Example

docs/api/config/methods-property.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defaultMethods = {
6868
};
6969
~~~
7070

71-
The definition of each method you can see here: [Applying methods](/guides/working-with-data#default-methods)
71+
The definition of each method you can see here: [Applying methods](guides/working-with-data.md#default-methods)
7272

7373
## Example
7474

@@ -160,4 +160,4 @@ const table = new pivot.Pivot("#root", {
160160

161161
**Related sample:** [Pivot 2. Custom maths methods](https://snippet.dhtmlx.com/lv90d8q2)
162162

163-
**Related article**: [Applying maths methods](/guides/working-with-data#applying-maths-methods)
163+
**Related article**: [Applying maths methods](guides/working-with-data.md#applying-maths-methods)

docs/api/config/predicates-property.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ The property is an object where a key is the name of a custom function and value
4141
- `type` - (optional) defines which field type will be applied: "number"|"text"|"date"|"tuple". "tuple" is a combo filter applied for numeric values (data will be filtered by the numeric value but in filter the text value will be displayed)
4242
- `format` - (optional) the function that defines the format for displaying filter options; if no format is defined, the one from the template parameter will be applied; if the type here (for the `filter` object) is not specified, the format will be applied for the type set for the `type` parameter of the predicate
4343
- `handler` - (required for custom predicates) the function that defines how data should be processed; the function should take a single argument as the value to be processed and return the processed value
44-
- `template` - (optional) the function that defines how data should be displayed; the function returns the processed value and it takes the value returned by `handler` and if necessary you can localize text values using [`locale`](/api/config/locale-property).
44+
- `template` - (optional) the function that defines how data should be displayed; the function returns the processed value and it takes the value returned by `handler` and if necessary you can localize text values using [`locale`](api/config/locale-property.md).
4545

4646
The following default predicates are applied in case no predicate is specified via the `predicates` property:
4747

4848
~~~jsx
4949
const defaultPredicates = {
50+
// a service predicate that represents the raw (unprocessed) value
51+
$empty: { label: (type) => `Raw ${type}`, type: ["number", "date", "text"] },
5052
year: { label: "Year", type: "date", filter: { type: "number" } },
5153
quarter: { label: "Quarter", type: "date", filter: { type: "tuple" } },
5254
month: { label: "Month", type: "date", filter: { type: "tuple" } },
@@ -110,6 +112,6 @@ const table = new pivot.Pivot("#pivot", {
110112
});
111113
~~~
112114

113-
**Related article**: [Processing data with predicates](/guides/working-with-data#processing-data-with-predicates)
115+
**Related article**: [Processing data with predicates](guides/working-with-data.md#processing-data-with-predicates)
114116

115117
**Related sample**: [Pivot 2. Custom predicates](https://snippet.dhtmlx.com/mhymus00)

docs/api/config/tableshape-property.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ tableShape?: {
5454
- `templates` - (optional) allows setting templates to a cell; it's an object where:
5555
- each key is a field id
5656
- the value is a function that returns a string and receives cell value and operation. All columns based on the specified field will have the related template applied. For example, it allows setting the units of measurement or returning the required number of digits after the decimal point for numeric values, etc. See the example below.
57-
- `marks` - (optional) allows marking a cell with the required values. It's an object where keys are CSS class names and values are either a function or one of the predefined strings ("max", "min"). The function should return boolean for the checked value. If **true** is returned, the css class is assigned to the cell. More information with examples see here [Marking cells](/guides/stylization#cell-style).
57+
- `marks` - (optional) allows marking a cell with the required values. It's an object where keys are CSS class names and values are either a function or one of the predefined strings ("max", "min"). The function should return boolean for the checked value. If **true** is returned, the css class is assigned to the cell. More information with examples see here [Marking cells](guides/stylization.md#cell-style).
5858
- `sizes` - (optional) defines the following size parameters of the table:
5959
- `rowHeight` - (optional) the row height in the Pivot table in pixels. The default value is 34
6060
- `headerHeight` - (optional) the header height in pixels; the default value is 30
@@ -67,12 +67,12 @@ tableShape?: {
6767
- `method` - (optional) a string that can represent the operation performed on a cell (e.g., "sum", "count", etc.)
6868
- `isTotal` - (optional) defines whether a cell belongs to a total row, total column, or both: "row"|"column"|"both
6969
The `cellStyle` function returns a string, which can be used as a CSS class name to apply specific styles to a cell.
70-
- `tree` - (optional) if set to **true**, enables the tree mode when data can be presented with expandable rows, the default value is **false**. More information with examples see here [Switching to the tree mode](/guides/configuration/#enabling-the-tree-mode)
70+
- `tree` - (optional) if set to **true**, enables the tree mode when data can be presented with expandable rows, the default value is **false**. More information with examples see here [Switching to the tree mode](guides/configuration.md#enabling-the-tree-mode)
7171
- `totalColumn` - (optional) if **true**, enables generating the total column with total values for rows (**false** is set by default). If the value is set to "sumOnly", the column with the total sum value will be generated (available only for sum operations)
7272
- `totalRow` - (optional) if **true**, enables generating the footer with total values (**false** is set by default). If the value is set to "sumOnly", the row with the total row value will be generated (available only for sum operations)
7373
- `cleanRows` - (optional) if set to **true**, the duplicate values in scale columns are hidden in the table view. The default value is **false**
74-
- `split` - (optional) allows freezing columns on the right or left depending on the parameter specified (refer to [Freezing columns](/guides/configuration/#freezing-columns)):
75-
- `left` (boolean) - if set to **true** (**false** is set by default), fixes the columns from the left, which makes columns static and visible while scrolling. The number of columns that are split is equal to the number of the rows fields that are defined in the [`config`](/api/config/config-property) property
74+
- `split` - (optional) allows freezing columns on the right or left depending on the parameter specified (refer to [Freezing columns](guides/configuration.md#freezing-columns)):
75+
- `left` (boolean) - if set to **true** (**false** is set by default), fixes the columns from the left, which makes columns static and visible while scrolling. The number of columns that are split is equal to the number of the rows fields that are defined in the [`config`](api/config/config-property.md) property
7676
- `right` (boolean) - fixes total columns on the right; default value is **false**
7777

7878
By default, `tableShape` is undefined, implying that no total row, no total column is present, no templates and marks are applied, the data is shown as a table and not a tree, and columns are not fixed during scroll.
@@ -124,8 +124,8 @@ const table = new pivot.Pivot("#root", {
124124
- [Pivot 2. Frozen (fixed) columns](https://snippet.dhtmlx.com/lahf729o)
125125
- [Pivot 2. Set row, header, footer height and all columns width](https://snippet.dhtmlx.com/x46uyfy9)
126126
- [Pivot 2. Clean rows](https://snippet.dhtmlx.com/rwwhgv2w?tag=pivot)
127-
- [Pivot 2. Adding сustom CSS for table and header cells](https://snippet.dhtmlx.com/nfdcs4i2)
127+
- [Pivot 2. Adding custom CSS for table and header cells](https://snippet.dhtmlx.com/nfdcs4i2)
128128

129129
**Related articles**:
130-
- [Configuration](/guides/configuration)
131-
- [Cell style](/guides/stylization/#cell-style)
130+
- [Configuration](guides/configuration.md)
131+
- [Cell style](guides/stylization.md#cell-style)

0 commit comments

Comments
 (0)