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

Add get_min_max() to Perspective API #1395

Merged
merged 2 commits into from
Apr 26, 2021
Merged

Add get_min_max() to Perspective API #1395

merged 2 commits into from
Apr 26, 2021

Conversation

texodus
Copy link
Member

@texodus texodus commented Apr 26, 2021

Adds get_min_max() function to View objects in Python and Javascript, the purpose of which is to provide reasonable value ranges for rendering gradient-maps. get_min_max() takes a column name as an argument, and returns a tuple [min, max] of this column's View-type. This new version of min/max calculation works unlike the previous incarnation:

  • It is a one-time-query, and does not recalculate unless called. The new <perspective-column-style> component calls this once only on instantiation.
  • It does not include parent aggregates, e.g. anything with row_path or column_path less than their respective maxes, unless ...
  • ... in the specific case of Row Pivots, when all children of a row depth are in a "collapsed" state, there are no non-parent aggregates, so the next non-empty depth level is used instead.

@texodus texodus marked this pull request as ready for review April 26, 2021 04:50
@texodus texodus added enhancement Feature requests or improvements JS Python labels Apr 26, 2021
@texodus texodus merged commit 989a743 into master Apr 26, 2021
@texodus texodus deleted the min_max branch April 26, 2021 05:10
@texodus
Copy link
Member Author

texodus commented Apr 27, 2021

As @finos/perspective-viewer now depends on the presence of this call to open the new Column Style menu feature, and thus depends on a @finos/perspective or perspective-python version which supports this call, this feature should eb breaking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement Feature requests or improvements JS Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant