Skip to content

Commit

Permalink
[update] how-to-start, index, methods, internal methods updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tbshag2 committed Jun 28, 2024
1 parent c5719cc commit 4610e00
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 24 deletions.
4 changes: 2 additions & 2 deletions docs/api/internal/detach-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: You can learn about the detach method in the documentation of the D

## Description

Allows removing/detaching action handlers
@short: Allows removing/detaching action handlers

## Usage

Expand All @@ -22,7 +22,7 @@ api.detach(tag: number | string ): void;

### Example

In the example below we add an object with the **tag** property to the [`api.on()`](/api/internal/on-method) handler, and then we use the `api.detach()` method to stop logging the `open-filter` action.
In the example below we add an object with the **tag** property to the [`api.on()`](/api/internal/on-method) handler, and then we use the `api.detach()` method to stop logging the [`open-filter`](/api/events/open-filter-event) action.

~~~jsx {}
//create Pivot
Expand Down
2 changes: 1 addition & 1 deletion docs/api/internal/exec-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The full list of Pivot actions can be found [**here**](/api/overview/events_over

## Example

In the example below, the `delete-field` action is triggered via the [`api.exec()`](/api/methods/exec) method. The last field is removed from the **values** area. The [`api.getState()`](/api/methods/getState) method here is used to get the current state of the Pivot [`config`](/api/properties/config). The action will be triggered with the button click.
In the example below, the [`delete-field`](/api/events/delete-field-event) event is triggered via the [`api.exec()`](/api/methods/exec) method. The last field is removed from the **values** area. The [`api.getState()`](/api/internal/getstate-method) method here is used to get the current state of the Pivot [`config`](/api/config/config-property). The event will be triggered with the button click.

TBD!!!

Expand Down
12 changes: 8 additions & 4 deletions docs/api/internal/intercept-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ api.intercept(
### Events

:::info
The full list of the Pivot internal events can be found [**here**](api/overview/main_overview.md/#pivot-events).
Use the `api.on()` method if you want to listen to the actions without modifying them. To make changes to the actions, apply the `api.intercept()` method.
The full list of the Pivot internal events can be found [**here**](api/overview/main-overview.md/#pivot-events).
Use the [`api.on()`](/api/internal/on-method) method if you want to listen to the actions without modifying them. To make changes to the actions, apply the `api.intercept()` method.
:::

### Example

The example shows how to make all collapsible rows close at the initialization.

~~~jsx
// create Pivot
consttable = new pivot.Pivot("#root", {
const table = new pivot.Pivot("#root", {
fields,
data: dataset,
config: {
Expand All @@ -54,8 +56,10 @@ consttable = new pivot.Pivot("#root", {
},
});

//make all rows closed at the initialization
//make all rows close at the initialization
table.api.intercept("render-table", (ev) => {
ev.config.data.forEach((row) => (row.open = false));
})
~~~

**Related articles**: [`render-table`](/api/events/render-table-event)
4 changes: 2 additions & 2 deletions docs/api/internal/on-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ api.on(

:::info
The full list of the Pivot internal events can be found [**here**](api/overview/main_overview.md/#pivot-events).
Use the `api.on()` method if you want to listen to the actions without modifying them. To make changes to the actions, apply the `api.intercept()` method.
Use the `api.on()` method if you want to listen to the actions without modifying them. To make changes to the actions, apply the [`api.intercept()`](/api/internal/on-method) method.
:::

### Example

The example below shows how to output the label of a filed for which filter was activated:
The example below shows how to output the label of a field for which the filter was activated:

~~~jsx
// create Pivot
Expand Down
8 changes: 4 additions & 4 deletions docs/api/methods/gettable-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ description: You can learn about the getTable method in the documentation of the

### Description

@short: Gets access to the underlying DataGrid widget instance in the Pivot
@short: Gets access to the underlying DataGrid widget instance in the Pivot table

This method is used when there's a need to access the underlying DataGrid widget instance in the Pivot. It provides direct access to all DataGrid functionality ([DataGrid API](https://docs.svar.dev/svelte/grid/api/overview/api_overview)), allowing for operations such as data serialization and exporting in various formats.
This method is used when there's a need to access the underlying DataGrid widget instance in Pivot. It provides direct access to all DataGrid functionality (link to dhtml DataGrid-????), allowing for operations such as data serialization and exporting in various formats.

### Usage

Expand All @@ -21,11 +21,11 @@ getTable(wait:boolean): Table | Promise;

### Parameters

`wait` - defines to wait until DataGrid API is available in Pivot (necessary when DataGrid API is used during with Pivot initialization). If the value is set to **true**, the method returns a promise with DataGrid API.
`wait` - defines if to wait until DataGrid API is available in Pivot (necessary when DataGrid API is used during Pivot initialization). If the value is set to **true**, the method returns a promise with DataGrid API.

### Example

In the example below we get access to the DataGrid widget API and trigger the [`export`](https://docs.svar.dev/svelte/grid/api/actions/export) action with the button click using the [`api.exe()`](/api/methods/exec) method.
In the example below we get access to the DataGrid widget API and trigger the DataGrid `export`event with the button click using the [`api.exe()`](/api/internal/exec-method) method.

~~~jsx {}
// create Pivot
Expand Down
4 changes: 2 additions & 2 deletions docs/api/methods/showconfigpanel-method.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: You can learn about the showConfigPanel() method in the documentati

@short: Shows or hides the Configuration panel

This TypeScript method can be useful when there's a need to control the visibility of the configuration panel without user interaction. For instance, you might want to hide or display the panel based on some other interaction or state in your application.
This TypeScript method can be useful when there's a need to control the visibility of the Configuration panel without user interaction. For instance, you might want to hide or display the panel based on some other interaction or state in your application.


### Usage
Expand All @@ -21,7 +21,7 @@ showConfigPanel({mode: boolean}): void;

### Parameters

- `mode` (boolean) - (required) if the value is set to **true** (default), the configuration panel is shown, and set to **false** when the Configuration panel is hidden
- `mode` (boolean) - (required) if the value is set to **true** (default), the Configuration panel is shown, and set to **false** when the Configuration panel is hidden

### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/api/overview/internal-eventbus-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: You can have an Internal Event Bus methods overview of JavaScript P

| Name | Description |
| ---------------------------------------------- | ------------------------------------------------- |
| [](../internal/detach-method.md) | @getshort(../internal/detach-methos.md) |
| [](../internal/detach-method.md) | @getshort(../internal/detach-method.md) |
| [](../internal/exec-method.md) | @getshort(../internal/exec-method.md) |
| [](../internal/intercept-method.md) | @getshort(../internal/intercept-method.md) |
| [](../internal/on-method.md) | @getshort(../internal/on-method.md) |
Expand Down
2 changes: 1 addition & 1 deletion docs/api/overview/main-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ new pivot.Pivot("#root", {

| Name | Description |
| :------------------------------------ | :------------------------------------------- |
| [](../internal/detach-method.md) | @getshort(../internal/detach-methos.md) |
| [](../internal/detach-method.md) | @getshort(../internal/detach-method.md) |
| [](../internal/exec-method.md) | @getshort(../internal/exec-method.md) |
| [](../internal/intercept-method.md) | @getshort(../internal/intercept-method.md) |
| [](../internal/on-method.md) | @getshort(../internal/on-method.md) |
Expand Down
4 changes: 3 additions & 1 deletion docs/how-to-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ The **fields** array is necessary to define the fields IDs, labels for display,

The **data** array should hold the actual data that is displayed in the Pivot widget. Each object in the array represents a row in the table.

The **config** object defines the structure of the Pivot table, namely, which fields will be applied as rows and columns of the table and which data aggregation methods should be applied to the fields.

~~~jsx {}
const table = new pivot.Pivot("#root", {
//configuration properties
Expand All @@ -112,7 +114,7 @@ config: {

## What's next

That's all. Just three simple steps and you have a handy tool for visualizing and managing the workflow. Now you can start working with your tasks or keep exploring the inner world of JavaScript Pivot:
That's all. Just three simple steps and you have a handy tool for analyzing data. Now you can start working with your tasks or keep exploring the inner world of JavaScript Pivot:

- [Guides](/category/guides) pages provide instructions about installation, loading data, styling, and other helpful tips to go smoothly with the Pivot configuration
- [API reference](/api/overview/main-overview) gives description of the Pivot functionality
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ In the **Values** area you can define which aggregation methods (such as min, ma
- add and remove fields to/from the values area
- change the order and priority of values in the table
- filter data
- set operations that will be applied to all data in the value column of the table
- set operations that will be applied to the fields of the table

To add a new value, click the "+" button and select the required name from the drop-down list. A new value will appear in the table cells.

To remove a value, click the delete button ("x").

![add_remove](assets/add_remove.png)

To change the order of values in the table, drag an item to the desired position. The closer the value is to the left in the toolbar values list, the higher its priority and position in the table columns. The values with the highest priority are in the leftmost position in the column they belong to. The **Count** field in the image below has the highest priority:
To change the order of values in the table, drag an item to the desired position. The closer the value is to the left in the toolbar values list, the higher its priority and position in the table columns. The values with the highest priority are in the leftmost position in the column they belong to. The field with the **Count** value in the image below has the highest priority:

![priority](assets/priority.png)

To set operations that will be applied to all data in the value column of the table, click the value operations in the drop-down list, and select the required option from the list.
To set operations that will be applied to all data of the column of the table, click the value operations for the required field in the drop-down list, and select the required option from the list.

![operations](assets/operations.png)

Expand Down Expand Up @@ -76,7 +76,7 @@ In the Configuration panel for the **Rows** area, you can perform the following
- change the order and priority of rows in the table
- filter data

To add a new row, click the "+" button and select the required name from the drop-down list. A new row name will appear as a label of the first table columns.
To add a new row, click the "+" button and select the required name from the drop-down list. A new row name will appear as a label of the first table column.

![rows](assets/rows.png)

Expand All @@ -96,7 +96,7 @@ Filters appear as drop-down lists for each field in all areas:
The Pivot provides the next condition types for filtering:

- for text values: equal, notEqual, contains, notContains, beginsWith, notBeginsWith, endsWith, notEndsWith
- for numeric values: greater: less, greaterOrEqual, lessOrEqual, equal, notEqual, contains, notContains
- for numeric values: greater: less, greaterOrEqual, lessOrEqual, equal, notEqual, contains, notContains, begins with, not begins with, ends with, not ends with
- for date types: greater, less, greaterOrEqual, lessOrEqual, equal, notEqual, between, notBetween

To filter data in the table, click the filter sign of one of the items in the required area, and then select the operator and set the value to filter by, and then click **Apply**.
Expand Down
2 changes: 1 addition & 1 deletion docs/news/whats_new.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Released on Month Day, 2024

### Initial functionality

- **Configuring table structure**:
- **Configuring the table structure**:
- defining rows, columns, and values by applying the **config** property
- adding, deleting, reordering fields
- updating the current config
Expand Down

0 comments on commit 4610e00

Please sign in to comment.