You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2023/04/11 08:10:32 UTC

[GitHub] [superset] villebro opened a new pull request, #23644: feat(plugin-chart-echarts): add x-axis sort to multi series

villebro opened a new pull request, #23644:
URL: https://github.com/apache/superset/pull/23644

   ### SUMMARY
   Currently it's only possible to sort non-temporal charts by the series values if there are no dimensions selected. This adds the same sorting options to dimensional charts that's available for sorting the series. We still default to category name, so current charts will not be affected. This PR also moves the series sorting controls to `@superset-ui/chart-controls` to make them generally available.
   
   https://user-images.githubusercontent.com/33317356/231097350-6bba5039-60ec-467a-9e17-89b43adcbee0.mp4
   
   ### 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


[GitHub] [superset] codecov[bot] commented on pull request #23644: feat(plugin-chart-echarts): add x-axis sort to multi series

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #23644:
URL: https://github.com/apache/superset/pull/23644#issuecomment-1502980801

   ## [Codecov](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23644](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (38e95e8) into [master](https://codecov.io/gh/apache/superset/commit/8bd827679116204aa523c3dd0487104d03ab7376?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8bd8276) will **increase** coverage by `0.00%`.
   > The diff coverage is `74.46%`.
   
   > :exclamation: Current head 38e95e8 differs from pull request most recent head 79a5171. Consider uploading reports for the commit 79a5171 to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #23644   +/-   ##
   =======================================
     Coverage   67.92%   67.92%           
   =======================================
     Files        1918     1918           
     Lines       73882    73926   +44     
     Branches     8054     8074   +20     
   =======================================
   + Hits        50183    50215   +32     
   - Misses      21646    21653    +7     
   - Partials     2053     2058    +5     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `53.92% <74.46%> (+0.02%)` | :arrow_up: |
   
   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=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...d/packages/superset-ui-chart-controls/src/types.ts](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3R5cGVzLnRz) | `100.00% <ø> (ø)` | |
   | [...s/plugin-chart-echarts/src/Timeseries/constants.ts](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy9jb25zdGFudHMudHM=) | `100.00% <ø> (ø)` | |
   | [...gin-chart-echarts/src/Timeseries/transformProps.ts](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy90cmFuc2Zvcm1Qcm9wcy50cw==) | `57.27% <0.00%> (-1.07%)` | :arrow_down: |
   | [...tend/plugins/plugin-chart-echarts/src/constants.ts](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvY29uc3RhbnRzLnRz) | `100.00% <ø> (ø)` | |
   | [...tend/plugins/plugin-chart-echarts/src/controls.tsx](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvY29udHJvbHMudHN4) | `76.00% <ø> (ø)` | |
   | [...rt-controls/src/shared-controls/customControls.tsx](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NoYXJlZC1jb250cm9scy9jdXN0b21Db250cm9scy50c3g=) | `24.13% <50.00%> (+6.74%)` | :arrow_up: |
   | [...d/plugins/plugin-chart-echarts/src/utils/series.ts](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvdXRpbHMvc2VyaWVzLnRz) | `86.62% <80.00%> (-1.87%)` | :arrow_down: |
   | [...ckages/superset-ui-chart-controls/src/constants.ts](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL2NvbnN0YW50cy50cw==) | `100.00% <100.00%> (ø)` | |
   | [...t-controls/src/sections/echartsTimeSeriesQuery.tsx](https://codecov.io/gh/apache/superset/pull/23644?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2VjaGFydHNUaW1lU2VyaWVzUXVlcnkudHN4) | `100.00% <100.00%> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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


[GitHub] [superset] villebro commented on a diff in pull request #23644: feat(plugin-chart-echarts): add x-axis sort to multi series

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #23644:
URL: https://github.com/apache/superset/pull/23644#discussion_r1162501311


##########
superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts:
##########
@@ -155,6 +151,84 @@ export function sortAndFilterSeries(
   ).map(({ name }) => name);
 }
 
+export function sortRows(
+  rows: DataRecord[],
+  xAxis: string,
+  xAxisSortSeries: SortSeriesType,
+  xAxisSortSeriesAscending: boolean,
+) {

Review Comment:
   I originally set out to implement this with `lodash`, similar to how `sortAndFilterSeries` was implemented, but in this case it felt clearer to write this out like this. But if this function looks too explicit I can rewrite this with the equivalent `lodash` functions (refactoring should be simple, as the tests should work as-is).



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


[GitHub] [superset] villebro merged pull request #23644: feat(plugin-chart-echarts): add x-axis sort to multi series

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #23644:
URL: https://github.com/apache/superset/pull/23644


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