Skip to content
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

Feature/zarr thumbnail renderer #118

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 142 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"redux": "4.0.x",
"redux-logic": "3.x",
"reselect": "4.0.x",
"string-natural-compare": "3.0.x"
"string-natural-compare": "3.0.x",
"zarrita": "^0.3.2"
}
}
24 changes: 13 additions & 11 deletions packages/core/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { initializeIcons, loadTheme } from "@fluentui/react";
import classNames from "classnames";
import { uniqueId } from "lodash";
import * as React from "react";
import { batch, useDispatch, useSelector } from "react-redux";
import { useDispatch, useSelector } from "react-redux";

import ContextMenu from "./components/ContextMenu";
import DataSourcePrompt from "./components/DataSourcePrompt";
import Modal from "./components/Modal";
import DirectoryTree from "./components/DirectoryTree";
import FileDetails from "./components/FileDetails";
Expand All @@ -14,7 +15,7 @@ import StatusMessage from "./components/StatusMessage";
import TutorialTooltip from "./components/TutorialTooltip";
import QuerySidebar from "./components/QuerySidebar";
import { FileExplorerServiceBaseUrl } from "./constants";
import { interaction, metadata, selection } from "./state";
import { interaction, selection } from "./state";

import "./styles/global.css";
import styles from "./App.module.css";
Expand Down Expand Up @@ -42,6 +43,7 @@ export default function App(props: AppProps) {
const { fileExplorerServiceBaseUrl = FileExplorerServiceBaseUrl.PRODUCTION } = props;

const dispatch = useDispatch();
const hasQuerySelected = useSelector(selection.selectors.hasQuerySelected);
const isDarkTheme = useSelector(selection.selectors.getIsDarkTheme);
const shouldDisplaySmallFont = useSelector(selection.selectors.getShouldDisplaySmallFont);
const platformDependentServices = useSelector(
Expand Down Expand Up @@ -70,14 +72,8 @@ export default function App(props: AppProps) {
}, [platformDependentServices, dispatch]);

// Set data source base urls
// And kick off the process of requesting metadata needed by the application.
React.useEffect(() => {
batch(() => {
dispatch(interaction.actions.setFileExplorerServiceBaseUrl(fileExplorerServiceBaseUrl));
dispatch(metadata.actions.requestAnnotations());
dispatch(metadata.actions.requestDataSources());
dispatch(selection.actions.setAnnotationHierarchy([]));
});
dispatch(interaction.actions.initializeApp(fileExplorerServiceBaseUrl));
}, [dispatch, fileExplorerServiceBaseUrl]);

return (
Expand All @@ -92,8 +88,14 @@ export default function App(props: AppProps) {
<div className={styles.querySidebarAndCenter}>
<QuerySidebar className={styles.querySidebar} />
<div className={styles.center}>
<GlobalActionButtonRow className={styles.globalButtonRow} />
<DirectoryTree className={styles.fileList} />
{hasQuerySelected ? (
<>
<GlobalActionButtonRow className={styles.globalButtonRow} />
<DirectoryTree className={styles.fileList} />
</>
) : (
<DataSourcePrompt />
)}
</div>
</div>
<FileDetails className={styles.fileDetails} />
Expand Down
Loading