Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

feat(plugin-chart-table): enable emitting cross-filters #1041

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

kgabryje
Copy link
Contributor

@kgabryje kgabryje commented Apr 6, 2021

This PR enables emitting cross-filters from Table chart.
To enable the feature, set the feature flag DASHBOARD_CROSS_FILTERS in superset/config.py and select "ENABLE EMITTING FILTERS" checkbox in Customize tab.
To select filter values, click on cells in groupby columns. Selecting a value emits a filter with an IN operator.

https://user-images.githubusercontent.com/15073128/113731815-5c084100-96f9-11eb-92c5-bdfb969ae9e9.mov
image

CC @junlincc @villebro @ktmud

@kgabryje kgabryje requested a review from a team as a code owner April 6, 2021 14:59
@vercel
Copy link

vercel bot commented Apr 6, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/superset/superset-ui/4ccueFk7G88KxmjYPyiV4vUGxmui
✅ Preview: https://superset-ui-git-fork-kgabryje-feat-table-cross-filters-superset.vercel.app

@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #1041 (64db684) into master (68a5e00) will increase coverage by 0.39%.
The diff coverage is 15.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1041      +/-   ##
==========================================
+ Coverage   27.65%   28.05%   +0.39%     
==========================================
  Files         428      435       +7     
  Lines        8797     8882      +85     
  Branches     1335     1350      +15     
==========================================
+ Hits         2433     2492      +59     
- Misses       6183     6204      +21     
- Partials      181      186       +5     
Impacted Files Coverage Δ
plugins/plugin-chart-table/src/controlPanel.tsx 0.00% <0.00%> (ø)
plugins/plugin-chart-table/src/index.ts 0.00% <ø> (ø)
plugins/plugin-chart-table/src/transformProps.ts 61.62% <ø> (ø)
plugins/plugin-chart-table/src/TableChart.tsx 41.37% <5.88%> (-4.70%) ⬇️
plugins/plugin-chart-table/src/Styles.tsx 100.00% <100.00%> (ø)
plugins/plugin-chart-echarts/src/utils/controls.ts 80.00% <0.00%> (-20.00%) ⬇️
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <0.00%> (ø)
...es/superset-ui-core/src/chart/models/ChartProps.ts 100.00% <0.00%> (ø)
plugins/plugin-chart-echarts/src/Gauge/types.ts 100.00% <0.00%> (ø)
...ugins/plugin-chart-echarts/src/Gauge/buildQuery.ts 100.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68a5e00...64db684. Read the comment docs.

setDataMask({
crossFilters: {
extraFormData: {
append_form_data: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether there is room for a simpler public API to set cross filters. Now It feels a little tedious that every chart with corss-filter support has to set this very long nested object themselves.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're actually currently cleaning up the API (some of this is leftovers from during development when it wasn't clear in which direction this was going to ultimately go)

Copy link
Contributor

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works like a charm!

@kgabryje kgabryje closed this Apr 7, 2021
@kgabryje kgabryje reopened this Apr 7, 2021
@villebro villebro changed the title feat(plugin-chart-table): enable emitting cross-filters feat(plugin-chart-table): enable emitting cross-filters Apr 7, 2021
@villebro villebro changed the title feat(plugin-chart-table): enable emitting cross-filters feat(plugin-chart-table): enable emitting cross-filters Apr 7, 2021
@kgabryje kgabryje merged commit 4ac7106 into apache-superset:master Apr 7, 2021
NejcZdovc pushed a commit to blotoutio/superset-ui that referenced this pull request Apr 20, 2021
…set#1041)

* feat(plugin-chart-table): enable emitting cross-filters

* Hide filters checkbox when cross filters flag is disabled
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants