# Dashboard Class

> Dashboard class in the TX Sheet Control JavaScript API for the browser: A stable dashboard handle. All snapshots are detached.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > Dashboard Class
- **2093 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/llms-full.txt

---

A stable dashboard handle. All snapshots are detached; handles expire after document replacement or deletion.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

ES module import: `import { Dashboard } from '@txtextcontrol/tx-sheet-control';`.

### Members

#### Properties

| Property | Description |
|---|---|
| [id](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/id-property/llms-full.txt) | The id value of Dashboard. |
| [mode](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/mode-property/llms-full.txt) | The mode value of Dashboard. |
| [name](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/name-property/llms-full.txt) | The name value of Dashboard. |
| [snapshot](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/snapshot-property/llms-full.txt) | Detached definition, including filters, layout, widgets and presentation settings. |

#### Methods

| Method | Description |
|---|---|
| [addWidget](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/addwidget-method/llms-full.txt) | Adds a widget, moving collisions to open space; duplicate IDs and invalid geometry reject atomically. |
| [drillTo](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/drillto-method/llms-full.txt) | Returns to an ancestor in the widget's zero-based hierarchy (0 is the root), clearing descendant filters. Throws for an unknown widget, unconfigured hierarchy, noninteger level or a deeper level without selection. |
| [drillUp](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/drillup-method/llms-full.txt) | Returns one level up a widget's configured hierarchy; the root is unchanged. Worksheet data is untouched. |
| [query](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/query-method/llms-full.txt) | Evaluates one widget with shared filters; no editor or DOM is required. |
| [removeWidget](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/removewidget-method/llms-full.txt) | Removes a widget in one undoable edit. |
| [render](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/render-method/llms-full.txt) | Renders a widget without constructing the editor. Chart dimensions are CSS pixels, 120..4096. |
| [resetFilters](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/resetfilters-method/llms-full.txt) | Restores the saved default filter context. |
| [selectMark](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/selectmark-method/llms-full.txt) | Selects a dimensional chart mark, applying configured cross-filtering and advancing its drill hierarchy. Both changes share one undo transaction. Throws for an absent widget/dimension or invalid scalar value. |
| [setFilters](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/setfilters-method/llms-full.txt) | Sets shared filter context, preserving source worksheet values and AutoFilter state. |
| [sourceData](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/sourcedata-method/llms-full.txt) | Returns underlying rows only when explicitly enabled on the widget; at most 1,000 rows. |
| [update](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/update-method/llms-full.txt) | Replaces validated presentation properties in one undoable transaction; identity is retained. |
| [updateWidget](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/updatewidget-method/llms-full.txt) | Updates a widget without changing its identity. Moved/resized widgets reserve their requested cells; colliding widgets relocate to the next open space in the same undo transaction. Throws for removed widgets. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```javascript
function createDashboardReport(book) {
    const sheet = book.sheets.at(0);
    sheet.range('A1:B5').setValues([
        ['Region', 'Revenue'],
        ['North', 42000],
        ['South', 38500],
        ['East', 31200],
        ['West', 44900],
    ]);

    book.analytics.setSource({
        id: 'sales',
        name: 'Regional sales',
        sheetId: sheet.id,
        range: 'A1:B5',
        hasHeaderRow: true,
    });

    const dashboard = book.dashboards.add('Sales overview');
    dashboard.addWidget({
        id: 'revenue',
        type: 'bar',
        title: 'Revenue by region',
        placement: { x: 0, y: 0, width: 6, height: 4 },
        query: {
            sourceId: 'sales',
            dimensions: ['Region'],
            measures: [{ field: 'Revenue', aggregation: 'SUM', alias: 'Revenue' }],
        },
        drillDown: ['Region'],
        interactions: { filter: true, allowSourceData: true },
    });

    return dashboard.snapshot;
}
```

### See Also

