Hide Table of Contents
esri
Map
toolbars
Class: Infographic
[ AMD Module Require | Legacy Module Require ]

Module Require

require(["esri/dijit/geoenrichment/InfoGraphic", ... ], function(Infographic, ... ){ ... });

Description

Class added 3.6
Displays an Infographic of one or more variables that describe the geographic context of a location.

Note that a css stylesheet needs to be included:
<link rel="stylesheet" href="//js.arcgis.com/3.6/js/esri/dijit/geoenrichment/themes/common/main.css">

Samples

Search for samples that use this class.

Class hierarchy

esri.dijit.geoenrichment.Infographic

Constructors

ConstructorDescription
new Infographic(params,srcNodeRef)Creates a new Infographic dijit using the given DOM node.

Properties

PropertyTypeDescription
cacheLimitNumberThe number of Infographic's for which data retrieved is cached for that browser session.
countryIDStringThe ID of the country for which data is retrieved.
datasetIDStringThe ID of the dataset to which variables used in this Infographic belong.
expandedBooleanIf true, the Infographic will be displayed in its expanded state.
returnGeometryBooleanWhen true, output geomentry will be available as the geometry property in the returned object of the "data-ready" event handler.
studyAreaGeometryStudyAreaThe study area for this Infographic.
studyAreaOptionsRingBuffer | DriveBuffer | IntersectingGeographiesThe options to apply to the study area.
titleStringThe title of the Infographic.
typeStringThe type of the Infographic.
variablesString[]The set of variables displayed in this Infographic.

Methods

MethodReturn ValueDescription
startup()NoneFinalizes the creation of this dijit.

Events

[ On Style Events | Connect Style Events ]

All On Style event listeners receive a single event object. The event properties listed below are accessed from this event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
On EventEvent PropertiesDescription
data-error<Object> errorFires if an error occurs in retrieving data for the study area. Should be used in favor of onDataRequest.
data-loadNoneFires when loading data for the study area. Should be used in favor of onDataLoad.
data-ready<Object> providerFires when data for the study area is ready. Should be used in favor of onDataReady.
data-requestNoneFires when requesting data for the study area. Should be used in favor of onDataRequest.
resize<Number[]> sizeFires when the Infographic is resized. Should be used in favor of onResize.
Constructor Details

new Infographic(params,srcNodeRef)

Creates a new Infographic dijit using the given DOM node.
Parameters:
<Object> paramsRequiredVarious optional parameters that can be used to configure the dijit. All properties can be passed into the constructor as options. variables, type and studyArea are required when constructing an Infographic.
<String | DOMNode> srcNodeRefRequiredReference or id of an HTML element where the Directions widget should be rendered.
Code Snippet:
require([
  "esri/dijit/geoenrichment/Infographic",
  "esri/geometry/Point",
  "esri/tasks/geoenrichment/GeometryStudyArea",
  "dojo/domReady!"
], function(Infographic, Point, GeometryStudyArea){
  var infographics = new Infographic({
    studyArea: new GeometryStudyArea({ geometry: new Point(-120.44,34.95) }),
    type: "AgePyramid",
    variables: ["Age.*"]
  }, "infographics");
  infographics.startup();
});
Property Details

<Number> cacheLimit

The number of Infographic's for which data retrieved is cached for that browser session.

<String> countryID

The ID of the country for which data is retrieved. Optional when constructing an Infographic. If not specified, the server will automatically determine the country. Specifying the country ID can eliminate computational cost and potentially improve the performance of your application.

Refer to the GeoEnrichment Coverage section of the ArcGIS GeoEnrichment Service documentation to find the countries where data are available. The "Two-Digit Country Code" column in the first table lists all the country codes you may use.
Code Snippet:
countryID: "US"

<String> datasetID

The ID of the dataset to which variables used in this Infographic belong. If not specified, the server will automatically determine the dataset. Specifying the dataset ID can eliminate computational cost and potentially improve the performance of your application.

Refer to the GeoEnrichment Coverage section of the ArcGIS GeoEnrichment Service documentation to find available dataset. Request latest available datasets at http://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer/Geoenrichment/Countries?f=pjson&token=<your_own_token>.
Code Snippet:
datasetID: "USA_ESRI_2013"

<Boolean> expanded

If true, the Infographic will be displayed in its expanded state. The default value is true.
Default Value: true

<Boolean> returnGeometry

When true, output geomentry will be available as the geometry property in the returned object of the "data-ready" event handler. If you do not intend to add the output geometry to the map, set it to false to improve performance.
Default Value: false

<GeometryStudyArea> studyArea

The study area for this Infographic. Required when constructing an Infographic.
The options to apply to the study area. Optional when constructing an Infographic. The default value is a RingBuffer with 1-mile radius.
Default Value: new RingBuffer({"radii": [ 1 ], "units": "esriMiles"})
Code Snippet:
studyAreaOptions: new DriveBuffer({radii: [ 2 ], units: "esriMiles"})

<String> title

The title of the Infographic. Optional when constructing an Infographic. If not specified, the title of the GeoEnrichment dataset will be displayed as the title.

<String> type

The type of the Infographic. Required when constructing an Infographic.
  • "OneVar" displays the value of a variable. If multiple variables are specified, only the first in the array will be displayed.
  • "RelatedVariables" displays values of multiple variables.
  • "AgePyramid" displays an age pyramid based on the demographic data. Must specify variables: ["Age.*"] to get complete age data.
  • "Tapestry" displays Lifestyles-Esri Tapestry Segmentation data in the Infographic. Must specify variables: ["Tapestry.*"] to get complete tapestry data.
Known Values: "RelatedVariables" | "AgePyramid" | "Tapestry" | "OneVar"

<String[]> variables

The set of variables displayed in this Infographic. Required when constructing an Infographic.

To return all variables in a category, specify this value as ["<category_name>.*"].

The availability of variables varies from country to country. You may use this application to find variables available in your study area, or refer to the Data collections section in the ArcGIS GeoEnrichment Service documentation to find available variables.
Method Details

startup()

Finalizes the creation of this dijit. This method should be called after the constructor for this dijit is called and before letting the users interact with it.
Event Details

[ On Style Events | Connect Style Events ]

data-error

Fires if an error occurs in retrieving data for the study area. Should be used in favor of onDataRequest.
Event Properties:
<Object> errorThe error message returned by the GeoEnrichment service.

data-load

Fires when loading data for the study area. Should be used in favor of onDataLoad.

data-ready

Fires when data for the study area is ready. Should be used in favor of onDataReady.
Event Properties:
<Object> providerA provider object containing GeoEnrichment results. When returnGeometry is set to true, you may use the provider.getGeometry() to get the returned geometry.
Code Snippet:
require([
  "esri/graphic", "esri/symbols/SimpleFillSymbol", ... 
], function(Graphic, SimpleFillSymbol, ... ){
  infographics.on("data-ready", function (evt) {
    map.graphics.add(new Graphic(evt.provider.geometry, new SimpleFillSymbol()));
  });
});

data-request

Fires when requesting data for the study area. Should be used in favor of onDataRequest.

resize

Fires when the Infographic is resized. Should be used in favor of onResize.
Event Properties:
<Number[]> sizeThe size of the Infographic.
[460,106]