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 changes 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:
- service
ansys.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_name
str
,optional
Name of the item object in the database. The default is
default
.- source
str
,optional
Name of the source for the item in the database. The default is
"ADR"
.
- service
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.
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
URL corresponding to the item
Text (HTML and LaTeX formatting)
Image object (Image and PNG binary files)
3D scene (AVZ, PLY, SCDOC, GLB, and STL files)
Animation file (MP4/H.264 format files)
Table values (Must be in a numpy array)
Number format
Column labels format
Column labels
Row labels format
Row labels
Table display style
Common title
Linebarhistogrampiemarker colors
Markers
Marker text
Marker text row name
Marker size
Marker opacity
Marker scaling
Error bars
Auxiliary data 0
Auxiliary data 1
Auxiliary data 2
Auxiliary data 3
Auxiliary data 4
Auxiliary data 5
Auxiliary data 6
Auxiliary data 7
Auxiliary data 8
Auxiliary data 9
Column range minimums
Column range maximums
Line styling
Line width
Bar chart stacking Deprecated
Bar chart Histogram config mode
X axis rows
Y axis rows
Color palette
Position of the colorbar
Range of the colorbar
Colorbar display
Colorbar title string
Histogram rendering threshold
Cumulative histogram
Normalize histogram
Histogram bin size
Bar charts bar gap
Chart width
Chart height
Show legend
Position the legend
Show legend border
Show plot border
Plot margins
Plot title
X axis style
Y axis style
X axis range
Y axis range
X axis text format
Y axis text format
X axis title
Y axis title
Table item justification
NaN table display value
Table sorting
Table title
Column value alignment
Search values
Table paging
Table paging menu
Horizontal scrolling
Vertical scrolling
Table bordering
Table compactness
Table content wrapping
Default column labels
Table conditional formatting
List of tags for each table row
List of tags for each table column