Skip to content

Commit

Permalink
only sort continuous & classified paletteTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
iannesbitt committed Oct 23, 2023
1 parent ee44f2f commit 4280735
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/js/collections/maps/AssetColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ define(
* the beginning or end of the collection, respectively.
* @since 2.25.0
*/
comparator: function (color) {
let value = color.get('value');
if (value === 'min') {
return -Infinity;
} else if (value === 'max') {
return Infinity;
} else {
return value
comparator: function (color, paletteType) {
// Only sort continuous and classified paletteTypes
if (!paletteType === 'categorical') {
let value = color.get('value');
if (value === 'min') {
return -Infinity;
} else if (value === 'max') {
return Infinity;
} else {
return value
}
}
},

Expand Down

1 comment on commit 4280735

@iannesbitt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to tag this as #2184

Please sign in to comment.