-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: explicit distribute columns on BoxPlot and apply time grain #21593
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21593 +/- ##
==========================================
- Coverage 66.72% 66.72% -0.01%
==========================================
Files 1796 1797 +1
Lines 68731 68751 +20
Branches 7316 7323 +7
==========================================
+ Hits 45864 45877 +13
- Misses 21007 21013 +6
- Partials 1860 1861 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, curious to hear your thoughts
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/constants.tsx
Outdated
Show resolved
Hide resolved
if ( | ||
isPhysicalColumn(col) && | ||
formData.time_grain_sqla && | ||
formData?.datetime_columns_lookup?.[col] | ||
) { | ||
return { | ||
timeGrain: formData.time_grain_sqla, | ||
columnType: 'BASE_AXIS', | ||
sqlExpression: col, | ||
label: col, | ||
expressionType: 'SQL', | ||
} as AdhocColumn; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to check for the GENERIC_CHART_AXES
FF here similar to what we're doing in the other plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boxplot is a bit special. the Distribute Across
is similar to XAxis
control in time series charts, but the Distribute Across
control is shown even though FF is disabled(the original logic). So the build query logic skips checking FF, which means always transforming the Physical Column into BaseAxisAdhocColumn.
Additionally, the Distribute Across
control use the initialValue
property to set the initial value as the default time column
, so the BoxPlot is "native" to support generic xaxis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the explanation. There may be the special case where a user wants to apply a time grain on "Dimensions" but not "Distribute across" or vice versa. But maybe that can be addressed once time grain is moved into the column control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if ( | ||
isPhysicalColumn(col) && | ||
formData.time_grain_sqla && | ||
formData?.datetime_columns_lookup?.[col] | ||
) { | ||
return { | ||
timeGrain: formData.time_grain_sqla, | ||
columnType: 'BASE_AXIS', | ||
sqlExpression: col, | ||
label: col, | ||
expressionType: 'SQL', | ||
} as AdhocColumn; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for the explanation. There may be the special case where a user wants to apply a time grain on "Dimensions" but not "Distribute across" or vice versa. But maybe that can be addressed once time grain is moved into the column control.
a190a2b
to
432fe35
Compare
SUMMARY
This PR intends to improve BoxPlot UX and apply Time Grain to all of the time columns in the
Distribute Across
control.Originally, the default time column implicitly apply in the
Distribute Across
control until there are some columns set on this control. After this PR the default time column will explicitly display inDistribute Across
.Additionally, the
Time Grian
also move belowDistribute Across
control and the time grain would apply to all of the time columns.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After
BoxPlot.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION