rusackas commented on code in PR #42910:
URL: https://github.com/apache/superset/pull/42910#discussion_r3890452661
##########
superset-frontend/plugins/plugin-chart-echarts/src/Bullet/transformProps.ts:
##########
@@ -102,17 +103,27 @@ export default function transformProps(
theme.colorFillSecondary,
theme.colorFill,
];
+ // Custom colors (if any) are authored positionally against the original,
+ // pre-sort `ranges` order via the `range_colors` control -- capture each
+ // range's color here, before the descending sort below reorders them.
const sortedRanges = [...ranges]
- .map((value, i) => ({ value, label: rangeLabels[i] }))
+ .map((value, i) => ({
+ value,
+ label: rangeLabels[i],
+ color: rangeColors?.[i] || undefined,
+ }))
Review Comment:
Confirmed, good catch. `tokenizeToNumericArray` kept `Infinity` (only
dropped `NaN`) while `BulletRangeColorsControl`'s own `parseRanges` already
drops non-finite values, so an overflowing range value desynced the two
positionally-matched lists and shifted `range_colors` onto the wrong band.
Filtered on `Number.isFinite` in both places in 9b6b41e28d, plus a regression
test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]