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

fix(plugin-chart-echarts): reorder totals and support multimetric sort #23675

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

villebro
Copy link
Member

@villebro villebro commented Apr 13, 2023

SUMMARY

When using the multiseries sort on generic x-axis, the totals are not sorted, causing them to display on the wrong bars. In addition, it was not possible to sort by the total bar height if there were multiple metrics. This PR fixes both issues.

AFTER

When there are two metrics, the multiseries sort control is now displayed. In addition, the totals are displayed on the correct rows:

total-after.mp4

BEFORE

Previously, it wasn't possible to sort by the total if there were multiple metrics (notice that one would commonly want to display NY before TX and PA before OH):
image

In addition, when using the multiseries sort control, the totals would be displayed on the original bars, as they didn't get reordered along with the chart data (notice that the last bar shows 37.1 M births, despite the total of the series being 5.62M):

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

@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #23675 (a6c7a83) into master (47fd732) will decrease coverage by 0.01%.
The diff coverage is 38.88%.

❗ Current head a6c7a83 differs from pull request most recent head 6b01df3. Consider uploading reports for the commit 6b01df3 to get more accurate results

@@            Coverage Diff             @@
##           master   #23675      +/-   ##
==========================================
- Coverage   66.40%   66.39%   -0.01%     
==========================================
  Files        1922     1922              
  Lines       74042    74048       +6     
  Branches     8102     8104       +2     
==========================================
+ Hits        49166    49167       +1     
- Misses      22805    22809       +4     
- Partials     2071     2072       +1     
Flag Coverage Δ
javascript 54.12% <38.88%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...rt-controls/src/shared-controls/customControls.tsx 22.58% <0.00%> (-1.56%) ⬇️
...hart-echarts/src/MixedTimeseries/transformProps.ts 0.00% <0.00%> (ø)
...gin-chart-echarts/src/Timeseries/transformProps.ts 56.75% <25.00%> (-0.52%) ⬇️
...d/plugins/plugin-chart-echarts/src/utils/series.ts 85.71% <75.00%> (-0.92%) ⬇️

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

@villebro villebro requested a review from kgabryje April 14, 2023 09:22
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM with tiny naming nit

@villebro villebro added the 2.1.1 label Apr 14, 2023
@villebro villebro merged commit cbbcc8d into apache:master Apr 14, 2023
@villebro villebro deleted the villebro/resorted-total branch April 14, 2023 17:43
sebastianliebscher pushed a commit to sebastianliebscher/superset that referenced this pull request Apr 28, 2023
@eschutho eschutho added the v2.1 label May 12, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 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 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants