villebro commented on code in PR #20010:
URL: https://github.com/apache/superset/pull/20010#discussion_r873586913
##########
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx:
##########
@@ -517,6 +517,11 @@ const config: ControlPanelConfig = {
],
},
],
+ denormalizeFormData: formData => ({
+ ...formData,
+ metrics: formData.standardized_form_data.sharedFormData.metrics,
Review Comment:
Thanks for the response - I must have had something wrong with my devenv, as
after I reloaded it worked just like you described 👍 To add to this comment:
> So I think that when we transition from Pivot Table to any other chart we
should join values from Rows and Columns, remove duplicates and populate
Dimensions of the new viz with the result
I think we should keep the duplicates in the normalized form data, but we
could enrich the interface so that we know where the values came from:
```typescript
export interface SharedFormData {
metrics: {
value: QueryFormMetric;
sourceViz: string;
sourceControl: string;
}[];
columns: {
value: QueryFormColumn;
sourceViz: string;
sourceControl: string;
}[];
}
```
This way the pie chart might not care if the metric was from `metrics` or
`percent_metrics`, but some other chart might decide to map the values over
differently, depending on where the value came from. This is especially true
for the `x_axis` control, which in a sense is a column/groupby, but should be
handled differently from the series control.
--
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]