mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 12:28:12 +08:00
* Added typings to annoMatrix directory. (#2365) * Added review point updates. (#2365) * Fixed viewOf defect. Added review point updates. (#2365) * Updated test to use Field key interpolation. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * Updated test to use Field key interpolation. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * Updated test to use Field key interpolation. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * Updated test to use Field key interpolation. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * Linting. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * Simplified while condition in middleware GC. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * Reverted embedding.ts prettier to resolve conflict. (#2365) Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>
This commit is contained in:
co-authored by
Timmy Huang
parent
08b03ace60
commit
b814489328
@@ -7,6 +7,7 @@ import { ThunkAction } from "redux-thunk";
|
||||
import { AnnoMatrixObsCrossfilter } from "../annoMatrix";
|
||||
import type { AppDispatch, RootState } from "../reducers";
|
||||
import { _setEmbeddingSubset } from "../util/stateManager/viewStackHelpers";
|
||||
import { Field } from "../common/types/schema";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
|
||||
export async function _switchEmbedding(
|
||||
@@ -26,7 +27,7 @@ export async function _switchEmbedding(
|
||||
const obsCrossfilter = await new AnnoMatrixObsCrossfilter(
|
||||
annoMatrix,
|
||||
prevCrossfilter.obsCrossfilter
|
||||
).select("emb", newEmbeddingName, {
|
||||
).select(Field.emb, newEmbeddingName, {
|
||||
mode: "all",
|
||||
});
|
||||
return [annoMatrix, obsCrossfilter];
|
||||
@@ -41,17 +42,19 @@ export const layoutChoiceAction: ActionCreator<
|
||||
On layout choice, make sure we have selected all on the previous layout, AND the new
|
||||
layout.
|
||||
*/
|
||||
const { annoMatrix: prevAnnoMatrix, obsCrossfilter: prevCrossfilter } =
|
||||
getState();
|
||||
const [annoMatrix, obsCrossfilter] = await _switchEmbedding(
|
||||
prevAnnoMatrix,
|
||||
prevCrossfilter,
|
||||
newLayoutChoice
|
||||
);
|
||||
dispatch({
|
||||
type: "set layout choice",
|
||||
layoutChoice: newLayoutChoice,
|
||||
obsCrossfilter,
|
||||
annoMatrix,
|
||||
});
|
||||
};
|
||||
const {
|
||||
annoMatrix: prevAnnoMatrix,
|
||||
obsCrossfilter: prevCrossfilter,
|
||||
} = getState();
|
||||
const [annoMatrix, obsCrossfilter] = await _switchEmbedding(
|
||||
prevAnnoMatrix,
|
||||
prevCrossfilter,
|
||||
newLayoutChoice
|
||||
);
|
||||
dispatch({
|
||||
type: "set layout choice",
|
||||
layoutChoice: newLayoutChoice,
|
||||
obsCrossfilter,
|
||||
annoMatrix,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user