- [JavaScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/llms-full.txt)
- [Creating Dashboards](https://docs.textcontrol.com/tx-sheet-control/dashboards/creating/llms-full.txt)

### Advanced Dashboard Operations

| Method | Description |
|---|---|
| [renderSvg](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/rendersvg-method/llms-full.txt) | Renders the current visible dashboard as portable SVG, including gradients, charts and KPI comparisons. |
| Width defaults to 1440 CSS pixels (480..4096); height follows the saved grid, at most 16,384 pixels. |  |
| Filters and expanded branches are honored; collapsed sections are omitted. Worksheet values are untouched. |  |
| [applyTheme](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/applytheme-method/llms-full.txt) | Applies one of 24 coordinated Light, Medium or Dark presets; existing explicit card overrides remain unchanged. |
| [arrangeWidgets](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/arrangewidgets-method/llms-full.txt) | Aligns/distributes all widgets or packs a grid of 1..4 columns. Collision resolution remains atomic and undoable. |
| [getExploration](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/getexploration-method/llms-full.txt) | Returns viewer navigation availability. History is limited to 50 successful actions and is not saved to TXWB. |
| [goBack](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/goback-method/llms-full.txt) | Restores the previous exploration context, including dashboard navigation; design edits invalidate history. |
| [goForward](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/goforward-method/llms-full.txt) | Reapplies an exploration undone with goBack; a new action discards forward history. |
| [setParameter](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/setparameter-method/llms-full.txt) | Changes a named numeric what-if value without changing cells; bounds and choices are enforced atomically. |
| [setMetric](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/setmetric-method/llms-full.txt) | Switches a widget to a configured metric query and number display, retaining its visual settings. |
| [highlightMark](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/highlightmark-method/llms-full.txt) | Highlights matching marks across charts on this source; repeating a selection or passing null clears it. |
| [navigateTo](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/navigateto-method/llms-full.txt) | Opens the configured dashboard with an equality filter, preserving its other filters and recording Back navigation. |
| [toggleBranch](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/togglebranch-method/llms-full.txt) | Expands/collapses one hierarchy branch while other branches remain summarized. Paths contain equality filters in hierarchy order. |
| [kpi](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/kpi-method/llms-full.txt) | Calculates comparison, change, target and trend using the same source/filter context as the widget. |
| [toggleSection](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/togglesection-method/llms-full.txt) | Collapses/expands a section in the viewer without modifying worksheet data or card definitions. |

---

## In This Section

- [Dashboard.addWidget Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/addwidget-method/llms-full.txt): Dashboard.addWidget method in the TX Sheet Control JavaScript API for the browser: Adds a widget, moving collisions to open space.
- [Dashboard.applyTheme Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/applytheme-method/llms-full.txt): Dashboard.applyTheme method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.arrangeWidgets Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/arrangewidgets-method/llms-full.txt): Dashboard.arrangeWidgets method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.drillTo Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/drillto-method/llms-full.txt): Dashboard.drillTo method in the browser JavaScript API, with the parameters widgetId and level, the return type void and a JavaScript example.
- [Dashboard.drillUp Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/drillup-method/llms-full.txt): Dashboard.drillUp method in the TX Sheet Control JavaScript API for the browser: Returns one level up a widget's configured hierarchy.
- [Dashboard.getExploration Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/getexploration-method/llms-full.txt): Dashboard.getExploration method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.goBack Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/goback-method/llms-full.txt): Dashboard.goBack method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.goForward Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/goforward-method/llms-full.txt): Dashboard.goForward method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.highlightMark Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/highlightmark-method/llms-full.txt): Dashboard.highlightMark method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.id Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/id-property/llms-full.txt): Dashboard.id property in the TX Sheet Control JavaScript API for the browser, with its type string and a JavaScript example.
- [Dashboard.kpi Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/kpi-method/llms-full.txt): Dashboard.kpi method in the browser JavaScript API: Calculates comparison, change, target and trend using the same source/filter context as the widget.
- [Dashboard.mode Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/mode-property/llms-full.txt): Dashboard.mode property in the TX Sheet Control JavaScript API for the browser, with its type "design" | "view" and a JavaScript example.
- [Dashboard.name Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/name-property/llms-full.txt): Dashboard.name property in the TX Sheet Control JavaScript API for the browser, with its type string and a JavaScript example.
- [Dashboard.navigateTo Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/navigateto-method/llms-full.txt): Dashboard.navigateTo method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.query Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/query-method/llms-full.txt): Dashboard.query method in the TX Sheet Control JavaScript API for the browser: Evaluates one widget with shared filters; no editor or DOM is required.
- [Dashboard.removeWidget Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/removewidget-method/llms-full.txt): Dashboard.removeWidget method in the TX Sheet Control JavaScript API for the browser: Removes a widget in one undoable edit.
- [Dashboard.render Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/render-method/llms-full.txt): Dashboard.render method in the TX Sheet Control JavaScript API for the browser: Renders a widget without constructing the editor.
- [Dashboard.renderSvg Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/rendersvg-method/llms-full.txt): Dashboard.renderSvg method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.resetFilters Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/resetfilters-method/llms-full.txt): Dashboard.resetFilters method in the TX Sheet Control JavaScript API for the browser: Restores the saved default filter context.
- [Dashboard.selectMark Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/selectmark-method/llms-full.txt): Dashboard.selectMark method in the browser JavaScript API, with the parameters widgetId and value, the return type void and a JavaScript example.
- [Dashboard.setFilters Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/setfilters-method/llms-full.txt): Dashboard.setFilters method in the browser JavaScript API: Sets shared filter context, preserving source worksheet values and AutoFilter state.
- [Dashboard.setMetric Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/setmetric-method/llms-full.txt): Dashboard.setMetric method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.setParameter Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/setparameter-method/llms-full.txt): Dashboard.setParameter method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.snapshot Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/snapshot-property/llms-full.txt): Dashboard.snapshot property in the browser JavaScript API: Detached definition, including filters, layout, widgets and presentation settings.
- [Dashboard.sourceData Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/sourcedata-method/llms-full.txt): Dashboard.sourceData method in the TX Sheet Control JavaScript API for the browser: Returns underlying rows only when explicitly enabled on the widget.
- [Dashboard.toggleBranch Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/togglebranch-method/llms-full.txt): Dashboard.toggleBranch method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.toggleSection Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/togglesection-method/llms-full.txt): Dashboard.toggleSection method in the TX Sheet Control JavaScript API for the browser, with its syntax and a JavaScript example.
- [Dashboard.update Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/update-method/llms-full.txt): Dashboard.update method in the TX Sheet Control JavaScript API for the browser: Replaces validated presentation properties in one undoable transaction.
- [Dashboard.updateWidget Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/updatewidget-method/llms-full.txt): Dashboard.updateWidget method in the TX Sheet Control JavaScript API for the browser: Updates a widget without changing its identity.

---

## Nearby

- **Previous:** [createPrintLayout Function](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/createprintlayout-function/llms-full.txt)
- **Next:** [Dashboard.addWidget Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/dashboard/addwidget-method/llms-full.txt)
