-
Notifications
You must be signed in to change notification settings - Fork 35
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
Flat cell set manager #1382
base: main
Are you sure you want to change the base?
Flat cell set manager #1382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass, need to check out and try now
*/ | ||
export function isEqualSet(a, b) { | ||
if (a.length === b.length) { | ||
const aSet = new Set(a); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? For delete
? It doesn't seem like this would ever actually dedup something (at least the behavior is not tested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are needed to check whether the parent checkbox should be:
- checked (
isFullSubSet
true - all of the parent's children are selected) - indeterminate (
isPartialSet && !isEqualSet
true - subset of the parent's children are selected) - unchecked (otherwise - none of the parent's children)
They are implemented using isEqual
because the set elements are arrays of strings like ["Clustering", "Cluster 1"]
so normal equality operators won't work.
*/ | ||
export function isPartialSet(a, b) { | ||
// b is partially contained in a. | ||
if (a.length > 0 && b.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like, Set
is not used here but is below so not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set
is just used for the internal implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking advantage of the fact that the arrays of strings will be represented in the Set
by the reference to their array object. Could be implemented many other ways.
@@ -577,6 +647,88 @@ export function treeToExpectedCheckedLevel(currTree, checkedPaths) { | |||
return result; | |||
} | |||
|
|||
export function treeToFullyCheckedLevels(currTree, checkedPaths) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add doc strings to these?
@keller-mark can you tell me how to use this (like a view config)? I tried adding a line into the view config upgrader to replace |
Sorry, I should have clarified this. It won't really be useful until the We can wait to merge this until at least the |
Up to you @keller-mark - I do want to give it a try but if you want to merge, we can. |
Fixes #1302
Also updates documentation formatting for older view config schema versions to put them under a dropdown.
TODO
obsSetFilter
Checklist
vitessce-python
andvitessce-r
if this is a release PR