-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: 936 embedding cell count #942
Conversation
442d257
to
5411c52
Compare
dispatch({ | ||
type: "initial data load complete", | ||
isCellGuideCxg, | ||
layoutChoice: finalLayout, | ||
}); |
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 we dispatch this action, we send both isCellGuideCxg
and layoutChoice
client/src/actions/index.ts
Outdated
* count when the page is first loaded. | ||
* BUG: https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues/gh/chanzuckerberg/single-cell-explorer/936 | ||
*/ | ||
dispatch(embActions.layoutChoiceAction(finalLayout)); |
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.
we still dispatch this action in order to get the correct crossFilter, etc.
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS. | ||
class Embedding extends React.PureComponent<{}, EmbeddingState> { | ||
// eslint-disable-next-line @typescript-eslint/ban-types --- FIXME: disabled temporarily on migrate to TS. | ||
constructor(props: {}) { |
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.
remove unnecessary ctor per linter
this.state = {}; | ||
} | ||
|
||
class Embedding extends React.PureComponent<Props> { |
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.
just type cleanup in this file
return layouts[0]; | ||
} | ||
|
||
function setToDefaultLayout(schema: Schema): LayoutChoiceState { |
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 now split out into selectAvailableLayouts
and getCurrentLayout
for reusability
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- update typings once annoMatrix reducer state is typed. | ||
export const selectAnnoMatrix = (state: RootState): any => state.annoMatrix; |
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.
type cleanup
@@ -20,3 +20,8 @@ export const selectIsUserStateDirty = (state: any): boolean => { | |||
) | |||
); | |||
}; | |||
|
|||
export function selectSchema(state: RootState) { |
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.
new selector to get annoMatrix.schema
client/src/actions/index.ts
Outdated
/** | ||
* (thuang): This dispatch is necessary to ensure that we get the right cell | ||
* count when the page is first loaded. | ||
* BUG: https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues/gh/chanzuckerberg/single-cell-explorer/936 |
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.
* BUG: https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues/gh/chanzuckerberg/single-cell-explorer/936 | |
* BUG: https://github.coms/chanzuckerberg/single-cell-explorer/936 |
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.
Oh thank you! I'll use #936
5411c52
to
ace0a64
Compare
ace0a64
to
b6a7b39
Compare
Fix #936
doInitialDataLoad
action now choose the initial layout by checking if the dataset's preferreddefault_embedding
is available or not and fall back to picking the best layout given the available layoutsselectAvailableLayouts
to reuseScreen.Recording.2024-05-22.at.9.08.36.AM.mov