{"id":1100961,"date":"2021-01-05T09:00:40","date_gmt":"2021-01-05T17:00:40","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1100961"},"modified":"2021-01-06T09:42:30","modified_gmt":"2021-01-06T17:42:30","slug":"summarize-and-explore-point-clusters-in-web-apps","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps","title":{"rendered":"Summarize and explore point clusters in web apps"},"author":6561,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[22941],"tags":[26751,34601,24581,30061],"industry":[],"product":[36831,36601],"class_list":["post-1100961","blog","type-blog","status-publish","format-standard","hentry","category-mapping","tag-clustering","tag-data-exploration","tag-smart-mapping","tag-summary-statistics","product-js-api-arcgis","product-developers"],"acf":{"short_description":"The ArcGIS API for JavaScript allows you to query point cluster features to display statistics, and other summary information to the user.","flexible_content":[{"acf_fc_layout":"content","content":"<p>The <a href=\"https:\/\/developers.arcgis.com\/javascript\/\">ArcGIS API for JavaScript<\/a> (JS API) version <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/announcements\/whats-new-in-the-arcgis-api-for-javascript-version-4-18\/\">4.18<\/a> added support for <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html\">querying point clusters<\/a>. This allows you to summarize and explore the features of a cluster in more detail, including the following scenarios:<\/p>\n<ul>\n<li>Display the extent or convex hull of clustered features<\/li>\n<li>Display all features belonging to a cluster<\/li>\n<li>Display summary statistics for a cluster in a popup<\/li>\n<li>Allow users to browse clustered features in a popup or view<\/li>\n<\/ul>\n<p>The <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html\">Point clustering &#8211; query clusters<\/a> sample app demonstrates each of these scenarios using <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-PopupTemplate.html#actions\">popup actions<\/a>.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1101411,"id":1101411,"title":"overall-cluster","filename":"overall-cluster.gif","filesize":374112,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/overall-cluster","alt":"Using popup actions, you can allow users to query clusters in a variety of ways.","author":"6561","description":"","caption":"Using popup actions, you can allow users to query clusters in a variety of ways.","name":"overall-cluster","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:30:12","modified":"2020-12-31 01:31:07","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":690,"height":300,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","medium-width":464,"medium-height":202,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","medium_large-width":690,"medium_large-height":300,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","large-width":690,"large-height":300,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","1536x1536-width":690,"1536x1536-height":300,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","2048x2048-width":690,"2048x2048-height":300,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","card_image-width":690,"card_image-height":300,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/overall-cluster.gif","wide_image-width":690,"wide_image-height":300}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"sidebar","content":"<p>The examples in this post leverage the the ArcGIS JS API&#8217;s client-side query engine. This query engine operates completely within the browser, allowing you to execute fast and complex spatial, attribute, and statistical queries. Rapid browser-based computation makes data exploration fast and more engaging for users. For more information and examples related to the client-side query engine, read the <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/turbo-charge-your-web-apps-with-client-side-queries\/\">Turbo charge your web apps with client-side queries<\/a> blog post and the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/guide\/query-filter\/#\">Query and filter<\/a> guide page.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<p>Before diving into some examples, let&#8217;s take a quick tour of what clustering is and the clustering capabilities the JS API provides you out of the box.<\/p>\n<p>If you are already familiar with clustering and how it works in the ArcGIS JS API, then feel free to skip to the <a href=\"#query-cluster-features\"><em>Query cluster features<\/em><\/a> section below.<\/p>\n<h2>Clustering overview<\/h2>\n<p><a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster\/index.html\">Clustering<\/a> is a method of merging nearby and overlapping features into a single symbol to declutter the view. The size of the cluster icon indicates the number of features in each cluster relative to other clusters. Clustering is configured with the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-FeatureReductionCluster.html\">FeatureReductionCluster<\/a> class, which is set on the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-FeatureLayer.html#featureReduction\">featureReduction<\/a> property of the layer.<\/p>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\">layer.featureReduction = {\r\n  type: <span style=\"color: #d14\">\"cluster\"<\/span>\r\n}\r\n<\/code><\/pre>\n<p>For example, check out this map of earthquakes that occurred along the Aleutian Islands in June 2020.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":928581,"id":928581,"title":"Screen Shot 2020-07-09 at 12.30.54 PM","filename":"Screen-Shot-2020-07-09-at-12.30.54-PM.png","filesize":27611,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labels-now-supported-in-point-clustering\/screen-shot-2020-07-09-at-12-30-54-pm","alt":"Earthquakes clustered.","author":"6561","description":"","caption":"Earthquakes that occurred along the Aleutian Islands in June 2020. The points are clustered so you can easily see where more earthquakes occur.","name":"screen-shot-2020-07-09-at-12-30-54-pm","status":"inherit","uploaded_to":922831,"date":"2020-07-09 19:32:04","modified":"2020-12-30 23:02:38","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1328,"height":426,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","medium-width":464,"medium-height":149,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","medium_large-width":768,"medium_large-height":246,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","large-width":1328,"large-height":426,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","1536x1536-width":1328,"1536x1536-height":426,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","2048x2048-width":1328,"2048x2048-height":426,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM-826x265.png","card_image-width":826,"card_image-height":265,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.30.54-PM.png","wide_image-width":1328,"wide_image-height":426}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster\/index.html"},{"acf_fc_layout":"content","content":"<p>Clustering helps you immediately see the relative density of features. When clustering is not enabled, it&#8217;s difficult to discern areas with a lot of overlapping points.<\/p>\n<p>Notice how the cluster of 1,000+ earthquakes in the previous image is not noticeable when the same layer is not clustered.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":928591,"id":928591,"title":"Screen Shot 2020-07-09 at 12.31.38 PM","filename":"Screen-Shot-2020-07-09-at-12.31.38-PM.png","filesize":33220,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/labels-now-supported-in-point-clustering\/screen-shot-2020-07-09-at-12-31-38-pm","alt":"Earthquakes along the Aleutian Islands from the last 30 days. Not clustered.","author":"6561","description":"","caption":"Earthquakes that occurred along the Aleutian Islands in June 2020. In this visualization, each earthquake is represented with one point. When points aren't clustered, overlapping points make it difficult to see areas with a high number of earthquakes.","name":"screen-shot-2020-07-09-at-12-31-38-pm","status":"inherit","uploaded_to":922831,"date":"2020-07-09 19:32:07","modified":"2020-12-30 23:02:16","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1258,"height":426,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","medium-width":464,"medium-height":157,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","medium_large-width":768,"medium_large-height":260,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","large-width":1258,"large-height":426,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","1536x1536-width":1258,"1536x1536-height":426,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","2048x2048-width":1258,"2048x2048-height":426,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM-826x280.png","card_image-width":826,"card_image-height":280,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/07\/Screen-Shot-2020-07-09-at-12.31.38-PM.png","wide_image-width":1258,"wide_image-height":426}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster\/index.html"},{"acf_fc_layout":"content","content":"<p>You can define cluster <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-FeatureReductionCluster.html#labelingInfo\">labels<\/a> and <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-layers-support-FeatureReductionCluster.html#popupTemplate\">popups<\/a> to provide users with additional information about the cluster.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\">layer.featureReduction = {\r\n  type: <span style=\"color: #d14\">\"cluster\"<\/span>,\r\n  clusterRadius: <span style=\"color: #d14\">\"100px\"<\/span>,\r\n  <span style=\"color: #998;font-style: italic\">\/\/ {cluster_count} is an aggregate field containing<\/span>\r\n  <span style=\"color: #998;font-style: italic\">\/\/ the number of features comprised by the cluster<\/span>\r\n  popupTemplate: {\r\n    content: <span style=\"color: #d14\">\"This cluster represents {cluster_count} earthquakes.\"<\/span>,\r\n    fieldInfos: [\r\n      {\r\n        fieldName: <span style=\"color: #d14\">\"cluster_count\"<\/span>,\r\n        format: {\r\n          places: <span style=\"color: #008080\">0<\/span>,\r\n          digitSeparator: <span style=\"color: #333;font-weight: 500\">true<\/span>\r\n        }\r\n      }\r\n    ]\r\n  },\r\n  clusterMinSize: <span style=\"color: #d14\">\"24px\"<\/span>,\r\n  clusterMaxSize: <span style=\"color: #d14\">\"60px\"<\/span>,\r\n  labelingInfo: [\r\n    {\r\n      deconflictionStrategy: <span style=\"color: #d14\">\"none\"<\/span>,\r\n      labelExpressionInfo: {\r\n        expression: <span style=\"color: #d14\">\"Text($feature.cluster_count, '#,###')\"<\/span>\r\n      },\r\n      symbol: {\r\n        type: <span style=\"color: #d14\">\"text\"<\/span>,\r\n        color: <span style=\"color: #d14\">\"#004a5d\"<\/span>,\r\n        font: {\r\n          weight: <span style=\"color: #d14\">\"bold\"<\/span>,\r\n          family: <span style=\"color: #d14\">\"Noto Sans\"<\/span>,\r\n          size: <span style=\"color: #d14\">\"12px\"<\/span>\r\n        }\r\n      },\r\n      labelPlacement: <span style=\"color: #d14\">\"center-center\"<\/span>\r\n    }\r\n  ]\r\n};\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"content","content":"<p>Alternatively, you can use smart mapping methods to generate <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-filter\/index.html\">suggested popup templates and labels<\/a> to apply to the layer.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #333;font-weight: bold\">async<\/span> <span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">generateClusterConfig<\/span>(<span>layer<\/span>) <\/span>{\r\n  <span style=\"color: #998;font-style: italic\">\/\/ generates default popupTemplate<\/span>\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> popupTemplate = <span style=\"color: #333;font-weight: bold\">await<\/span> clusterPopupCreator\r\n    .getTemplates({\r\n      layer\r\n    })\r\n    .then(\r\n      (popupTemplateResponse) =&gt;\r\n        popupTemplateResponse.primaryTemplate.value\r\n    );\r\n\r\n  popupTemplate.title = <span style=\"color: #d14\">\"Cluster summary\"<\/span>;\r\n\r\n  <span style=\"color: #998;font-style: italic\">\/\/ generates default labelingInfo<\/span>\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> { labelingInfo, clusterMinSize } = <span style=\"color: #333;font-weight: bold\">await<\/span> clusterLabelCreator\r\n    .getLabelSchemes({\r\n      layer,\r\n      view\r\n    })\r\n    .then((labelSchemes) =&gt; labelSchemes.primaryScheme);\r\n\r\n  layer.featureReduction = {\r\n    type: <span style=\"color: #d14\">\"cluster\"<\/span>,\r\n    popupTemplate,\r\n    labelingInfo,\r\n    clusterMinSize\r\n  };\r\n}\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"image","image":{"ID":1101521,"id":1101521,"title":"Screen Shot 2020-12-30 at 5.42.37 PM","filename":"Screen-Shot-2020-12-30-at-5.42.37-PM.png","filesize":77950,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/screen-shot-2020-12-30-at-5-42-37-pm","alt":"Clustered places of worship in India. The color of each graphic indicates the predominant religion of the cluster.","author":"6561","description":"","caption":"Clustered places of worship in India. The color of each graphic indicates the predominant religion of the cluster.","name":"screen-shot-2020-12-30-at-5-42-37-pm","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:43:24","modified":"2021-01-04 18:20:15","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1202,"height":539,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","medium-width":464,"medium-height":208,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","medium_large-width":768,"medium_large-height":344,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","large-width":1202,"large-height":539,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","1536x1536-width":1202,"1536x1536-height":539,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","2048x2048-width":1202,"2048x2048-height":539,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM-826x370.png","card_image-width":826,"card_image-height":370,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.42.37-PM.png","wide_image-width":1202,"wide_image-height":539}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"content","content":"<p>Clusters are styled so they match the layer&#8217;s renderer. For example, in the image above, the layer is styled with a <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-renderers-UniqueValueRenderer.html\">UniqueValueRenderer<\/a>, which colors each place of worship based on its religion. Each cluster&#8217;s color (and shape) is determined by the predominant religion contained within the cluster.<\/p>\n"},{"acf_fc_layout":"content","content":"<p>If the renderer styles the layer with a color, size, rotation, or opacity visual variable, the average value of the attribute among features in the cluster is used to render the cluster. <\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1101531,"id":1101531,"title":"Screen Shot 2020-12-30 at 5.41.41 PM","filename":"Screen-Shot-2020-12-30-at-5.41.41-PM.png","filesize":115768,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/screen-shot-2020-12-30-at-5-41-41-pm","alt":"This layer visualizes the mW capacity of power plants using color. When clustering is enabled, the average capacity of the power plants in the cluster determines the color of the cluster graphic.","author":"6561","description":"","caption":"This layer visualizes the MW capacity of power plants using color. When clustering is enabled, the average capacity of the power plants in the cluster determines the color of the cluster graphic.","name":"screen-shot-2020-12-30-at-5-41-41-pm","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:43:30","modified":"2021-01-04 20:20:03","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1364,"height":450,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","medium-width":464,"medium-height":153,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","medium_large-width":768,"medium_large-height":253,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","large-width":1364,"large-height":450,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","1536x1536-width":1364,"1536x1536-height":450,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","2048x2048-width":1364,"2048x2048-height":450,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM-826x273.png","card_image-width":826,"card_image-height":273,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.41.41-PM.png","wide_image-width":1364,"wide_image-height":450}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/jsapi.maps.arcgis.com\/apps\/mapviewer\/index.html?webmap=ffe3baf032ec43c9afa7dd434791cfb6"},{"acf_fc_layout":"content","content":"<p><a name=\"query-cluster-features\"><\/a><\/p>\n<h2>Query cluster features<\/h2>\n<p>Version 4.18 of the ArcGIS JS API adds support for querying cluster features. This is done with the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-tasks-support-Query.html#aggregateIds\">aggregateIds<\/a> property of the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-tasks-support-Query.html\">Query<\/a> object. Simply pass the ObjectID of the cluster graphic to this property, and use it to query the clustered layer&#8217;s layer view.<\/p>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #333;font-weight: bold\">const<\/span> layerView = <span style=\"color: #333;font-weight: bold\">await<\/span> view.whenLayerView(layer);\r\n<span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\nquery.aggregateIds = [ clusterGraphic.getObjectId() ];\r\n<span style=\"color: #998;font-style: italic\">\/\/ specify any other query parameters and execute the query<\/span>\r\n<span style=\"color: #333;font-weight: bold\">const<\/span> { features } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryFeatures(query);\r\n<span style=\"color: #998;font-style: italic\">\/\/ do something with these features\u2026<\/span>\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"sidebar","content":"<p>The code snippets throughout this post leverage <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/JavaScript\/Asynchronous\/Async_await\">async\/await<\/a> to handle <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Promise\">promises<\/a> returned from client-side queries. The async\/await pattern allows you to write asynchronous code as if it were synchronous. This modern approach makes the code simpler and easier to read.<\/p>\n<p>The following example translates the previous code snippet from the async\/await syntax to using <code>then()<\/code> callbacks.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\">\r\nview.whenLayerView(layer)\r\n  .then(<span><span style=\"color: #333;font-weight: bold\">function<\/span>(<span>layerView<\/span>)<\/span>{\r\n    <span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\n    query.aggregateIds = [ clusterGraphic.getObjectId() ];\r\n    <span style=\"color: #998;font-style: italic\">\/\/ specify any other query parameters and execute the query<\/span>\r\n\r\n    layerView.queryFeatures(query)\r\n      .then(<span><span style=\"color: #333;font-weight: bold\">function<\/span>(<span>featureSet<\/span>)<\/span>{\r\n        <span style=\"color: #333;font-weight: bold\">const<\/span> features = featureSet.features;\r\n        <span style=\"color: #998;font-style: italic\">\/\/ do something with these features\u2026<\/span>\r\n      });\r\n  });\r\n<\/code><\/pre>\n<\/details>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"content","content":"<p>Prior to executing the query, however, you should ensure the ObjectID of the selected graphic belongs to a cluster graphic and not an individual feature. I check the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-Graphic.html#isAggregate\">isAggregate<\/a> property on the graphic prior to each query using the function below.<\/p>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">processParams<\/span>(<span>graphic, layerView<\/span>) <\/span>{\r\n  <span style=\"color: #333;font-weight: bold\">if<\/span> (!graphic || !layerView) {\r\n    <span style=\"color: #333;font-weight: bold\">throw<\/span> <span style=\"color: #333;font-weight: bold\">new<\/span> <span style=\"color: #0086b3\">Error<\/span>(<span style=\"color: #d14\">\"Graphic or layerView not provided.\"<\/span>);\r\n  }\r\n\r\n  <span style=\"color: #333;font-weight: bold\">if<\/span> (!graphic.isAggregate) {\r\n    <span style=\"color: #333;font-weight: bold\">throw<\/span> <span style=\"color: #333;font-weight: bold\">new<\/span> <span style=\"color: #0086b3\">Error<\/span>(<span style=\"color: #d14\">\"Graphic must represent a cluster.\"<\/span>);\r\n  }\r\n}\r\n<\/code><\/pre>\n<p>I will follow this pattern of querying clusters within popup actions to demonstrate each of the following scenarios in <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/live\/index.html\">this app<\/a>:<\/p>\n<ul>\n<li><a href=\"#extent\">Display the extent or convex hull of clustered features<\/a><\/li>\n<li><a href=\"#display\">Display all features belonging to a cluster<\/a><\/li>\n<li><a href=\"#stats\">Display summary statistics for a cluster in a popup<\/a><\/li>\n<li><a href=\"#browse\">Allow users to browse clustered features in a popup or view<\/a><\/li>\n<\/ul>\n<p><a name=\"extent\"><\/a><\/p>\n<h2>Display the extent or convex hull of clustered features<\/h2>\n<p>When clustering is enabled, the spatial dispersion of clustered features isn&#8217;t immediately obvious. Displaying the extent of a cluster&#8217;s features helps the user understand the area claimed by the cluster.<\/p>\n<p>To display the extent, simply call the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-views-layers-FeatureLayerView.html#queryExtent\">queryExtent<\/a> method on the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-views-layers-LayerView.html\">layer view<\/a> after specifying the cluster&#8217;s ObjectID in the query.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #333;font-weight: bold\">async<\/span> <span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">displayClusterExtent<\/span>(<span>graphic<\/span>) <\/span>{\r\n  processParams(graphic, layerView);\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\n  query.aggregateIds = [ graphic.getObjectId() ];\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> { extent } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryExtent(query);\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> extentGraphic = {\r\n    geometry: extent,\r\n    symbol: {\r\n      type: <span style=\"color: #d14\">\"simple-fill\"<\/span>,\r\n      outline: {\r\n        width: <span style=\"color: #008080\">1.5<\/span>,\r\n        color: [<span style=\"color: #008080\">75<\/span>, <span style=\"color: #008080\">75<\/span>, <span style=\"color: #008080\">75<\/span>, <span style=\"color: #008080\">1<\/span>]\r\n      },\r\n      style: <span style=\"color: #d14\">\"none\"<\/span>,\r\n      color: [<span style=\"color: #008080\">0<\/span>, <span style=\"color: #008080\">0<\/span>, <span style=\"color: #008080\">0<\/span>, <span style=\"color: #008080\">0.1<\/span>]\r\n    }\r\n  };\r\n  view.graphics.add(extentGraphic);\r\n}\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"image","image":{"ID":1101421,"id":1101421,"title":"Screen Shot 2020-12-30 at 5.02.37 PM","filename":"Screen-Shot-2020-12-30-at-5.02.37-PM.png","filesize":56199,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/screen-shot-2020-12-30-at-5-02-37-pm","alt":"Clustered power plants with a square graphic indicating the cluster's extent.","author":"6561","description":"","caption":"","name":"screen-shot-2020-12-30-at-5-02-37-pm","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:32:00","modified":"2021-01-04 18:25:12","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":901,"height":326,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","medium-width":464,"medium-height":168,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","medium_large-width":768,"medium_large-height":278,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","large-width":901,"large-height":326,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","1536x1536-width":901,"1536x1536-height":326,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","2048x2048-width":901,"2048x2048-height":326,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM-826x299.png","card_image-width":826,"card_image-height":299,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.37-PM.png","wide_image-width":901,"wide_image-height":326}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"content","content":"<p>While viewing the extent is instructive, the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Convex_hull\">convex hull<\/a> provides a more accurate representation of the spatial footprint of the clustered features. You can calculate the convex hull using the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-geometry-geometryEngine.html\">geometryEngine<\/a>.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #333;font-weight: bold\">async<\/span> <span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">displayConvexHull<\/span>(<span>graphic<\/span>) <\/span>{\r\n  processParams(graphic, layerView);\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\n  query.aggregateIds = [graphic.getObjectId()];\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> { features } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryFeatures(query);\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> geometries = features.map((feature) =&gt; feature.geometry);\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> [ convexHull ] = geometryEngine.convexHull(geometries, <span style=\"color: #333;font-weight: 500\">true<\/span>);\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> convexHullGraphic = {\r\n    geometry: convexHull,\r\n    symbol: {\r\n      type: <span style=\"color: #d14\">\"simple-fill\"<\/span>,\r\n      outline: {\r\n        width: <span style=\"color: #008080\">1.5<\/span>,\r\n        color: [<span style=\"color: #008080\">75<\/span>, <span style=\"color: #008080\">75<\/span>, <span style=\"color: #008080\">75<\/span>, <span style=\"color: #008080\">1<\/span>]\r\n      },\r\n      style: <span style=\"color: #d14\">\"none\"<\/span>,\r\n      color: [<span style=\"color: #008080\">0<\/span>, <span style=\"color: #008080\">0<\/span>, <span style=\"color: #008080\">0<\/span>, <span style=\"color: #008080\">0.1<\/span>]\r\n    }\r\n  };\r\n  view.graphics.add(convexHullGraphic);\r\n}\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"image","image":{"ID":1101431,"id":1101431,"title":"Screen Shot 2020-12-30 at 5.02.46 PM","filename":"Screen-Shot-2020-12-30-at-5.02.46-PM.png","filesize":50408,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/screen-shot-2020-12-30-at-5-02-46-pm","alt":"Clustered power plants with a graphic indicating the cluster's convex hull.","author":"6561","description":"","caption":"","name":"screen-shot-2020-12-30-at-5-02-46-pm","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:32:21","modified":"2021-01-04 18:25:36","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":898,"height":321,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","medium-width":464,"medium-height":166,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","medium_large-width":768,"medium_large-height":275,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","large-width":898,"large-height":321,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","1536x1536-width":898,"1536x1536-height":321,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","2048x2048-width":898,"2048x2048-height":321,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM-826x295.png","card_image-width":826,"card_image-height":295,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.02.46-PM.png","wide_image-width":898,"wide_image-height":321}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"content","content":"<p><a name=\"display\"><\/a><\/p>\n<h2>Display all features in the view<\/h2>\n<p>There may be occasions when you want to display all features, or just a few of the clustered features directly in the view. For example, if you have a layer of clustered traffic incidents, perhaps you want to give the user the ability to display only features that represent fatalities. <\/p>\n<p>To accomplish this, simply add the features returned from the query directly to the view. Remember to set a symbol to the returned graphics. I use the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-symbols-support-symbolUtils.html#getDisplayedSymbol\">getDisplayedSymbol<\/a> method to ensure the symbol matches the renderer of the layer.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #998;font-style: italic\">\/\/ displays all features from a given cluster in the view<\/span>\r\n<span style=\"color: #333;font-weight: bold\">async<\/span> <span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">displayFeatures<\/span>(<span>graphic<\/span>) <\/span>{\r\n  processParams(graphic, layerView);\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\n  query.aggregateIds = [graphic.getObjectId()];\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> { features } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryFeatures(query);\r\n\r\n  features.forEach(<span style=\"color: #333;font-weight: bold\">async<\/span> (feature) =&gt; {\r\n    <span style=\"color: #333;font-weight: bold\">const<\/span> symbol = <span style=\"color: #333;font-weight: bold\">await<\/span> symbolUtils.getDisplayedSymbol(feature);\r\n    feature.symbol = symbol;\r\n    view.graphics.add(feature);\r\n  });\r\n}\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"image","image":{"ID":1101481,"id":1101481,"title":"Screen Shot 2020-12-30 at 5.35.17 PM","filename":"Screen-Shot-2020-12-30-at-5.35.17-PM.png","filesize":52686,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/screen-shot-2020-12-30-at-5-35-17-pm","alt":"Clustered power plants. One cluster shows all features in the cluster.","author":"6561","description":"","caption":"","name":"screen-shot-2020-12-30-at-5-35-17-pm","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:35:49","modified":"2021-01-04 18:26:23","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":879,"height":322,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","medium-width":464,"medium-height":170,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","medium_large-width":768,"medium_large-height":281,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","large-width":879,"large-height":322,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","1536x1536-width":879,"1536x1536-height":322,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","2048x2048-width":879,"2048x2048-height":322,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM-826x303.png","card_image-width":826,"card_image-height":303,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.35.17-PM.png","wide_image-width":879,"wide_image-height":322}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"sidebar","content":"<p>Keep in mind that clusters are no longer valid once the view&#8217;s scale changes. So features displayed in the view (and any other cluster information displayed to the user) should be cleared once the view&#8217;s scale updates.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<p><a name=\"stats\"><\/a><\/p>\n<h2>Display summary statistics<\/h2>\n<p>The popup displays useful information, such as cluster count, predominant value of string fields, and the average value of numeric fields. However, sometimes the suggested cluster popup doesn\u2019t display enough information to the user.<\/p>\n<p>In the case of a layer rendered with a UniqueValueRenderer, you may want to display the count of each category in the cluster rather than display only the total count with the predominant value.<\/p>\n<p>You can get this information with the <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-tasks-support-Query.html#outStatistics\">outStatistics<\/a> and <a href=\"https:\/\/developers.arcgis.com\/javascript\/latest\/api-reference\/esri-tasks-support-Query.html#groupByFieldsForStatistics\">groupByFieldsForStatistics<\/a> query parameters.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #333;font-weight: bold\">async<\/span> <span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">calculateStatistics<\/span>(<span>graphic<\/span>) <\/span>{\r\n  processParams(graphic, layerView);\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\n  query.aggregateIds = [graphic.getObjectId()];\r\n  query.groupByFieldsForStatistics = [<span style=\"color: #d14\">\"fuel1\"<\/span>];\r\n  query.outFields = [<span style=\"color: #d14\">\"capacity_mw\"<\/span>, <span style=\"color: #d14\">\"fuel1\"<\/span>];\r\n  query.orderByFields = [<span style=\"color: #d14\">\"num_features desc\"<\/span>];\r\n  query.outStatistics = [\r\n    {\r\n      onStatisticField: <span style=\"color: #d14\">\"capacity_mw\"<\/span>,\r\n      outStatisticFieldName: <span style=\"color: #d14\">\"capacity_total\"<\/span>,\r\n      statisticType: <span style=\"color: #d14\">\"sum\"<\/span>\r\n    },\r\n    {\r\n      onStatisticField: <span style=\"color: #d14\">\"1\"<\/span>,\r\n      outStatisticFieldName: <span style=\"color: #d14\">\"num_features\"<\/span>,\r\n      statisticType: <span style=\"color: #d14\">\"count\"<\/span>\r\n    },\r\n    {\r\n      onStatisticField: <span style=\"color: #d14\">\"capacity_mw\"<\/span>,\r\n      outStatisticFieldName: <span style=\"color: #d14\">\"capacity_max\"<\/span>,\r\n      statisticType: <span style=\"color: #d14\">\"max\"<\/span>\r\n    }\r\n  ];\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> { features } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryFeatures(query);\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> stats = features.map((feature) =&gt; feature.attributes);\r\n\r\n  <span style=\"color: #998;font-style: italic\">\/\/ display stats in the popup or some other element<\/span>\r\n}\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"image","image":{"ID":1101441,"id":1101441,"title":"Screen Shot 2020-12-30 at 5.03.01 PM","filename":"Screen-Shot-2020-12-30-at-5.03.01-PM.png","filesize":51922,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/screen-shot-2020-12-30-at-5-03-01-pm","alt":"Clustered power plants with a popup showing statistics for the selected cluster.","author":"6561","description":"","caption":"","name":"screen-shot-2020-12-30-at-5-03-01-pm","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:33:05","modified":"2021-01-04 18:27:12","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":900,"height":381,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","medium-width":464,"medium-height":196,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","medium_large-width":768,"medium_large-height":325,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","large-width":900,"large-height":381,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","1536x1536-width":900,"1536x1536-height":381,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","2048x2048-width":900,"2048x2048-height":381,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM-826x350.png","card_image-width":826,"card_image-height":350,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/Screen-Shot-2020-12-30-at-5.03.01-PM.png","wide_image-width":900,"wide_image-height":381}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"content","content":"<p>Once the statistics are returned, you can display the results in the popup, or in another UI element, such as a table or chart. You can make the statistical summaries as simple or as complex as you want. The <a href=\"https:\/\/codepen.io\/kekenes\/full\/wvzjBxm\">example below<\/a> displays multiple charts summarizing the selected cluster&#8217;s data.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1101501,"id":1101501,"title":"cluster-query","filename":"cluster-query.gif","filesize":793212,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/cluster-query","alt":"This app displays 10 years of homicide data and summarizes it based on whether the crime was solved and the age, gender, and race of the victims. Each time the user clicks a cluster, the cluster is summarized by the charts to the right.","author":"6561","description":"","caption":"This app displays 10 years of homicide data and summarizes it based on whether the crime was solved and the age, gender, and race of the victims. Each time the user clicks a cluster, the cluster is summarized by the charts to the right.","name":"cluster-query","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:39:53","modified":"2020-12-31 01:45:58","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":810,"height":452,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","medium-width":464,"medium-height":259,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","medium_large-width":768,"medium_large-height":429,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","large-width":810,"large-height":452,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","1536x1536-width":810,"1536x1536-height":452,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","2048x2048-width":810,"2048x2048-height":452,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","card_image-width":810,"card_image-height":452,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/cluster-query.gif","wide_image-width":810,"wide_image-height":452}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/codepen.io\/kekenes\/full\/wvzjBxm"},{"acf_fc_layout":"content","content":"<p><a name=\"browse\"><\/a><\/p>\n<h2>Browse features<\/h2>\n<p>While summaries and charts can be extremely useful,  there are cases when the user would rather drill into the cluster and browse the popups of individual features. You can do this by querying for all features in the cluster and pushing them to the view\u2019s popup.<\/p>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #998;font-style: italic\">\/\/ push all features in cluster to the popup features<\/span>\r\n<span style=\"color: #998;font-style: italic\">\/\/ to allow users to browse their popup templates<\/span>\r\n<span style=\"color: #333;font-weight: bold\">const<\/span> { features } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryFeatures(query);\r\nview.popup.features = features;\r\n<\/code><\/pre>\n<p>When a feature is selected in the popup, you can also display its location in the map. Again, don\u2019t forget to set a symbol on the graphic.<\/p>\n<details>\n<summary><strong>Click to view code snippet<\/strong><\/summary>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\"><span style=\"color: #333;font-weight: bold\">async<\/span> <span><span style=\"color: #333;font-weight: bold\">function<\/span> <span style=\"color: #900;font-weight: bold\">browseFeatures<\/span>(<span>graphic<\/span>) <\/span>{\r\n  processParams(graphic, layerView);\r\n\r\n  displayConvexHull(graphic);\r\n\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> query = layerView.createQuery();\r\n  query.aggregateIds = [graphic.getObjectId()];\r\n\r\n  <span style=\"color: #998;font-style: italic\">\/\/ push all features in cluster to the popup features<\/span>\r\n  <span style=\"color: #998;font-style: italic\">\/\/ to allow users to browse their popup templates<\/span>\r\n  <span style=\"color: #333;font-weight: bold\">const<\/span> { features } = <span style=\"color: #333;font-weight: bold\">await<\/span> layerView.queryFeatures(query);\r\n  view.popup.features = [graphic].concat(features);\r\n\r\n  <span style=\"color: #998;font-style: italic\">\/\/ when user selects a feature in the cluster, display its location in the view<\/span>\r\n  selectedFeatureHandle = view.popup.watch(\r\n    <span style=\"color: #d14\">\"selectedFeature\"<\/span>,\r\n    <span style=\"color: #333;font-weight: bold\">async<\/span> (feature) =&gt; {\r\n      <span style=\"color: #333;font-weight: bold\">if<\/span> (!feature || feature?.isAggregate) {\r\n        <span style=\"color: #333;font-weight: bold\">return<\/span>;\r\n      }\r\n      <span style=\"color: #333;font-weight: bold\">const<\/span> symbol = <span style=\"color: #333;font-weight: bold\">await<\/span> symbolUtils.getDisplayedSymbol(feature);\r\n      symbol.outline = {\r\n        color: [<span style=\"color: #008080\">50<\/span>, <span style=\"color: #008080\">50<\/span>, <span style=\"color: #008080\">50<\/span>, <span style=\"color: #008080\">0.75<\/span>],\r\n        width: <span style=\"color: #008080\">0.5<\/span>\r\n      };\r\n      feature.symbol = symbol;\r\n\r\n      <span style=\"color: #333;font-weight: bold\">if<\/span> (selectedFeature &amp;&amp; view.graphics.includes(selectedFeature)) {\r\n        view.graphics.remove(selectedFeature);\r\n        selectedFeature = <span style=\"color: #333;font-weight: 500\">null<\/span>;\r\n      }\r\n      view.graphics.add(feature);\r\n      selectedFeature = feature;\r\n    }\r\n  );\r\n}\r\n<\/code><\/pre>\n<\/details>\n"},{"acf_fc_layout":"image","image":{"ID":1101461,"id":1101461,"title":"browse-features","filename":"browse-features.gif","filesize":204664,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\/browse-features","alt":"","author":"6561","description":"","caption":"","name":"browse-features","status":"inherit","uploaded_to":1100961,"date":"2020-12-31 01:34:00","modified":"2020-12-31 01:34:00","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":690,"height":300,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","medium-width":464,"medium-height":202,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","medium_large-width":690,"medium_large-height":300,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","large-width":690,"large-height":300,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","1536x1536-width":690,"1536x1536-height":300,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","2048x2048-width":690,"2048x2048-height":300,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","card_image-width":690,"card_image-height":300,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/browse-features.gif","wide_image-width":690,"wide_image-height":300}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/developers.arcgis.com\/javascript\/latest\/sample-code\/featurereduction-cluster-query\/index.html"},{"acf_fc_layout":"content","content":"<h2>Conclusion<\/h2>\n<p>While you can display lots of detailed information for clusters, it is important to remember you shouldn\u2019t use summary statistics from clusters as if it were the result of a scientific study. Clusters do not represent statistically significant hot spots. Instead, clustering is the result of aggregating points according to geohashes (spatial grids) to declutter the view.<\/p>\n<p>Also, once the view\u2019s extent changes either by zooming in or out, a cluster&#8217;s information in the previous view is no longer relevant and should be discarded.<\/p>\n<p>Thanks for reading! Please reach out in the comments or email me directly if you have any questions or suggestions for improving to our clustering implementation.<\/p>\n"}],"authors":[{"ID":6561,"user_firstname":"Kristian","user_lastname":"Ekenes","nickname":"Kristian Ekenes","user_nicename":"kekenes","display_name":"Kristian Ekenes","user_email":"KEkenes@esri.com","user_url":"https:\/\/github.com\/ekenes","user_registered":"2018-03-02 00:18:32","user_description":"Kristian Ekenes is a Principal Product Engineer at Esri specializing in data visualization on the web. He works on the ArcGIS Maps SDK for JavaScript, ArcGIS Arcade, and Map Viewer in ArcGIS Online. Kristian's work focuses on researching and developing new and innovative data visualization capabilities of geospatial data in web maps, Arcade integration in web maps, and applications of generative AI assistants in web maps. Prior to joining Esri, he worked as a GIS Specialist for an environmental consulting company. Kristian has degrees from Brigham Young University and Arizona State University.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":[{"ID":686592,"post_author":"6561","post_date":"2020-01-07 08:00:08","post_date_gmt":"2020-01-07 16:00:08","post_content":"","post_title":"Point clustering now available in ArcGIS JavaScript 4.x API","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"point-clustering-now-available-in-arcgis-javascript-4-x-api","to_ping":"","pinged":"","post_modified":"2020-01-07 08:02:58","post_modified_gmt":"2020-01-07 16:02:58","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=686592","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":79881,"post_author":"6561","post_date":"2017-10-11 08:00:12","post_date_gmt":"2017-10-11 08:00:12","post_content":"","post_title":"Thematic point clustering for data exploration","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"thematic-point-clustering-for-data-exploration","to_ping":"","pinged":"","post_modified":"2018-05-11 18:12:32","post_modified_gmt":"2018-05-11 18:12:32","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/products\/product\/uncategorized\/thematic-point-clustering-for-data-exploration\/","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":922831,"post_author":"6561","post_date":"2020-07-09 13:00:29","post_date_gmt":"2020-07-09 20:00:29","post_content":"","post_title":"Labeling support added to point clustering","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"labels-now-supported-in-point-clustering","to_ping":"","pinged":"","post_modified":"2020-07-10 09:45:42","post_modified_gmt":"2020-07-10 16:45:42","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=922831","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"1","filter":"raw"}],"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/card.jpg","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/banner-4.jpg"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Summarize and explore point clusters in web apps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Summarize and explore point clusters in web apps\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-06T17:42:30+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\"},\"author\":{\"name\":\"Kristian Ekenes\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/5469f723fbfb78138efbb1da56e6aa9b\"},\"headline\":\"Summarize and explore point clusters in web apps\",\"datePublished\":\"2021-01-05T17:00:40+00:00\",\"dateModified\":\"2021-01-06T17:42:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\"},\"wordCount\":8,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"clustering\",\"data exploration\",\"smart mapping\",\"Summary Statistics\"],\"articleSection\":[\"Mapping\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\",\"name\":\"Summarize and explore point clusters in web apps\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2021-01-05T17:00:40+00:00\",\"dateModified\":\"2021-01-06T17:42:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Summarize and explore point clusters in web apps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/5469f723fbfb78138efbb1da56e6aa9b\",\"name\":\"Kristian Ekenes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png\",\"caption\":\"Kristian Ekenes\"},\"description\":\"Kristian Ekenes is a Principal Product Engineer at Esri specializing in data visualization on the web. He works on the ArcGIS Maps SDK for JavaScript, ArcGIS Arcade, and Map Viewer in ArcGIS Online. Kristian's work focuses on researching and developing new and innovative data visualization capabilities of geospatial data in web maps, Arcade integration in web maps, and applications of generative AI assistants in web maps. Prior to joining Esri, he worked as a GIS Specialist for an environmental consulting company. Kristian has degrees from Brigham Young University and Arizona State University.\",\"sameAs\":[\"https:\/\/github.com\/ekenes\",\"https:\/\/www.linkedin.com\/in\/kristian-ekenes\/\",\"https:\/\/x.com\/kekenes\"],\"gender\":\"male\",\"jobTitle\":\"Principal Product Engineer\",\"worksFor\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/kekenes\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Summarize and explore point clusters in web apps","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps","og_locale":"en_US","og_type":"article","og_title":"Summarize and explore point clusters in web apps","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2021-01-06T17:42:30+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps"},"author":{"name":"Kristian Ekenes","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/5469f723fbfb78138efbb1da56e6aa9b"},"headline":"Summarize and explore point clusters in web apps","datePublished":"2021-01-05T17:00:40+00:00","dateModified":"2021-01-06T17:42:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps"},"wordCount":8,"commentCount":1,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["clustering","data exploration","smart mapping","Summary Statistics"],"articleSection":["Mapping"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps","name":"Summarize and explore point clusters in web apps","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2021-01-05T17:00:40+00:00","dateModified":"2021-01-06T17:42:30+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/js-api-arcgis\/mapping\/summarize-and-explore-point-clusters-in-web-apps#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Summarize and explore point clusters in web apps"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/5469f723fbfb78138efbb1da56e6aa9b","name":"Kristian Ekenes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/10\/ekenes-zurich-213x200.png","caption":"Kristian Ekenes"},"description":"Kristian Ekenes is a Principal Product Engineer at Esri specializing in data visualization on the web. He works on the ArcGIS Maps SDK for JavaScript, ArcGIS Arcade, and Map Viewer in ArcGIS Online. Kristian's work focuses on researching and developing new and innovative data visualization capabilities of geospatial data in web maps, Arcade integration in web maps, and applications of generative AI assistants in web maps. Prior to joining Esri, he worked as a GIS Specialist for an environmental consulting company. Kristian has degrees from Brigham Young University and Arizona State University.","sameAs":["https:\/\/github.com\/ekenes","https:\/\/www.linkedin.com\/in\/kristian-ekenes\/","https:\/\/x.com\/kekenes"],"gender":"male","jobTitle":"Principal Product Engineer","worksFor":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/kekenes"}]}},"text_date":"January 5, 2021","author_name":"Kristian Ekenes","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/kekenes","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/01\/banner-4.jpg","primary_product":"ArcGIS Maps SDK for JavaScript","tag_data":[{"term_id":26751,"name":"clustering","slug":"clustering","term_group":0,"term_taxonomy_id":26751,"taxonomy":"post_tag","description":"","parent":0,"count":23,"filter":"raw"},{"term_id":34601,"name":"data exploration","slug":"data-exploration","term_group":0,"term_taxonomy_id":34601,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw"},{"term_id":24581,"name":"smart mapping","slug":"smart-mapping","term_group":0,"term_taxonomy_id":24581,"taxonomy":"post_tag","description":"","parent":0,"count":81,"filter":"raw"},{"term_id":30061,"name":"Summary Statistics","slug":"summary-statistics","term_group":0,"term_taxonomy_id":30061,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw"}],"category_data":[{"term_id":22941,"name":"Mapping","slug":"mapping","term_group":0,"term_taxonomy_id":22941,"taxonomy":"category","description":"","parent":0,"count":2683,"filter":"raw"}],"product_data":[{"term_id":36831,"name":"ArcGIS Maps SDK for JavaScript","slug":"js-api-arcgis","term_group":0,"term_taxonomy_id":36831,"taxonomy":"product","description":"","parent":36601,"count":361,"filter":"raw"},{"term_id":36601,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":36601,"taxonomy":"product","description":"","parent":0,"count":761,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=js-api-arcgis","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1100961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/6561"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=1100961"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1100961\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=1100961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=1100961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=1100961"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=1100961"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=1100961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}