Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

feat(big-number): format datetime according to granularity#402

Merged
ktmud merged 1 commit intoapache-superset:masterfrom
ktmud:big-number
Mar 16, 2020
Merged

feat(big-number): format datetime according to granularity#402
ktmud merged 1 commit intoapache-superset:masterfrom
ktmud:big-number

Conversation

@ktmud
Copy link
Contributor

@ktmud ktmud commented Mar 16, 2020

🏆 Enhancements

This adds support for "Time Grain" in Superset for Big Number with Trendline chart.

image

It will now render date format in tooltip according to the time granularity.

Before

When "Time Grain" is set to "Quarter":

Snip20200315_57

After

When "Time Grain" is set to "Quarter":

Snip20200315_56

@ktmud ktmud requested a review from a team as a code owner March 16, 2020 06:34
@netlify
Copy link

netlify bot commented Mar 16, 2020

Deploy preview for superset-ui-plugins ready!

Built with commit c6e0a65

https://deploy-preview-402--superset-ui-plugins.netlify.com

@codecov
Copy link

codecov bot commented Mar 16, 2020

Codecov Report

Merging #402 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #402      +/-   ##
=========================================
- Coverage    2.83%   2.83%   -0.01%     
=========================================
  Files         186     186              
  Lines        5813    5821       +8     
  Branches      373     373              
=========================================
  Hits          165     165              
- Misses       5623    5631       +8     
  Partials       25      25
Impacted Files Coverage Δ
...t-chart-big-number/src/BigNumber/transformProps.js 0% <0%> (ø) ⬆️
...reset-chart-big-number/src/BigNumber/BigNumber.jsx 0% <0%> (ø) ⬆️

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 1c8b205...c6e0a65. Read the comment docs.

@ktmud
Copy link
Contributor Author

ktmud commented Mar 16, 2020

Will create a follow up PR to introduce alignTimeRange after this is merged.

@kristw
Copy link
Collaborator

kristw commented Mar 16, 2020

Note: Can ignore the test coverage for now.

subheader = '',
vizType,
} = formData;
const granularity = formData.timeGrainSqla;
Copy link
Collaborator

Choose a reason for hiding this comment

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

could be part of the destructuring above


const TIME_COLUMN = '__timestamp';

function getTimeFormatterForGranularity(granularity) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems useful to extract into its own file, in case we move this to @superset-ui/time-format later

@ktmud
Copy link
Contributor Author

ktmud commented Mar 16, 2020

Merge it for now. No need to publish. Will address the comments in a future PR.

@ktmud ktmud merged commit c4c3f4a into apache-superset:master Mar 16, 2020
nytai pushed a commit to preset-io/superset-ui-plugins that referenced this pull request Apr 27, 2020
…perset#402)

This adds support for "Time Grain" in Superset for Big Number with Trendline chart.
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.

2 participants