Skip to content

Commit 132d15a

Browse files
Merge pull request #51 from DHTMLX/next
Rewrite/clarify doc using skills
2 parents 8ee1f22 + dd31194 commit 132d15a

375 files changed

Lines changed: 33040 additions & 826 deletions

File tree

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: 6 additions & 6 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

@@ -77,6 +77,6 @@ const table = new pivot.Pivot("#root", {
7777
});
7878
~~~
7979

80-
**Related samples:**
80+
**Related samples**:
8181
- [Pivot 2. Auto width. Sizing columns to content](https://snippet.dhtmlx.com/tn1yw14m)
8282
- [Pivot 2. Set columns width](https://snippet.dhtmlx.com/ceu34kkn)

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ const table = new pivot.Pivot("#root", {
5050
});
5151
~~~
5252

53-
**Related sample:** [Pivot 2.0: Toggle visibility of configuration panel](https://snippet.dhtmlx.com/1xq1x5bo)
53+
**Related sample**: [Pivot 2.0: Toggle visibility of configuration panel](https://snippet.dhtmlx.com/1xq1x5bo)
5454

55-
**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)
55+
**Related articles**:
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: 7 additions & 7 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

112-
**Related sample:** [Pivot 2. Defining fields formats](https://snippet.dhtmlx.com/77nc4j8v)
112+
**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: 2 additions & 2 deletions
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

@@ -58,4 +58,4 @@ const table = new pivot.Pivot("#root", {
5858
});
5959
~~~
6060

61-
**Related sample:** [Pivot 2. Data limits](https://snippet.dhtmlx.com/7ryns8oe)
61+
**Related sample**: [Pivot 2. Data limits](https://snippet.dhtmlx.com/7ryns8oe)

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: 3 additions & 3 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

@@ -158,6 +158,6 @@ const table = new pivot.Pivot("#root", {
158158
});
159159
~~~
160160

161-
**Related sample:** [Pivot 2. Custom maths methods](https://snippet.dhtmlx.com/lv90d8q2)
161+
**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/readonly-property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ const table = new pivot.Pivot("#root", {
4949
});
5050
~~~
5151

52-
**Related sample:** [Pivot 2. Readonly mode](https://snippet.dhtmlx.com/0k0mvycv)
52+
**Related sample**: [Pivot 2. Readonly mode](https://snippet.dhtmlx.com/0k0mvycv)

0 commit comments

Comments
 (0)