# Analyzer Module API Reference

The `AnalyzerModule` contains the following Contructor and Methods.

## Constructor

| Name                         | Description                                                                                                                                                                                          |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `new AnalyzerModule()`Static | This module allows for deploying and controlling Analyzer in a DOM element. A global collection is maintained for each `AnalyzerModule` which is initialized, available at `window.analyzerModules`. |

\## Methods

| Name                                | Description                                                                                                                                                                 |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `constructor(options)`              | Creates an iframe child of the provided parent element. Also, it generates a URL query string based on the provided module options, plus catalog and cube, or `reportPath`. |
| `dispose()`                         | Removes the iframe and releases all of its resources.                                                                                                                       |
| `getApi()`                          | Returns the reference to the Analyzer API for the loaded object. This method is not safe to use until the `onAnalyzerReady` function has been called.                       |
| `getOptions()`                      | Returns the options used to render.                                                                                                                                         |
| `getParentElement()`                | Returns the parent element of the iframe.                                                                                                                                   |
| `getUrl()`                          | Returns the URL generated for the iframe.                                                                                                                                   |
| `hide()`                            | Hides the Analyzer module when it is visible.                                                                                                                               |
| `reset()`                           | Resets the state of the report back to the most recently saved state.                                                                                                       |
| `show()`                            | Shows the Analyzer module when it has been hidden via the `hide()` method.                                                                                                  |
| `validateParams(options) : boolean` | Validates the required parameters for the Analyzer module.                                                                                                                  |

## Constructor Details

| `new AnalyzerModule()`Static                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>This module allows for deploying and controlling Analyzer in a DOM element. A global collection is maintained for each <code>AnalyzerModule</code> which is initialized, available at <code>window\.analyzerModules</code>- <strong>Source</strong></p><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L197">javascript/web/util/AnalyzerModule.js, line 197</a></p><p>.</p> |

\## Methods Details

