-
Notifications
You must be signed in to change notification settings - Fork 4
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: Loading from the landing page, viewer page routing #212
feature: Loading from the landing page, viewer page routing #212
Conversation
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.
Moved to website/LandingPage/content.ts
. I updated the viewerSettings
argument to enable channels, but otherwise everything else is the same.
// TBD what URL parameters to include here | ||
export type ViewerArgs = { | ||
baseurl: string; | ||
cellid: number; | ||
cellPath: string; | ||
fovPath: string; | ||
fovDownloadHref: string; | ||
cellDownloadHref: string; | ||
viewerSettings: ViewerChannelSettings; | ||
}; |
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 was removed and replaced with the AppProps
type that Cameron introduced in another PR.
import { ImageViewerApp, RenderMode, ViewerChannelSettings, ViewMode } from "../src"; | ||
import FirebaseRequest, { DatasetMetaData } from "./firebase"; | ||
import { AppProps, GlobalViewerSettings } from "../src/aics-image-viewer/components/App/types"; |
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.
All of the parsing logic below was moved to src/website/utils/url_utils.tsx
.
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 code was throwing an error due to the various refs being undefined on startup.
src/website/components/ErrorPage.tsx
Outdated
@@ -0,0 +1,54 @@ | |||
import React, { ReactElement } from "react"; |
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 file is copied from https://github.com/allen-cell-animated/nucmorph-colorizer/blob/main/src/routes/ErrorPage.tsx. The only change was editing the page content to give a more helpful error message.
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.
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.
Moved this file and edited the groups
argument. Same as the deleted content.ts
file.
…-styling - Adds the banner video MP4, which autoplays when loaded. - Also added an accessibility feature, where the video playback is disabled if `prefers-reduced-motion` is set to true. - Adds `Open Sans` via Google fonts. Existing fonts are still included to ensure compatibility with embedded use cases, but will be removed in the future. - Adds the `StyleProvider` component, which will wrap the `LandingPage` and `App` in the future to provide a central location for CSS variables. - Implements styling for the landing page.
// vars filled at build time using webpack DefinePlugin | ||
console.log(`website-3d-cell-viewer ${WEBSITE3DCELLVIEWER_BUILD_ENVIRONMENT} build`); | ||
console.log(`website-3d-cell-viewer Version ${WEBSITE3DCELLVIEWER_VERSION}`); | ||
console.log(`volume-viewer Version ${VOLUMEVIEWER_VERSION}`); | ||
|
||
export const VIEWER_3D_SETTINGS: ViewerChannelSettings = { |
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.
good to delete yes, but wondering how we can get test data like this into the viewer during dev. These settings are basically how we want the variance dataset to be presented in the viewer.
Can't respond directly to this for some reason, but I did end up adding props for the |
- Removes the Merriweather Sans and Overpass font files and replaces them with Open Sans.
Leaving further refactor of project until #215. |
|
||
import "antd/dist/antd.less"; | ||
|
||
// Components | ||
import AppWrapper from "../website/components/AppWrapper"; | ||
import LandingPage from "../website/components/LandingPage"; | ||
import ErrorPage from "../website/components/ErrorPage"; |
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.
Moving files to a separate website/ dir feels better. But doesn't it seem cleaner to put the contents of website under this public/ dir where index.tsx lives? I'm not sure if now is the time, but moving webpack config and the tsconfig that includes website files into the public app dir would help isolate things more clearly within this repo.
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.
#215 contains the correct answer!
"compilerOptions": { | ||
"module": "ES6" | ||
"module": "ES6", | ||
"outDir": "./dist" |
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.
Sanity check: To confirm that the separation is still good, run npm build
and check the es/ directory contains none of the website modules.
import { ViewMode } from "../../src/aics-image-viewer/shared/enums"; | ||
import { ViewerChannelSettings } from "../../src/aics-image-viewer/shared/utils/viewerChannelSettings"; | ||
|
||
const paramKeys = ["mask", "ch", "luts", "colors", "url", "file", "dataset", "id", "view"]; |
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.
an interesting todo is to add comments describing how these are parsed. In particular, the lut setting has some special shorthand encoding using p for percentile and m for median. For later..
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.
Will likely do this when #196 is implemented 👍
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.
Looks good overall!
Estimated review size: medium, 30-40 minutes
Closes #188, the landing page implementation!
This change finishes implementing loading from the landing page and also sets up routing for the app.
These changes seem large, but the majority of the changes are just file moves and renames! I'll note what files you can compare between, and a summary of any changes on each file.
Changes:
react-router-dom
and routes for the landing page (at root URL,/
) and viewer (/viewer
).landing-page
directory towebsite
, since it now includes several website-related components.AppWrapper
component, which wrapsImageViewerApp
.url_utils.tsx
.Videos (🔊)
Browser Router:
2024-04-12.11-38-40.mp4
Hash Router:
2024-04-12.11-40-15.mp4
Loading empty viewer:
Validation:
/viewer
page./viewer
page.