plotly / react-pivottable

React-based drag'n'drop pivot table with Plotly.js charts
https://react-pivottable.js.org/
MIT License
993 stars 254 forks source link

rfc: improve valueFilter API #99

Open cdaringe opened 4 years ago

cdaringe commented 4 years ago

problem

i cannot set a predefined, fixed valueFilter onto my table.

i have an unknown dataset with many possible values landing in my table as columns. i do have a well known values that I wan't to exclusively show.

for instance, consider a dataset of fruits: [apple, orange, banana, ...]. additional unknown fruits, like papaya and strawberry, get added over time. now consider that i want to build a declarative, pre-canned table view that shows only oranges.

currently, i cannot do:

valueFilter: {
  fruit: {
    banana: true // or false
  } 
}

because all keys eventually get loaded into react-pivottables internal state.

discussion

can we support a valueFilter to support a declarative, props-driven filter that addresses the above problem?