notebooks: factor out data filter logic
Created by: rvantonder
Stacked on https://github.com/sourcegraph/sourcegraph/pull/32636.
This just factors out a record so we can persist those options as-is:
type alias DataFilter =
{ dataPoints : Int
, sortByCount : Bool
, reverse : Bool
, excludeStopWords : Bool
}
They correspond to these inputs in the UI:
These are super experimental options and tied to the current demo. The utility right now outweighs hashing out a more complete way to represent data processing for demo purposes.
After this PR I need just one more that actually persists this, then Sourcegraph users can try it out.
Two commits, to kind of demonstrate how the logic and data decomposes (mostly useful if you have a cursory idea of Elm, if not, don't worry, next week I'll do a walkthrough/workshop, probably emulating exactly this kind of change):
- First commit updates the data type and the
update
function to update that data type - Second shows how a
view
function can split from the mainview
to only care about the inputs that update the data filter.
Test plan
Semantics-preserving.