Item#

class ansys.dynamicreporting.core.Item(service: ADR = None, obj_name: str | None = 'default', source: str | None = 'ADR')#

Provides for creating an object that represents an Ansys Dynamic Reporting item.

Create an instance of this class for each item in the database that you want to interact with. When the object is created, no type is set. The type, determined the first time that you set the item_* attribute, cannot be changed.

This code creates an instance with the object my_txt as a text item:

>>> my_txt = adr_service.create_item()
>>> my_txt.item_text = '<h1>The test</h1>This is a text item'

The type of the item created in the preceding code cannot be changed. However, the attributes describing the object can be reset at any time. These hanges are automatically propagated into the database. The attributes described in the following “Parameters” section can be used to control the rendering of these objects.

Note

These attributes mirror the generic data item attributes described in Data Items in the documentation for Ansys Dynamic Reporting.

Parameters:
serviceansys.dynamicreporting.core.Service, optional

Ansys Dynamic Reporting object that provides the connection to the database that the item is to interact with. The default is None.

obj_namestr, optional

Name of the item object in the database. The default is default.

sourcestr, optional

Name of the source for the item in the database. The default is "ADR".

Examples

Initialize the Service class inside an Ansys Dynamic Reporting service and create an object as a text item:

import ansys.dynamicreporting.core as adr
adr_service = adr.Service(ansys_installation = r'C:\Program Files\ANSYS Inc\v232')
adr_service.connect(url='http://localhost:8010')
my_txt = adr_service.create_item()
my_txt.item_text = '<h1>The test</h1>This is a text item'

Methods

Item.add_tag([tag, value])

Add a tag to the item.

Item.get_iframe([width, height])

Get the iframe object corresponding to the item.

Item.get_tags()

Get the tags on the item.

Item.rem_tag([tag])

Remove a tag on the item.

Item.set_tags([tagstring])

Set tags on the item.

Item.visualize([new_tab])

Render this item only.

Attributes

Item.url

URL corresponding to the item

Item.item_text

Text (HTML and LaTeX formatting)

Item.item_image

Image object (Image and PNG binary files)

Item.item_scene

3D scene (AVZ, PLY, SCDOC, GLB, and STL files)

Item.item_animation

Animation file (MP4/H.264 format files)

Item.item_table

Table values (Must be in a numpy array)

Item.format

Number format

Item.format_column

Column labels format

Item.labels_column

Column labels

Item.format_row

Row labels format

Item.labels_row

Row labels

Item.plot

Table display style

Item.title

Common title

Item.line_color

Line/bar/pie/marker colors

Item.line_marker

Markers

Item.line_marker_text

Marker text

Item.line_marker_size

Marker size

Item.line_marker_opacity

Marker opacity

Item.line_marker_scale

Marker scaling

Item.line_error_bars

Error bars

Item.line_style

Line styling

Item.line_width

Line width

Item.stacked

Bar chart stacking

Item.xaxis

X axis rows

Item.yaxis

Y axis rows

Item.palette

Color palette

Item.palette_position

Position of the colorbar

Item.palette_range

Range of the colorbar

Item.palette_show

Colorbar display

Item.palette_title

Colorbar title string

Item.width

Chart width

Item.height

Chart height

Item.show_legend

Show legend

Item.legend_position

Position the legend

Item.show_legend_border

Show legend border

Item.show_border

Show plot border

Item.plot_margins

Plot margins

Item.plot_title

Plot title

Item.plot_xaxis_type

X axis style

Item.plot_yaxis_type

Y axis style

Item.xrange

X axis range

Item.yrange

Y axis range

Item.xaxis_format

X axis text format

Item.yaxis_format

Y axis text format

Item.xtitle

X axis title

Item.ytitle

Y axis title

Item.item_justification

Table item justification

Item.nan_display

NaN table display value

Item.table_sort

Table sorting

Item.table_title

Table title

Item.align_column

Column value alignment

Item.table_search

Search values

Item.table_page

Table paging

Item.table_pagemenu

Table paging menu

Item.table_scrollx

Horizontal scrolling

Item.table_scrolly

Vertical scrolling

Item.table_bordered

Table bordering

Item.table_condensed

Table compactness

Item.table_wrap_content

Table content wrapping

Item.table_default_col_labels

Default column labels

Item.table_cond_format

Table conditional formatting

Item.column_minimum

Parallel coords column range minimums

Item.column_maximum

Parallel coords column range maximums