<table data-header-hidden><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><code>constructor(options)</code></td><td></td><td></td></tr><tr><td><p>Creates an iframe child of the provided parent element. Also, it generates a URL query string based on the provided module options, plus catalog and cube, or <code>reportPath</code>.Other options include required parameters, as well as parameters which are provided by the API.</p><p>The Analyzer Module will fill the height and width to 100% of the parent container.</p><p>The <code>reportPath</code> option parameter is the repository path to the existing Analyzer report to be opened. If <code>reportPath</code> is not present, then catalog and cube must have values to create a new Analyzer report. If all three option parameters are present, then <code>reportPath</code> takes precedence and the module will attempt to open an existing report located at the path indicated. If <code>reportPath</code> is not present, and catalog and cube are also not present, an error will occur.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L205">javascript/web/util/AnalyzerModule.js, line 205</a></p><ul><li><strong>Parameters</strong></li></ul><p>- **Example**</p><pre><code>```javascript
</code></pre><p>var options = { "url" : "http://localhost:8080/pentaho", "parentElement" : "parentElementId", "catalog" : "http://localhost:1234/path/to/model", "cube" : "ExampleCube", "dataSource" : "DataServiceName" "mode" : "editor", "disableFilterPanel" : "true", "removeFieldLayout" : "true", "removeFieldList" : "true", "removeHeaderBar" : "true", "removeMainToolbar" : "true", "removeRedoButton" : "true" }</p><pre><code>```
</code></pre></td><td></td><td></td></tr><tr><td>Name</td><td>Default Value</td><td>Summary</td></tr><tr><td><code>options : Object</code></td><td></td><td>An object with properties which correspond to the available JavaScript API functions, as well as some required properties indicated below.</td></tr><tr><td>Name</td><td>Default Value</td><td>Summary</td></tr><tr><td><code>url : string</code></td><td></td><td>The URL which points to the root of the Hitachi Vantara web application <a href="http://localhost:8080/pentaho">http://localhost:8080/pentaho</a></td></tr><tr><td>`parentElement : string</td><td>Object`</td><td></td></tr><tr><td><code>catalog : string</code></td><td></td><td>The catalog to use when creating a new Analyzer report.</td></tr><tr><td><code>cube : string</code></td><td></td><td>The cube to use when creating a new Analyzer report.</td></tr><tr><td><code>dataSource : string</code></td><td></td><td>(Optional) The name of a data service that supplies data for the report. Use this in conjunction with a url value for that "catalog" parameter that supplies the mondrian model.</td></tr><tr><td><code>reportPath : string</code></td><td></td><td>The path which points to an existing Analyzer report to open.</td></tr><tr><td><code>mode : string</code></td><td></td><td>Mode in which to open Analyzer. Valid options are: viewer, editor. Defaults to viewer.</td></tr><tr><td><code>onAnalyzerReady : function</code></td><td></td><td>Callback function to execute once Analyzer has finished initializing</td></tr><tr><td><code>useLegacyPath : string</code></td><td></td><td>Indicates the decision to use the legacy url path structure when creating a new analyzer report: when "true" --> 'content/analyzer/' when "false" --> 'api/repos/xanalyzer/' This has no impact on the url path for opening existing reports, those will all be /api/repos/...</td></tr></tbody></table>

| Name                         | Default Value | Summary                                                                                                                                                                                                                                                                        |
| ---------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `url : string`               |               | The URL which points to the root of the Hitachi Vantara web application <http://localhost:8080/pentaho>                                                                                                                                                                        |
| \`parentElement : string     | Object\`      |                                                                                                                                                                                                                                                                                |
| `catalog : string`           |               | The catalog to use when creating a new Analyzer report.                                                                                                                                                                                                                        |
| `cube : string`              |               | The cube to use when creating a new Analyzer report.                                                                                                                                                                                                                           |
| `dataSource : string`        |               | (Optional) The name of a data service that supplies data for the report. Use this in conjunction with a url value for that "catalog" parameter that supplies the mondrian model.                                                                                               |
| `reportPath : string`        |               | The path which points to an existing Analyzer report to open.                                                                                                                                                                                                                  |
| `mode : string`              |               | Mode in which to open Analyzer. Valid options are: viewer, editor. Defaults to viewer.                                                                                                                                                                                         |
| `onAnalyzerReady : function` |               | Callback function to execute once Analyzer has finished initializing                                                                                                                                                                                                           |
| `useLegacyPath : string`     |               | Indicates the decision to use the legacy url path structure when creating a new analyzer report: when "true" --> 'content/analyzer/' when "false" --> 'api/repos/xanalyzer/' This has no impact on the url path for opening existing reports, those will all be /api/repos/... |

| Name                         | Default Value | Summary                                                                                                                                                                                                                                                                        |
| ---------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options : Object`           |               | An object with properties which correspond to the available JavaScript API functions, as well as some required properties indicated below.                                                                                                                                     |
| Name                         | Default Value | Summary                                                                                                                                                                                                                                                                        |
| `url : string`               |               | The URL which points to the root of the Hitachi Vantara web application <http://localhost:8080/pentaho>                                                                                                                                                                        |
| \`parentElement : string     | Object\`      |                                                                                                                                                                                                                                                                                |
| `catalog : string`           |               | The catalog to use when creating a new Analyzer report.                                                                                                                                                                                                                        |
| `cube : string`              |               | The cube to use when creating a new Analyzer report.                                                                                                                                                                                                                           |
| `dataSource : string`        |               | (Optional) The name of a data service that supplies data for the report. Use this in conjunction with a url value for that "catalog" parameter that supplies the mondrian model.                                                                                               |
| `reportPath : string`        |               | The path which points to an existing Analyzer report to open.                                                                                                                                                                                                                  |
| `mode : string`              |               | Mode in which to open Analyzer. Valid options are: viewer, editor. Defaults to viewer.                                                                                                                                                                                         |
| `onAnalyzerReady : function` |               | Callback function to execute once Analyzer has finished initializing                                                                                                                                                                                                           |
| `useLegacyPath : string`     |               | Indicates the decision to use the legacy url path structure when creating a new analyzer report: when "true" --> 'content/analyzer/' when "false" --> 'api/repos/xanalyzer/' This has no impact on the url path for opening existing reports, those will all be /api/repos/... |

| Name                         | Default Value | Summary                                                                                                                                                                                                                                                                        |
| ---------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `url : string`               |               | The URL which points to the root of the Hitachi Vantara web application <http://localhost:8080/pentaho>                                                                                                                                                                        |
| \`parentElement : string     | Object\`      |                                                                                                                                                                                                                                                                                |
| `catalog : string`           |               | The catalog to use when creating a new Analyzer report.                                                                                                                                                                                                                        |
| `cube : string`              |               | The cube to use when creating a new Analyzer report.                                                                                                                                                                                                                           |
| `dataSource : string`        |               | (Optional) The name of a data service that supplies data for the report. Use this in conjunction with a url value for that "catalog" parameter that supplies the mondrian model.                                                                                               |
| `reportPath : string`        |               | The path which points to an existing Analyzer report to open.                                                                                                                                                                                                                  |
| `mode : string`              |               | Mode in which to open Analyzer. Valid options are: viewer, editor. Defaults to viewer.                                                                                                                                                                                         |
| `onAnalyzerReady : function` |               | Callback function to execute once Analyzer has finished initializing                                                                                                                                                                                                           |
| `useLegacyPath : string`     |               | Indicates the decision to use the legacy url path structure when creating a new analyzer report: when "true" --> 'content/analyzer/' when "false" --> 'api/repos/xanalyzer/' This has no impact on the url path for opening existing reports, those will all be /api/repos/... |

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>dispose()</code></td></tr><tr><td><p>Removes the iframe and releases all of its resources.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L391">javascript/web/util/AnalyzerModule.js, line 391</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.dispose()</p><pre><code>```
</code></pre></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>getApi()</code></td></tr><tr><td><p>Returns the reference to the Analyzer API for the loaded object. This method is not safe to use until the <code>onAnalyzerReady</code> function has been called.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L469">javascript/web/util/AnalyzerModule.js, line 469</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.getApi()</p><pre><code>```
</code></pre></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>getOptions()</code></td></tr><tr><td><p>Returns the options used to render.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L439">javascript/web/util/AnalyzerModule.js, line 439</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.getOptions()</p><pre><code>```
</code></pre></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>getParentElement()</code></td></tr><tr><td><p>Returns the parent element of the iframe.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L454">javascript/web/util/AnalyzerModule.js, line 454</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.getParentElement()</p><pre><code>```
</code></pre></td></tr></tbody></table>

