Skip to content

Commit

Permalink
feat(plugin-chart-cartodiagram): add support for dashboard filters
Browse files Browse the repository at this point in the history
  • Loading branch information
jansule committed Jun 28, 2024
1 parent 8b59fc8 commit f44ae62
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@ import { QueryFormData, getChartBuildQueryRegistry } from '@superset-ui/core';
* if a viz needs multiple different result sets.
*/
export default function buildQuery(formData: QueryFormData) {
const { selected_chart: selectedChartString, geom_column: geometryColumn } =
formData;
const {
selected_chart: selectedChartString,
geom_column: geometryColumn,
extra_form_data: extraFormData,
} = formData;
const selectedChart = JSON.parse(selectedChartString);
const vizType = selectedChart.viz_type;
const chartFormData = JSON.parse(selectedChart.params);
// Pass extra_form_data to chartFormData so that
// dashboard filters will also be applied to the charts
// on the map.
chartFormData.extra_form_data = {
...chartFormData.extra_form_data,
...extraFormData,
};

// adapt groupby property to ensure geometry column always exists
// and is always at first position
Expand Down

0 comments on commit f44ae62

Please sign in to comment.