Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: InfographicsOptions

require(["esri/dijit/geoenrichment/InfographicsOptions"], function(InfographicsOptions) { /* code goes here */ });

Description

(Added at v3.6)
InfographicsOptions is used to customize and configure the Infographic's included in a InfographicCarousel. Used in favor of the options property of InfographicsCarousel.

Samples

Search for samples that use this class.

Constructors

NameSummary
new InfographicsOptions(json?)Constructs instance from serialized state.

CSS

esri/dijit/geoenrichment/InfographicsOptions | Download source

Properties

NameTypeSummary
studyAreaOptionsRingBuffer | DriveBuffer | IntersectingGeographiesThe options to apply to the study area.
themeStringThe name of the css theme used to format the InfographicsCarousel.

Methods

NameReturn typeSummary
getItems(countryID)PromiseGets an array of default InfographicsOptions.Item's in the InfographicsCarousel with a countryID.
toJson()ObjectConverts object to its JSON representation.
Constructor Details

new InfographicsOptions(json?)

Constructs instance from serialized state.
Parameters:
<Object> json Optional Various options to configure this InfographicsOptions. Any property can be passed into this object.
Sample:
require([
  "esri/dijit/geoenrichment/InfographicsOptions", "esri/tasks/geoenrichment/DriveBuffer", ... 
], function(InfographicsOptions, DriveBuffer, ... ){
  var options = new InfographicsOptions({
    theme: "light",
    studyAreaOptions: new DriveBuffer({radii: [ 2 ], units: "esriMiles"})
  });
});
Property Details
The options to apply to the study area. The default value is a RingBuffer with 1-mile radius.
Default value: new RingBuffer({"radii": [ 1 ], "units": "esriMiles"})

<String> theme

The name of the css theme used to format the InfographicsCarousel.
Known values: "light" | "common"
Default value: "common"
Method Details

getItems(countryID)

Gets an array of default InfographicsOptions.Item's in the InfographicsCarousel with a countryID. You may use this method to add Infographic's to or remove Infographic's from a InfographicsCarousel.
Return type: Promise
Parameters:
<String> countryID Required The ID of the country for which data is retrieved.

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.
Sample:
require([
  "esri/dijit/geoenrichment/InfographicsCarousel",
  "esri/tasks/geoenrichment/GeometryStudyArea",
  "esri/geometry/Point",
  "esri/dijit/geoenrichment/InfographicsOptions",
  ... 
], function(InfographicsCarousel, GeometryStudyArea, Point, InfographicsOptions, ... ){
  var infographics = new InfographicsCarousel({
    studyArea: new GeometryStudyArea({ geometry: new Point(-120.44,34.95) }),
  }, "infographics");

  var options = new InfographicsOptions();

  options.getItems("US").then(function(items){
    //make default infographics invisible
    for (var i = 0; i < items.length; i++) {
      items[i].isVisible = false;
    };

    //create a new infographic
    var item = new InfographicsOptions.Item("OneVar", ["Wealth.PCI_CY"]);
    item.title = "Wealth";
    item.datasetID = "USA_ESRI_2013";

    //push the infographic into the array and set options
    items.push(item);
    infographics.set("options", options);
    infographics.startup();
  });
});

toJson()

Converts object to its JSON representation.
Return type: Object
Show Modal