Skip to content
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: adding XAxis to BigNumberTrend #21577

Merged
merged 5 commits into from
Sep 26, 2022

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Sep 26, 2022

SUMMARY

Apply temporal XAxis to BigNumber with Trendline

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After

image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@zhaoyongjie zhaoyongjie changed the title feat: adding XAxis to BigNumberTrend [WIP]feat: adding XAxis to BigNumberTrend Sep 26, 2022
@zhaoyongjie zhaoyongjie changed the title [WIP]feat: adding XAxis to BigNumberTrend feat: adding XAxis to BigNumberTrend Sep 26, 2022
@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 26, 2022
@@ -51,3 +52,29 @@ export const xAxisControlConfig = {
},
default: undefined,
};

export const temporalXAxisMixin = {
Copy link
Member Author

Choose a reason for hiding this comment

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

copy/paste from dndGranularitySqlaControl

Copy link
Member

@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.

LGTM and works as expected with a minor typing related comment. I know this is out of scope for this PR, but I'd love to see us add support for at least numerical types on the x-axis.

@@ -51,3 +52,29 @@ export const xAxisControlConfig = {
},
default: undefined,
};

export const temporalXAxisMixin = {
Copy link
Member

Choose a reason for hiding this comment

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

As this is a mixin, we maybe the type could be narrowed down to something like Pick[BaseControlConfig, 'label' | 'mapStateToProps']?

Also, I'm wondering if we should make this a function getXAXisControlMixin that takes an optional argument dataTypes: GenericDataType[], which if defined, would only return the requested column types? For instance, at some point in the future I'm assuming we want to support any ordinal or linear datatypes in this chart type, and in that case we would likely want to support GenericDataType.NUMERIC and GenericDataType.TEMPORAL.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review and very useful case for this mixin. I changed this variable from the temporalXAxisMixin to the temporalColumnMixin and removed mapStateToProps from the original one from dndGranularitySqlaControl. I totally agree with making a function for returning specific column types from the original datasource. I will refactor this part in separate PR.

@codecov
Copy link

codecov bot commented Sep 26, 2022

Codecov Report

Merging #21577 (788c635) into master (d67b046) will decrease coverage by 0.00%.
The diff coverage is 26.31%.

@@            Coverage Diff             @@
##           master   #21577      +/-   ##
==========================================
- Coverage   66.66%   66.65%   -0.01%     
==========================================
  Files        1794     1794              
  Lines       68639    68695      +56     
  Branches     7300     7311      +11     
==========================================
+ Hits        45755    45792      +37     
- Misses      21014    21034      +20     
+ Partials     1870     1869       -1     
Flag Coverage Δ
javascript 52.82% <26.31%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...d/packages/superset-ui-chart-controls/src/index.ts 100.00% <ø> (ø)
...chart-controls/src/shared-controls/dndControls.tsx 58.33% <ø> (+4.76%) ⬆️
...src/BigNumber/BigNumberWithTrendline/buildQuery.ts 0.00% <0.00%> (ø)
.../BigNumber/BigNumberWithTrendline/controlPanel.tsx 16.66% <0.00%> (-8.34%) ⬇️
...i-chart-controls/src/shared-controls/constants.tsx 22.22% <20.00%> (-11.12%) ⬇️
...BigNumber/BigNumberWithTrendline/transformProps.ts 47.05% <75.00%> (+0.79%) ⬆️
...iews/CRUD/data/dataset/AddDataset/Footer/index.tsx 33.33% <0.00%> (-66.67%) ⬇️
...frontend/src/components/DatabaseSelector/index.tsx 93.93% <0.00%> (-1.30%) ⬇️
...set-frontend/src/views/CRUD/data/dataset/styles.ts 100.00% <0.00%> (ø)
...et-frontend/src/components/TableSelector/index.tsx 80.00% <0.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zhaoyongjie zhaoyongjie merged commit f4646f8 into apache:master Sep 26, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants