> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/analyzer-external-javascript-api/using-pentaho-analyzer-external-javascript-api-cp/global-pentaho-analyzer-external-javascript-api.md).

# Global

The following methods and their details are global.

## Methods

| Name                                                                                    | Description                                                                                  |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `_revert()`                                                                             | Revert the width of a column.                                                                |
| `constructor(config)`                                                                   | Constructor for creating Evented object.                                                     |
| \`emit(event, eventObj) : boolean                                                       | JSON\`                                                                                       |
| `on(event, listener) : object`                                                          | Registers listeners via custom event strings which can be executed in order of registration. |
| `testAddKnownFieldKinds(report, vizModel, roleName) : analyzer.visual.ICanAddFieldInfo` | Tests the addition of each of the known field kinds to a visual role.                        |

## Methods Details

| `_revert()`                                                                                                                                                                                                                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Revert the width of a column.- <strong>Source</strong></p><p><a href="https://github.com/pentaho/pentaho-analyzer/tree/master/b/pentaho/p-analyzer/client/src/main/javascript/scripts/ResizeHandle.js#L72">javascript/scripts/ResizeHandle.js, line 72</a></p> |

| `constructor(config)`                                                                                                                                                                                                                                                                                                           |               |                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>Constructor for creating Evented object.- <strong>Source</strong></p><p><a href="https://github.com/pentaho/pentaho-analyzer/tree/master/b/pentaho/p-analyzer/client/src/main/javascript/scripts/AnalyzerEvented.js#L41">javascript/scripts/AnalyzerEvented.js, line 41</a></p><ul><li><strong>Parameters</strong></li></ul> |               |                                                                                                                                                                                                                                                                                                                    |
| Name                                                                                                                                                                                                                                                                                                                            | Default Value | Summary                                                                                                                                                                                                                                                                                                            |
| `config : JSON`                                                                                                                                                                                                                                                                                                                 |               | A JSON used for configuring the evented object.\|Name\|Default Value\|Summary\| \|----\|-------------\|-------\| \|`onPropagationStopped : function`\| \|Used to execute code once propagation has been stopped.\| \|`onListenerExecuted : function`\| \|Used to execute code when a listener has been executed.\| |

| Name            | Default Value | Summary                                                                                                                                                                                                                                                                                                            |
| --------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `config : JSON` |               | A JSON used for configuring the evented object.\|Name\|Default Value\|Summary\| \|----\|-------------\|-------\| \|`onPropagationStopped : function`\| \|Used to execute code once propagation has been stopped.\| \|`onListenerExecuted : function`\| \|Used to execute code when a listener has been executed.\| |

| `emit(event, eventObj) : boolean \| JSON`                                                                                                                                                                                                                                                                                                                                                               |               |                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------- |
| <p>Executes a sequence of registered event listeners by the custom event string.- <strong>Source</strong></p><p><a href="https://github.com/pentaho/pentaho-analyzer/tree/master/b/pentaho/p-analyzer/client/src/main/javascript/scripts/AnalyzerEvented.js#L118">javascript/scripts/AnalyzerEvented.js, line 118</a></p><ul><li><strong>Parameters</strong></li><li><strong>Returns</strong></li></ul> |               |                                                                                                      |
| Name                                                                                                                                                                                                                                                                                                                                                                                                    | Default Value | Summary                                                                                              |
| event : string                                                                                                                                                                                                                                                                                                                                                                                          |               | The custom name for event listeners being executed.                                                  |
| eventObj : JSON                                                                                                                                                                                                                                                                                                                                                                                         |               | The JSON object which has the configuration for event emitting `{ bubbles: true, cancelable: true }` |
| Name                                                                                                                                                                                                                                                                                                                                                                                                    | Description   |                                                                                                      |
| \`boolean                                                                                                                                                                                                                                                                                                                                                                                               | JSON\`        |                                                                                                      |

| Name      | Description |
| --------- | ----------- |
| \`boolean | JSON\`      |

| Name            | Default Value | Summary                                                                                              |
| --------------- | ------------- | ---------------------------------------------------------------------------------------------------- |
| event : string  |               | The custom name for event listeners being executed.                                                  |
| eventObj : JSON |               | The JSON object which has the configuration for event emitting `{ bubbles: true, cancelable: true }` |

| `on(event, listener) : object`                                                                                                                                                                                                                                                                                                                                                                                                         |                                                                                                       |                                                                     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| <p>Registers listeners via custom event strings which can be executed in order of registration.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-analyzer/tree/master/b/pentaho/p-analyzer/client/src/main/javascript/scripts/AnalyzerEvented.js#L100">javascript/scripts/AnalyzerEvented.js, line 100</a></p><ul><li><strong>Parameters</strong></li><li><strong>Returns</strong></li></ul> |                                                                                                       |                                                                     |
| Name                                                                                                                                                                                                                                                                                                                                                                                                                                   | Default Value                                                                                         | Summary                                                             |
| `event : string`                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                                                                       | The custom name for event listeners being executed.                 |
| `listener : function`                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                       | The function which is to be executed when the emit event is called. |
| Name                                                                                                                                                                                                                                                                                                                                                                                                                                   | Description                                                                                           |                                                                     |
| `object`                                                                                                                                                                                                                                                                                                                                                                                                                               | A dojo object which can be used to remove the listener from being executed by calling `obj.remove()`. |                                                                     |

| Name     | Description                                                                                           |
| -------- | ----------------------------------------------------------------------------------------------------- |
| `object` | A dojo object which can be used to remove the listener from being executed by calling `obj.remove()`. |

| Name                  | Default Value | Summary                                                             |
| --------------------- | ------------- | ------------------------------------------------------------------- |
| `event : string`      |               | The custom name for event listeners being executed.                 |
| `listener : function` |               | The function which is to be executed when the emit event is called. |

| `testAddKnownFieldKinds(report, vizModel, roleName) : analyzer.visual.ICanAddFieldInfo`                                                                                                                                                                                                                                                                                                                 |                  |                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------- |
| <p>Tests the addition of each of the known field kinds to a visual role.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-analyzer/tree/master/b/pentaho/p-analyzer/client/src/main/javascript/scripts/visual/utils.js#L94">javascript/scripts/visual/utils.js, line 94</a></p><ul><li><strong>Parameters</strong></li><li><strong>Returns</strong></li></ul> |                  |                              |
| Name                                                                                                                                                                                                                                                                                                                                                                                                    | Default Value    | Summary                      |
| `report : cv.Report`                                                                                                                                                                                                                                                                                                                                                                                    |                  | The Analyzer report.         |
| `vizModel : pentaho.visual.base.AbstractModel`                                                                                                                                                                                                                                                                                                                                                          |                  | The visualization model.     |
| `roleName : string`                                                                                                                                                                                                                                                                                                                                                                                     |                  | The name of the visual role. |
| Name                                                                                                                                                                                                                                                                                                                                                                                                    | Description      |                              |
| `analyzer.visual.ICanAddFieldInfo`                                                                                                                                                                                                                                                                                                                                                                      | The test result. |                              |

| Name                               | Description      |
| ---------------------------------- | ---------------- |
| `analyzer.visual.ICanAddFieldInfo` | The test result. |

| Name                                           | Default Value | Summary                      |
| ---------------------------------------------- | ------------- | ---------------------------- |
| `report : cv.Report`                           |               | The Analyzer report.         |
| `vizModel : pentaho.visual.base.AbstractModel` |               | The visualization model.     |
| `roleName : string`                            |               | The name of the visual role. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/analyzer-external-javascript-api/using-pentaho-analyzer-external-javascript-api-cp/global-pentaho-analyzer-external-javascript-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
