Skip to content

Commit

Permalink
Fix experimental flowjo parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
RenatoBrittoAraujo committed Sep 14, 2021
1 parent be3c8ad commit 65b39c2
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 102 deletions.
29 changes: 22 additions & 7 deletions src/graph/WorkspaceComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import GenerateReportModal from "./components/modals/GenerateReportModal";
import LinkShareModal from "./components/modals/linkShareModal";
import Plots, { resetPlotSizes } from "./components/workspaces/PlotController";
import SideMenus from "./components/static/SideMenus";
import { downloadFileEvent, downloadFileMetadata } from "services/FileService";
import {
dowloadAllFileEvents,
downloadFileEvent,
downloadFileMetadata,
} from "services/FileService";
import {
loadWorkspaceFromRemoteIfExists,
saveWorkspaceToRemote,
Expand Down Expand Up @@ -87,9 +91,6 @@ const WorkspaceComponent = (props: {
}) => {
const store = useStore();
const classes = useStyles();
// store.dispatch({
// type: "workspace.RESET",
// });
const history = useHistory();
const isLoggedIn = userManager.isLoggedIn();

Expand Down Expand Up @@ -124,11 +125,17 @@ const WorkspaceComponent = (props: {
});

initializeWorkspace();

return () => {
store.dispatch({
type: "workspace.RESET",
});
};
}, []);

const initializeWorkspace = async () => {
await downloadFileMetadata(props.shared, props.experimentId);
await loadWorkspaceFromRemoteIfExists(props.shared, props.experimentId);
// await loadWorkspaceFromRemoteIfExists(props.shared, props.experimentId);
};

const saveWorkspace = () => {
Expand Down Expand Up @@ -205,7 +212,15 @@ const WorkspaceComponent = (props: {
};

const initiateParseFlowJo = async (flowJoJson: any) => {
await ParseFlowJoJson(flowJoJson, workspace.files);
await dowloadAllFileEvents(props.shared, props.experimentId);
try {
await ParseFlowJoJson(flowJoJson, workspace.files);
} catch (e) {
snackbarService.showSnackbar(
"Could not parse FlowJo workspace",
"warning"
);
}
setTimeout(() => {
setLoading(false);
}, 4000);
Expand Down Expand Up @@ -423,7 +438,7 @@ const WorkspaceComponent = (props: {
importFlowJoFunc(e);
}}
/>
Import Flow Jo
Import FlowJo (experimental)
</Button>
</Grid>
{process.env.REACT_APP_NO_WORKSPACES === "true" ? null : (
Expand Down
2 changes: 0 additions & 2 deletions src/graph/renderers/plotters/scatterPlotter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import PluginGraphPlotter, { applyPlugin } from "./PluginGraphPlotter";
import FCSServices from "services/FCSServices/FCSServices";
import { OvalGate, PolygonGate } from "graph/resources/types";
import * as PlotResource from "graph/resources/plots";
import { getDataset } from "graph/resources/dataset";
import { getPopulation } from "graph/utils/workspace";

interface ScatterPlotterState extends GraphPlotterState {}

Expand Down
7 changes: 0 additions & 7 deletions src/graph/resources/gates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ export const commitGateChange = async (gate: Gate) => {
});
};

export const commitGate = async (gate: Gate) => {
store.dispatch({
type: "workspace.ADD_GATE",
payload: { gate },
});
};

export const isPointInsideGate = (
gate: Gate,
point: { x: number; y: number }
Expand Down
14 changes: 0 additions & 14 deletions src/graph/resources/plots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,6 @@ export const commitPlotChange = (plot: Plot) => {
});
};

export const commitPlot = (plot: Plot) => {
store.dispatch({
type: "workspace.ADD_PLOT",
payload: { plot },
});
};

export const commitPlots = (plots: Array<Plot>) => {
store.dispatch({
type: "workspace.ADD_PLOTS",
payload: { plots },
});
};

export const createPlot = ({
clonePlot,
id,
Expand Down
7 changes: 0 additions & 7 deletions src/graph/resources/populations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ export const commitPopulationChange = async (population: Population) => {
});
};

export const commitPopulation = async (population: Population) => {
store.dispatch({
type: "workspace.ADD_POPULATION",
payload: { population },
});
};

export const createPopulation = ({
clonePopulation,
id,
Expand Down
2 changes: 1 addition & 1 deletion src/graph/utils/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ const loadSavedWorkspace = async (
const newWorkspace = { ...workspaceObj, files: getWorkspace().files };
await store.dispatch({
type: "workspace.LOAD_WORKSPACE",
payload: { workspace: workspaceObj },
payload: { workspace: newWorkspace },
});
};
Loading

0 comments on commit 65b39c2

Please sign in to comment.