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

Fixing sort issue with area chart and adding tests #6358

Merged

Conversation

michellethomas
Copy link
Contributor

@michellethomas michellethomas commented Nov 9, 2018

There's an issue where the area (stacked line) chart doesn't sort correctly. At the end of get_data for NVD3 charts the data gets sorted. I asked Beto about this line added here and it looks like it's necessary for time shift coloring. I believe the correct way to handle this is to see if the chart sorts the series (with self.sort_series flag), but I'm not sure if I'm missing any edge cases.

I've added tests to make sure the area chart is sorted correctly, and make sure the line chart with time shift has the correct colors.

@betodealmeida @john-bodley @graceguo-supercat

@codecov-io
Copy link

codecov-io commented Nov 9, 2018

Codecov Report

Merging #6358 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6358      +/-   ##
==========================================
+ Coverage   56.07%   56.07%   +<.01%     
==========================================
  Files         525      525              
  Lines       23212    23214       +2     
  Branches     2776     2776              
==========================================
+ Hits        13016    13018       +2     
  Misses       9787     9787              
  Partials      409      409
Impacted Files Coverage Δ
superset/viz.py 71.69% <100%> (+0.03%) ⬆️

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 3ae7d32...2f041b6. Read the comment docs.

@kristw kristw added !deprecated-label:bug Deprecated label - Use #bug instead change:backend Requires changing the backend labels Nov 30, 2018
@michellethomas michellethomas force-pushed the fix_stacked_line_sorting branch from 24f3997 to 2f041b6 Compare January 24, 2019 01:26
@michellethomas
Copy link
Contributor Author

This PR is a bit old but still relevant, so I rebased and will merge it in. I don't think the line chart_data = sorted(chart_data, key=lambda x: tuple(x['key'])) is necessary anymore for determining the color for time shift lines because we have code that assigns a color based on the label, but I'm leaving it in because it keeps the legend sorted. The self.sort_series happens before this line so we don't want to be resorting in that case.

@kristw
Copy link
Contributor

kristw commented Jan 25, 2019

LGTM

@michellethomas michellethomas merged commit 8100a8f into apache:master Jan 25, 2019
@michellethomas michellethomas deleted the fix_stacked_line_sorting branch January 25, 2019 21:03
xtinec pushed a commit that referenced this pull request Feb 5, 2019
graceguo-supercat pushed a commit that referenced this pull request Feb 8, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 27, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 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 change:backend Requires changing the backend !deprecated-label:bug Deprecated label - Use #bug instead v0.31 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants