arcgis.apps.dashboard module
TheDashboard
is the main entry point into the Dashboard module.Deprecated asArcGIS Dashboards Classic is retiring.
Dashboard
- classarcgis.apps.dashboard.Dashboard
Deprecated since version 2.0.1.
Creates a
Dashboard
Object.- Returns:
Dashboard
object
- propertyheader
- Returns:
Header
object
- save(title,description='',summary='',tags=None,gis=None,overwrite=False)
Deprecated since version 2.0.1.
Publishes a Dashboard Object.
Parameter
Description
title
Required string. Title or Caption for theDashboard.
description
Optional string. Description for the Dashboard.
summary
Optional string. Summary of the Dashboard.
tags
Optional string. Comma separated tags.
gis
Optional
GIS
to publish dashboard.By default uses active gis.overwrite
Optional Boolean.Overwrite existing dashboard.
- propertyside_panel
- Returns:
SidePanel
object
Details
- classarcgis.apps.dashboard.Details(item,name='Details',layer=0,title='',description='',max_features_displayed=50)
Creates a dashboard Details element.
Parameter
Description
item
Required Portal
Item
object. Item object shouldbe aFeatureLayer
.name
Optional string. Name of the element.
layer
Optional integer. Layer index for the
FeatureLayerCollection
item. Default value is 0title
Optional string. Title of the widget.
description
Optional string. Description of the widget.
max_features_displayed
Optional integer. Maximum number of featuresto display.
EmbeddedContent
- classarcgis.apps.dashboard.EmbeddedContent(url,name='EmbeddedContent',title='',description='',content_type='document',refresh_interval=0,item=None,layer=0)
Creates a dashboard Embedded Content Widget.
Parameter
Description
url
Required string. Url of the embedded contentor field name if item is not None.
name
Optional string. Name of the widget.
title
Optional string. Title of the widget.
description
Optional string. Description of the widget.
content_type
Optional string. Type of the content.Choose from “document”, “image”, “video”.
refresh_interval
Optional integer. Interval to refresh inminutes. It is only applicable forcontent_type = ‘image’
item
Optional Portal
Item
. To show content fromportal.layer
Optional integer. Layer number when item isa mapwidget.
Gauge
- classarcgis.apps.dashboard.Gauge(item,name='Gauge',layer=0,title='',description='')
Creates a dashboard Gauge widget.
Parameter
Description
item
Required Portal
Item
object. Item object canbe aFeatureLayer
or a MapWidget.name
Optional string. Name of the gauge widget.
layer
Optional integer. Layer number when item isa mapwidget.
title
Optional string. Title or Caption for thewidget.
description
Optional string. Description for the widget.
Header
- classarcgis.apps.dashboard.Header(title=None,subtitle=None,margin=True,size='medium',logo_image_url=None,logo_url=None,background_image_url=None,background_image_size='fit-width',background_image_position='left',signout_link=False,menu_links=None)
Creates a dashboard header widget.
Parameter
Description
title
Optional string. Title of the header.
subtitle
Optional string. Subtitle of the header.
margin
Optional boolean. Set True to add margin toheader position.
size
Optional string. Define size of header fromsmall, medium, large.Default is medium.
logo_image_url
Optional url string. Define a logo image.
logo_url
Optional url string. Define a hyperlink forthe logo image.
background_image_url
Optional url string. Add a background imageto the header.
background_image_size
Optional string. Select size of the image.Options:
fit-widthfit-heightfit-bothrepeatbackground_image_position
Optional string. Define the image positionwhen using fit-width or fit-height.Allowed options:
fit-height: left, center, rightfit-width: top, middle, bottomsignout_link
Optional boolean. Parameter to save the best modelduring training. If set toTrue the best modelbased on validation loss will be saved duringtraining.
menu_links
Optional list of tuples. Each tuple containsstring label and string url.
Indicator
- classarcgis.apps.dashboard.Indicator(item,name='Indicator',layer=0,title='',description='')
Creates a dashboard Indicator widget.
Parameter
Description
item
Required Portal
Item
object. Item object canbe aFeatureLayer
or a MapWidget.name
Optional string. Name of the Indicatorwidget.
title
Optional string. Title or Caption for thewidget.
layer
Optional integer. Layer number when item isa mapwidget.
description
Optional string. Description for the widget.
IndicatorData
- classarcgis.apps.dashboard.IndicatorData
- add_filter(field,join,condition,**kwargs)
Add filters associated with widget. The filters are applied to thelayer used in the initialization of the Indicator widget. PleaseseeFilter datafor detailed description of how filtering works with dashboard elements.
Parameter
Description
field
The layer’s attribute field name that will be usedto limit the features visualized in the widget.
join
SpecifyAND orOR to indicate whether therewill be one or multiple filter conditions.
condition
The operator used to evaluate the attributes andreturn the subset of results. The operatorsavailable change depending upon the type of theattribute field. SeeFilter condition componentsfor details on what conditions apply to anattribute field based on its contents.
In addition to explicitly named parameters,the
add_filter()
method supports anoptional key word argument when the condition isequal,not equalgreater than,greater than or equal,less than, orless than or equalkwargs
Description
value
The specific value or values to use to determinewhich subset of layer or table rows to include.
# Usage Example>>>indicator1=Indicator(item=flyr_item)# Set attribute field to use for default statistic of `count`>>>indicator1.data.value_field="ObjectId"# Add filter for ObjectID's greater than 1500 to data object>>>indicator1.data.add_filter(field="ObjectId",join="AND",condition="greater than",value=1500)>>>new_dash=Dashboard()# Set the dashboard layour to include the widget>>>new_dash.layout=add_row([indicator1])>>>saved_dash=new_dash.save(title="Dashboard with Indicator",description="Dashboard with indicator widget based"on a hosted feature layer with one""layer",summary="Single layer indicator created in API.",tags="python_api,dashboard,single_layer_hfl",overwrite=True)
ReferenceData
List
- classarcgis.apps.dashboard.List(item,name='List',layer=0,title=None,description=None)
Creates a dashboard List widget.
Parameter
Description
item
Required Portal
Item
object. Item object canbe aFeatureLayer
or a MapWidget.name
Optional string. Name of the List widget.
layer
Optional integer. Layer number when item isa mapwidget.
title
Optional string. Title or Caption for thewidget.
description
Optional string. Description for the widget.
MapLegend
- classarcgis.apps.dashboard.MapLegend(map_widget,name='MapLegend',title='',description='')
Create a MapLegend widget for Dashboard
Parameter
Description
map_widget
Required web map widget. Legend for thisMap widget is displayed.This map widget needs to be a part of thefinal Dashboard as well.
name
Optional String. Name of the widget.
title
Optional string. Title of the widget.
description
Optional string. Description of the widget.
PieChart
- classarcgis.apps.dashboard.PieChart(item,name='PieChart',layer=0,categories_from='groupByValues',title='',description='')
Creates a dashboard Pie Chart widget.
Parameter
Description
item
Required Portal
Item
object. Item object canbe a Table Layer or a MapWidget.name
Optional string. Name of the pie chartwidget.
layer
Optional integer. Layer number when item isa mapwidget.
categories_from
Optional string. Select from groupByValues,features or fields.
title
Optional string. Title or Caption for thewidget.
description
Optional string. Description for the widget.
RichText
- classarcgis.apps.dashboard.RichText(html_text,name='RichText',title='',description='')
Creates a dashboard Rich Text widget.
Parameter
Description
html_text
Required HTML text. This text will bedisplayed in Rich Text format.
name
Optional String. Name of the widget.
title
Optional String. Title of the widget.
description
Optional String. Description of the widget.
SerialChart
- classarcgis.apps.dashboard.SerialChart(item,name='SerialChart',layer=0,categories_from='groupByValues',title='',description='')
Creates a dashboard Serial Chart widget.
Parameter
Description
item
Required Portal
Item
object. Item object canbe aFeatureLayer
or a MapWidget.name
Optional string. Name of the serial chartwidget.
layer
Optional integer. Layer number when item isa mapwidget.
categories_from
Optional string. Select from groupByValues,features or fields.
title
Optional string. Title or Caption for thewidget.
description
Optional string. Description for the widget.
SidePanel
DatePicker
- classarcgis.apps.dashboard.DatePicker(range=False,operator='is',label='',**kwargs)
Creates a Date Selector widget for Side Panel or Header.
Parameter
Description
range
Optional boolean. True to create a rangeselector.
operator
Optional String. Operator for non rangedatepicker.
Options:
“is”, “is not”, “is before”,“is or is before”, “is after”,“is or is after”.label
Optional String. Label for the widget.
kwargs
If “range” is True, provide two parameters“min_value” and “max_value”. If “range” isFalse provide single parameter “value”.
Allowed values:
None, “Today”, or a fixed value in 24 hours format(year, month, day, hour, minutes)or(year, month, day)
CategorySelector
- classarcgis.apps.dashboard.CategorySelector
Creates a Category Selector widget for Side Panel or Header.
- propertyselector
- Returns:
Selector Properties Object, set label, preferred display, display threshold, operator etc.
- set_defined_values(key_value_pairs,value_type='string')
Set defined values for the dropdown.
Parameter
Description
key_value_pairs
Optional list of tuples. The tuple shouldcontain labels and their corresponding values.
value_type
Optional String.The data type of the values in the tuple.“integer” or “string
- set_feature_options(item,line_item_text='',field_name=None,max_features=50)
Set feature values for dropdown.
Parameter
Description
item
Required Portal
Item
. Dropdown values will be populated from this.line_item_text
Optional String. This text will be displayed with options.
field_name
Optional String. Data from this field will be added to list.
max_features
Optional Integer. Set max features to display.
- set_group_by_values(item,category_field,max_features=50)
Set group by values for dropdown.
Parameter
Description
item
Required Portal
Item
.Dropdown values will be populated from this.category_field
Optional String. This string denotes thefield to pick the values from.
max_features
Optional Integer.Set max features to display.
NumberSelector
- classarcgis.apps.dashboard.NumberSelector(range=False,display_type='spinner',label='Selectanumber',**kwargs)
Creates a Number Selector widget for Side Panel or Header.
Parameter
Description
range
Optional boolean. True to create a rangeselector.
display_type
Optional String. Display type can be from“spinner”, “slider”, “input”.
label
Optional string. Label for the selector.
Keyword Arguments
Parameter
Description
operator
Optional string for non-range input.
Allowed:
“equal”, “not equal”, “greater than”,“greater than or equal”, “less than”,“less than or equal”.Default: “equal”increment_factor
Optional int for slider and spinner input.
- set_defined_limits(lower_limit=0,upper_limit=100,**kwargs)
Set the item to pick values from for spinner and slider display type.
Parameter
Description
lower_limit
Optional integer. Set the lower limit.
upper_limit
Optional integer. Set the upper limit.
Keyword Arguments
Parameter
Description
default
Optional integer. Set default value fornon-range selector.
lower_default
Optional integer. Set the lower defaultvalue for range selector.
upper_default
Optional integer. Set the upper defaultvalue for range selector.
- set_statistics_limits(item,field,default='min',layer_id=0)
Set the item to pick values from for spinner and slider display type.
Parameter
Description
item
Required Portal
Item
. Item to pick values from.field
Required String. Field from the Portal Item.
default
Optional String. Default value statistic.Options: “min”, “max”, “avg”
layer_id
Optional integer. Layer Id for the item.