aminghadersohi commented on code in PR #43481:
URL: https://github.com/apache/superset/pull/43481#discussion_r3865463540
##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts:
##########
@@ -145,6 +155,13 @@ export default function transformProps(chartProps:
ChartProps<QueryFormData>) {
data: splitRows[i] as DataRecord[],
groupby: combination,
}));
+ // This result *does* carry the rollup levels, so pick out the leaf level
--
+ // the one grouping every dimension, same definition the splitter uses.
+ const leafIndex = levelLabels.findIndex(labels => {
+ const grouped = new Set(labels);
+ return allGroupbyLabels.every(label => grouped.has(label));
+ });
+ colorScaleRows = (splitRows[leafIndex] as DataRecord[]) ?? [];
Review Comment:
Thanks for flagging this. I validated the behavior end to end. The leaf-only
domain intentionally restores the established pivot/table behavior and keeps
additive and non-additive paths consistent: detail cells define the scale,
while rollups do not extend it. With the `None` comparator, a subtotal above
the leaf maximum is therefore unformatted; bounded comparators still clamp it
to full opacity. Including rollups in this formatter domain would reintroduce
the scale distortion this fix addresses, and teaching subtotal cells to clamp
against a separate leaf-derived scale is a separate rendering/design change
rather than part of this regression fix. The approving reviewer independently
reproduced these cases and agreed this is the correct scoped behavior, so no
code change is needed here.
--
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]