Skip to content

Add get_min_max() to Perspective API#1395

Merged
texodus merged 2 commits intomasterfrom
min_max
Apr 26, 2021
Merged

Add get_min_max() to Perspective API#1395
texodus merged 2 commits intomasterfrom
min_max

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

Development

Successfully merging this pull request may close these issues.

1 participant