You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "cmedley (via GitHub)" <gi...@apache.org> on 2024/01/03 02:32:05 UTC
[PR] add custom sort by x-axis for mixed charts [superset]
cmedley opened a new pull request, #26397:
URL: https://github.com/apache/superset/pull/26397
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Enables sorting mixed data chart by x-axis using different columns
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
Before:

After:

### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #26397:
URL: https://github.com/apache/superset/pull/26397#issuecomment-2819849971
Looks like this still hasn't gotten a rebase, and now the GENERIC_CHART_AXES flag used in the PR has been removed. I'll convert this to draft for now, in hopes that it can still be brought up to speed and marked ready for review again. If not, it may eventually be closed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] add custom sort by x-axis for mixed charts [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #26397:
URL: https://github.com/apache/superset/pull/26397#discussion_r1440019199
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts:
##########
@@ -46,6 +47,11 @@ export default function buildQuery(formData: QueryFormData) {
...formData,
};
+ if (!!baseFormData.orderby) {
Review Comment:
I'm curious, do we really need the double bang here?
```suggestion
if (baseFormData.orderby) {
```
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts:
##########
@@ -46,6 +47,11 @@ export default function buildQuery(formData: QueryFormData) {
...formData,
};
+ if (!!baseFormData.orderby) {
+ baseFormData.x_axis_sort = formData.orderby.label;
Review Comment:
I think you may need to do this here to make sure we can handle all types of metrics (please also add the import):
```suggestion
baseFormData.x_axis_sort = getMetricLabel(formData.orderby);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #26397:
URL: https://github.com/apache/superset/pull/26397#issuecomment-2310836618
@cmedley I'm just finding that this slipped between the cracks somehow. Sorry about that. If you're willing to rebase PR to resolve conflicts, we can probably get a fresh review on it, and get it merged (finally). Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #26397:
URL: https://github.com/apache/superset/pull/26397#issuecomment-3882974623
Closing due to contributor inactivity. Feel free to reopen if/when warranted, and thank you for the contribution!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #26397:
URL: https://github.com/apache/superset/pull/26397#issuecomment-1874813363
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/26397?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: `3 lines` in your changes are missing coverage. Please review.
> Comparison is base [(`29633e7`)](https://app.codecov.io/gh/apache/superset/commit/29633e7d8cad7b52669a9e6f5e064cd34da803a3?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 69.14% compared to head [(`5d4da18`)](https://app.codecov.io/gh/apache/superset/pull/26397?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 69.14%.
> Report is 3 commits behind head on master.
| [Files](https://app.codecov.io/gh/apache/superset/pull/26397?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...in-chart-echarts/src/MixedTimeseries/buildQuery.ts](https://app.codecov.io/gh/apache/superset/pull/26397?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvTWl4ZWRUaW1lc2VyaWVzL2J1aWxkUXVlcnkudHM=) | 0.00% | [2 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/26397?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #26397 +/- ##
==========================================
- Coverage 69.14% 69.14% -0.01%
==========================================
Files 1946 1946
Lines 75989 75992 +3
Branches 8479 8480 +1
==========================================
Hits 52544 52544
- Misses 21266 21268 +2
- Partials 2179 2180 +1
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/26397/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/26397/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.45% <0.00%> (-0.01%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/26397?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "muralikrishnaIrakam (via GitHub)" <gi...@apache.org>.
muralikrishnaIrakam commented on PR #26397:
URL: https://github.com/apache/superset/pull/26397#issuecomment-3089593539
if i try to sort with two or more Metrics then sort is not working , only one Metrics then it will work , can i get if you have any possible solution ..?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "zhaoyongjie (via GitHub)" <gi...@apache.org>.
zhaoyongjie commented on code in PR #26397:
URL: https://github.com/apache/superset/pull/26397#discussion_r1441060025
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/buildQuery.ts:
##########
@@ -75,6 +82,7 @@ export default function buildQuery(formData: QueryFormData) {
time_offsets: isTimeComparison(fd, queryObject) ? fd.time_compare : [],
post_processing: [
pivotOperatorInRuntime,
+ sortOperator(fd, queryObject),
Review Comment:
The sortOperator should move before the flattenOperator because the other operators(rolling, resample, and so on) also changed original data.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: add custom sort by x-axis for mixed charts [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed pull request #26397: feat: add custom sort by x-axis for mixed charts
URL: https://github.com/apache/superset/pull/26397
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org