in packages/attribute-slicer-powerbi/src/state/index.ts [500:530]
reverseOrder: getOrDefault(reverseOrder, false),
equals: (other: IColorSettings) => {
if (other) {
const otherGradient = other.gradient || undefined;
const gradient = me.gradient || undefined;
if ((gradient && !otherGradient) || (otherGradient && !gradient)) {
return false;
}
const otherInstances = other.instanceColors || [];
const instanceColors = me.instanceColors || [];
if (otherInstances.length !== instanceColors.length) {
return false;
}
const anyInstanceChanges = instanceColors.some((n, j) => {
const otherInstance = otherInstances[j];
return (
otherInstance.name !== n.name || otherInstance.color !== n.color
);
});
return (
!anyInstanceChanges &&
gradientEquals(gradient, otherGradient) &&
me.reverseOrder === other.reverseOrder &&
me.colorMode === other.colorMode
);
}
return false;
},