-
Notifications
You must be signed in to change notification settings - Fork 329
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 sample and patient counts toggle for cancer summary chart tooltip #5110
Add sample and patient counts toggle for cancer summary chart tooltip #5110
Conversation
✅ Deploy Preview for cbioportalfrontend ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks @gblaih ! The counts look good, but would be nice to update the "cases" text to "samples" when selecting "Sample Counts" (patient and case are often used as synonyms):

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.
Looks great! Thanks @gblaih ! Can you make the default "Patient Counts", similar to how the oncoprint works
coverageInformation | ||
); | ||
|
||
const alterationCounts = countByProperty |
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.
countByProperty
is not a boolean so we should do something like this, right?
const alterationCounts = countByProperty | |
const alterationCounts = countByProperty === 'sampleCounts' |
|
||
let alterationCounts = | ||
countByProperty === 'sampleCounts' | ||
? countAlterationOccurences( |
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.
should we rename this to countSampleAlterationOccurences
?
@@ -272,3 +295,217 @@ export function countAlterationOccurences( | |||
} | |||
); | |||
} | |||
|
|||
export function countPatientAlterationOccurences( |
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.
this is a pretty long function with nested function calls. would be nice to simplify/flatten this procedure but not sure if there is an easy way to do that.
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.
this function is based on the also lengthy countAlterationOccurences
function but with some additional logic to account for the fact we are working with patients. i tried to combine these two into one but that proved to be very sloppy and difficult to read. i don't think it would be easy to simplify this right now but maybe can look into making both these functions cleaner in the future
ee8565f
to
3c4ef59
Compare
…cBioPortal#5110) * add sample and patient counts toggle for tooltip * update text to use samples or cases depending on user select --------- Co-authored-by: Bryan Lai <[email protected]>
Fix cBioPortal/cbioportal#11311
Adds option to toggle between sample and patient counts in tooltip of cancer summary chart in results view. Previously, it only showed sample counts with no option to switch.