BUG: FeatureReduction Clustering symbolization in 4.25+

717
5
05-08-2023 03:17 AM
KrzysztofNoga
New Contributor II

Clustering symbology based on layer unique-value renderer does not work properly as of version 4.25.

sample: https://codesandbox.io/s/distracted-proskuriakova-xehibz?file=/index.html 

 

0 Kudos
5 Replies
KristianEkenes
Esri Regular Contributor

This is actually a result of a bug "fix" related to cluster visualizations with unique value renderer. Neither visual is great in my opinion. Without a cluster renderer, the cluster uses the symbol of the most common category (or uniqueValueInfo) contained within the cluster. Your dataset involves tie values. Prior to 4.25, in the case of a tie where the most common category was in a tie with another category, the rendering engine just picked one of the symbols and used it. This is problematic since it portrays predominance in one category when it doesn't actually exist. At 4.25, we updated this to match our predominance renderer for layers so tie values are represented with the default symbol. I don't think this is a perfect solution as the default symbol makes it look like the features don't belong to any of the categories. There are a couple of things you can do to change the visual.

1. Use a pie chart renderer for the cluster style. This will show the actual breakdown of categories within the cluster. This is great for scenarios where predominance can be misleading even when tie values are not involved. However, it can make it hard to read if a lot of categories are in play. In your scenario, where there are only 3 categories (a fourth being tie values), I think this is a fine option.

2. You can update the defaultSymbol on the layer style and indicate it represents "tie values" by setting a defaultLabel. 

3. You can override the default cluster renderer with your own unique value renderer accounting for ties using a distinct symbol. 

 

Hopefully that helps.

 

KrzysztofNoga
New Contributor II

1. I don't want to change the presentation type. This was just a simple example, I have more complex cases.

2. it's not enough

3. this solution fails, because it doesn't display the individual features (clusters of size 1)
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureReductionCl...

"Keep in mind that the renderer defined here overrides the style of all features in the view, including individual features (clusters of size 1)"

I would like to restore the behavior from 4.24. This is a big breaking change in my opinion, which causes a lot of problems when upgrading the API to newer versions.

0 Kudos
KristianEkenes
Esri Regular Contributor

1. I need more detail here. Specifically, what are the more complex cases? Is it just that you have more categories?

3. I think you misunderstood that line of documentation. Individual features are displayed. That line is specifying how those features get their symbol. If you specify a cluster renderer, all features (clusters and individual features) are styled using the cluster renderer. That is what is meant by "cluster renderer overrides the style of the features in the view". If you don't specify a cluster renderer, the cluster style is inferred from the layer renderer, which determines how individual features are styled.

This isn't a change we're going to revert. The previous behavior is wrong even if that's what you were used to. Many people called support pointing this out and requesting this change. I suggest using the pie chart style in your scenario. If I see a lot of default symbols in clusters in a scenario like this, that tells me that pie chart is more appropriate anyway since there is no clear pattern of predominance. You also have options for how many categories to display in pie chart clusters...and individual features will display with the color of the category to which they belong as a solid color.

Since the behavior was incorrect previously, I don't consider this a breaking change. If you notice strong visual differences in this scenario with clustering when upgrading the API version, it's exposing the problems we had in previous versions of the API, rather than the introduction of a bug in newer versions.

0 Kudos
KrzysztofNoga
New Contributor II

This behavior has been available since version 4.14.

Developing existing software I can't change that. I can't update the API to the latest version for this reason.

the documentation below needs improvement? Or maybe I don't understand her?

https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureReductionCl...

Zrzut ekranu 2023-05-12 o 08.47.38.png

 

3. I think I understood it well. Can single objects be symbolized according to the layer renderer and additionally have a defined renderer for clusters (at the same time)? I don't think it works like that, but I'll check it out.

 

Anyway, can't you get the same effect now as before?

0 Kudos
KrzysztofNoga
New Contributor II

What can we do about it? I understand that the previous behavior will not be restored?

0 Kudos