| `getUrl()`                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>Returns the URL generated for the iframe.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L424">javascript/web/util/AnalyzerModule.js, line 424</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript"> |
| </code></pre></li></ul>                                                                                                                                                                                                                                                                                                                                                                                      |

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>hide()</code></td></tr><tr><td><p>Hides the Analyzer module when it is visible.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L376">javascript/web/util/AnalyzerModule.js, line 376</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.hide()</p><pre><code>```
</code></pre></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>reset()</code></td></tr><tr><td><p>Resets the state of the report back to the most recently saved state.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L409">javascript/web/util/AnalyzerModule.js, line 409</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.reset()</p><pre><code>```
</code></pre></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><code>show()</code></td></tr><tr><td><p>Shows the Analyzer module when it has been hidden via the hide() method.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L361">javascript/web/util/AnalyzerModule.js, line 361</a></p><ul><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>analyzerModule.show()</p><pre><code>```
</code></pre></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><code>validateParams(options) : boolean</code></td><td></td><td></td></tr><tr><td><p>Validates the required parameters for the Analyzer module.</p><ul><li><strong>Source</strong></li></ul><p><a href="https://github.com/pentaho/pentaho-platform-plugin-common-ui/tree/master/impl/client/src/main/javascript/web/util/AnalyzerModule.js#L302">javascript/web/util/AnalyzerModule.js, line 302</a></p><ul><li><strong>Parameters</strong></li><li><strong>Returns</strong></li><li><p><strong>Example</strong></p><pre class="language-javascript"><code class="lang-javascript">
</code></pre></li></ul><p>validateParams(options);</p><pre><code>```
</code></pre></td><td></td><td></td></tr><tr><td>Name</td><td>Default Value</td><td>Summary</td></tr><tr><td><code>options :</code></td><td></td><td></td></tr><tr><td>Name</td><td>Description</td><td></td></tr><tr><td><code>boolean</code></td><td></td><td></td></tr></tbody></table>

| Name      | Description |
| --------- | ----------- |
| `boolean` |             |

| Name        | Default Value | Summary |
| ----------- | ------------- | ------- |
| `options :` |               |         |


---

# Agent Instructions: 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:

```
GET https://docs.pentaho.com/analyzer-external-javascript-api/analyzer-module-apis-pentaho-analyzer-external-javascript-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
