> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/automation-api-and-scripting/python-dashboard-api/api-reference/class-reference/widget.md).

# Widget

*class* opalone.\_internal.widgets.Widget(*widget\_id*, *panel\_id*)

<table data-header-hidden><thead><tr><th width="158.22222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>A widget is a component of a panel that is used to control values in the simulation and display values from it.</p><p>A widget has a given number of Parameters.</p><p>A widget also has input and output <code>Signals</code>. However, contrary to <code>Blocks</code>, widgets have no <code>Ports</code> because they cannot link to one another within the same panel like regular blocks in a model.</p></td></tr><tr><td><strong>Parameters</strong></td><td><p><strong>widget_id</strong> (<em>str</em>) – the ID of the widget.</p><p><strong>panel_id</strong> (<em>str</em>) – the ID of the panel that owns this widget.</p></td></tr><tr><td><strong>Bases</strong></td><td>Blockbase</td></tr></tbody></table>

## Method

### delete

delete()

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Delete the current resource, which is done by suppressing its ID.</td></tr><tr><td><strong>Parameters</strong></td><td>None</td></tr></tbody></table>

### to\_json

to\_json(*fields*, *values*)

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Convert this resource to a serialized JSON representation.</td></tr><tr><td><strong>Parameter</strong></td><td><ul><li><strong>fields</strong> (<em>tuple[str] | list[str]</em>) – Fields to include.</li><li><strong>values</strong> (<em>tuple[object] | list[object]</em>) – The value of each field</li></ul></td></tr><tr><td><strong>Returns</strong></td><td>The serialized JSON representation.</td></tr><tr><td><strong>Return type</strong></td><td>str</td></tr></tbody></table>

## Property

### angle

*property a*ngl&#x65;*: float*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The angle of the block.</p><p>The value is between 0 and 360 degrees.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### comment\_state

*property* comment\_stat&#x65;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The <em>comment state</em> of the block.</p><p>The default value is <strong>NONE</strong>.</p><p>If <strong>COMMENT_OUT</strong>, the block is not considered by the simulation.</p><p>If <strong>COMMENT_THROUGH</strong>, the block is considered as a link between its input ports and output ports.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### datapoints

*property* datapoint&#x73;*: dict\[str, Datapoint]*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The datapoints of the block, in the form of a mapping <em>name = datapoint</em>. Datapoint names are unique within a given block.</p><p>Datapoints are a concatenation of parameters and signals, and could include other elements in the future.</p><p>This property is read-only, it cannot be modified. However, each datapoint might have alterable properties.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### description

*property* descriptio&#x6E;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The description of the block.</p><p>This property is read-only, it cannot be modified.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### dimension

*property* dimension&#x73;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>Dimensions (width and height) of the block.</p><p>The format of the location is <em>x y</em> where <em>x</em> and <em>y</em> are integer values (no decimal).</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### flip\_state

*property* flip\_stat&#x65;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The flip state of the block.</p><p>The default value is <strong>NONE</strong>.</p><p>If <strong>HORIZONTAL</strong>, the block is flipped horizontally (the flip axis is vertical).</p><p>If <strong>VERTICAL</strong>, the block is flipped vertically (the flip axis is horizontal).</p><p>If <strong>BOTH</strong>, both axes are used.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### id

*property* i&#x64;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The flip state of the block.</p><p>The default value is <strong>NONE</strong>.</p><p>If <strong>HORIZONTAL</strong>, the block is flipped horizontally (the flip axis is vertical).</p><p>If <strong>VERTICAL</strong>, the block is flipped vertically (the flip axis is horizontal).</p><p>If <strong>BOTH</strong>, both axes are used.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### is\_label\_visible

*property* is\_label\_visibl&#x65;*: bool*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Indicates if this block’s label is <em>visible</em> (True) or not (False).</td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### is\_locked

*property* is\_locke&#x64;*: bool*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Indicates if this block can be moved in the diagram and if it can be resized. (True) or not (False).</td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### location

*property* locatio&#x6E;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The location of the block within a diagram.</p><p>The format of the location is <em>(x,y)</em> where <em>x</em> and <em>y</em> are integer values (no decimal).</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### name

*property* nam&#x65;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>The name of the block. Block names must be unique within a Subsystem. A widget name must be unique within a Panel.</td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### parameters

*property* parameter&#x73;*: dict\[any, Datapoint]*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The parameters of the widget, in the form of a mapping <em>name = parameter</em>. Parameter names are unique within a given widget.</p><p>This property is read-only, it cannot be modified. However, each parameter might have alterable properties.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### ref\_id

*property* ref\_i&#x64;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The reference ID of the block.</p><p>This ID is only useful to lookup the block’s library data.</p><p>This property is read-only, it cannot be modified.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### signals

*property* signal&#x73;*: str*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The signals of the widget, in the form of a mapping <em>name = signal</em>. Signal names are unique within a given widget.</p><p>This property is read-only, it cannot be modified. However, each signal might have alterable properties.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>

### type

*property* typ&#x65;*: BlockType*

<table data-header-hidden><thead><tr><th width="200"></th><th></th></tr></thead><tbody><tr><td><strong>Description</strong></td><td><p>The type of the block.</p><p>This property is read-only, it cannot be modified.</p></td></tr><tr><td><strong>Parameter</strong></td><td>None</td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/automation-api-and-scripting/python-dashboard-api/api-reference/class-reference/widget.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
