Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

7xuanlu
Copy link

@7xuanlu 7xuanlu commented Oct 3, 2023

fix cBioPortal/cbioportal#10367

  • match cna pie chart colors with Oncoprint color in study view page
  • make all pie chart label display either white or black color based on their background colors, which in turns make it easier for users to distinguish between label and its background

Screenshot 2023-10-03 at 1 28 34 PM

@7xuanlu 7xuanlu self-assigned this Oct 3, 2023
@kalletlak kalletlak marked this pull request as ready for review October 3, 2023 20:11
@kalletlak kalletlak requested a review from alisman October 3, 2023 21:24
@inodb inodb added the feature label Oct 9, 2023
: d.count.toLocaleString();
}

@computed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't make sense to make this a computed property because it's returning a callback which will be executed outside the scope of mobx's optimization. you should make this a bound method of this class instead of a computed getter. the cost of deriving the color for a handful of piechart slices is negligible.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the importance of this comment is mostly just to make sure you understand what the computed decorator does. you can read about it in mobx documentation if necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at line 135 fill() methods using @computed as well, it also returns a method but not a value. Should I change its tag to @autoBind as well? I've tried to change either fill() or labelColor() and got "@boundMethod decorator can only be applied to methods not: undefined"

@inodb inodb merged commit 466903a into cBioPortal:master Oct 11, 2023
@dippindots dippindots changed the title match cna chart colors with oncoprint and adjust label colors accordi… match cna chart colors with oncoprint and adjust label colors according to slice brightness Oct 17, 2023
haynescd pushed a commit that referenced this pull request Nov 15, 2023
#4750)

* match cna chart colors with oncoprint and adjust label colors according to slice brightness

* fix end to end tests on study view page

* update pie charts @computed to @autoBind

---------

Co-authored-by: Qi-Xuan Lu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Match to oncoprint color for Discrete CNA chart in study page

4 participants