-
Notifications
You must be signed in to change notification settings - Fork 318
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 Categorical Bar Chart on Study View #4951
Add Categorical Bar Chart on Study View #4951
Conversation
✅ Deploy Preview for cbioportalfrontend ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
8f83fcc
to
c4893d4
Compare
@@ -312,3 +324,18 @@ export const STUDY_VIEW_CONFIG: StudyViewConfig = _.assign( | |||
studyViewFrontEnd, | |||
(getServerConfig() || {}).study_view | |||
); | |||
|
|||
export const chartChangeOptionsMap: ChangeChartOptionsMap = { |
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.
is this used?
uniqueKey: string, | ||
data: ClinicalDataCount[] | string[] | ||
): void { | ||
const { totalCount, naCount } = (data as ( |
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.
add comments here to explain what's happening here. can also add comments below to describe the method of choosing which chart
@@ -414,6 +416,85 @@ export class ChartHeader extends React.Component<IChartHeaderProps, {}> { | |||
); | |||
} | |||
|
|||
if ( | |||
this.props.chartControls && |
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 simplify to this.props.chartControls?.showChartChangeOptions
|
||
@autobind | ||
private onSelection(bars: { data: BarDatum[] }[]): void { | ||
const dataBins = _.flatten( |
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.
when performing multiple array functions, lets chain multiple lodash functions like
_(bars) .function() .function() ...
lodash has a map function
const TILT_ANGLE = 30; | ||
|
||
@observer | ||
export default class CategoryBarChart |
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.
i'm noticing some similarities with our existing BarChart component. can we look into maybe extending it or reusing that code to prevent duplicate code?
} | ||
} | ||
|
||
const onlyContainsNA = (element: BarDatum): boolean => { |
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 said above, these functions are in BarChart as well. we could make export these functions to prevent duplication
import { VictoryLabel, Helpers } from 'victory'; | ||
import { Tooltip, OverlayTrigger } from 'react-bootstrap'; | ||
|
||
export class CategoryBarChartAxisLabel extends VictoryLabel { |
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.
same as above. i think we have very similar components with our BarChart component. it would be nice to reuse this somehow. lets look into this for all similarly related components
updateCurrentBinsValue() { | ||
let newBins: number[] = []; | ||
if (this.currentBinMethod === BinMethodOption.CUSTOM) { | ||
newBins = _.sortBy( |
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.
lodash chaining here as well
@@ -1451,6 +1484,11 @@ export class ChartContainer extends React.Component<IChartContainerProps, {}> { | |||
() => (this.newlyAdded = false), | |||
STUDY_VIEW_CONFIG.thresholds.chartHighlight | |||
); | |||
} else if (this.chartChanged) { |
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.
currently when changing a chart type, the highlight doesn't go away. look into the mechanism behind this and figure out why
@olzhasmukayev Nice work! Can we enable it for Metastatic Sites as well? |
66fcf9a
to
4a7e78b
Compare
b3116f6
to
dcf08bf
Compare
3b5fffa
to
14d9b89
Compare
- in custom selection text box take inputs with commas, space or new line or all combined also - add an example placeholder
Adds a condition to the link text where if all resources are of the same type, then rename the Files & Links tab to the resourceDefinition displayName
* fix log scale breaking box plot * update screenshots --------- Co-authored-by: Bryan Lai <[email protected]>
* Update screenshots * Fix quick search test * Update api clients and fix typing of new Clickhouse dependent code * Add a wait for bin screenshot test
* Update api client * resolve type complains
* Fix: handle empty "Files and Links" tab in patient view --------- Co-authored-by: alisman <[email protected]>
…oPortal#5084) * Update logScalePossible for generic assay negative data * make sure that return type is always boolean * Add test for negative and positive data of type number
* Add ellipse for long label in Timeline chart with a tooltip when too truncated. Also add padding between end of label and arrow. * fix: limit width of left bar
c76f0bc
to
278fdf5
Compare
* Update screenshots * Fix quick search test * Update api clients and fix typing of new Clickhouse dependent code * Add a wait for bin screenshot test
* Update api client * resolve type complains
Choose chart type: