-
Notifications
You must be signed in to change notification settings - Fork 30
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
VV - UI + Styles #6573
base: master
Are you sure you want to change the base?
VV - UI + Styles #6573
Conversation
69b6604
to
069b614
Compare
- Add 4, 8, 16, 32, and 64 example to Storybook - Add Histogram range slider - Add params to overall Viewer - Fix scroll bug - Inline OrbitControls import - Incorporate Figma Styles
@seanmiller26 - I have incorporated all of your suggestions minus the outline for the frames within the Cube... This proved more mathematically difficult so I've punted for when I'm back. I also took the liberty of re-adding the rounded corners in dark mode on mobile because it follows the design intention more consistently. Easy to change if you disagree! |
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.
I reviewed by running lib-subject-viewer's Storybook and testing the workflow of your VV test project and the NeuroTracerBrain test project. I've left a few comments/questions, but otherwise skimmed the lib-subject-viewer code because 2k lines of changes is a lot for an in-depth review.
The steps in How To Review work as expected, but I have a few additional UI questions:
- Should the interaction to expand / collapse include clicking the text label? For example, as a user I expected to be able to click on the word "Expand" or the carat icon to expand the plane, but for now only the carat can be interacted with.
- Have you noted the accessibility violations in Storybook? For instance, the Slider in particular is missing accessible labels. And in general, the Cube area doesn't have aria to announce the contents to a screen reader (for example, the bar chart for user stats has an aria-label to communicate the description of the bar chart). These points don't have to be resolved in this PR, but definitely should be documented todos, maybe in the project board?
- The test project UI includes zoom buttons and rotate button in the image toolbar. What are the plans for those and is the intended UX documented in the project board?
And lastly, this is potentially already behavior you're aware of, but there's a console error generated by Cube.js TypeError: Cannot set properties of undefined (setting 'x')
. I can reliably produce the error by running NeuroTracerBrain locally in dev mode. In dev mode, it's a console error, but in production mode there's no error. With this test project in particular, it also takes an unexpectedly long time for annotations to show up on the Cube and Plane after a user click (about 5 - 10 seconds). The delay could be unrelated to the console error, but wanted to document a detailed UX during review so performance issues and errors can be added to the project board if not addressed in this PR.
subject={subject} | ||
/> | ||
const config = { | ||
annotations: [], |
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.
annotations
is being defined here as a prop, but not used in the React component it's passed to 🤔 Did you mean to? Looking at the VolumetricViewer in lib-subject-viewers, the component does not expect to receive annotations
as a prop.
@@ -4,3 +4,5 @@ This directory holds all the relevant code for rendering the VolumetricViewer. T | |||
|
|||
- `VolumetricViewerComponent` - a React component for the VolumetricViewer | |||
- `VolumetricViewerData` - a function that returns the data with instantiated models along with the React Component | |||
|
|||
NOTE: Webpack has trouble importing from a node_module package from dependent package chains (`lib-subject-viewers` => `lib-classifier` => `app-project`), therefore we have inlined `OrbitControls.js` file so that it works without Webpack issues. When updating the `three` dependency in `package.json` make sure to copy the file from `node_modules/three/examples/jsm/controls/OrbitControls.js` to `lib-subject-viewers/src/VolumetricViewer/helpers/OrbitControls.js`. |
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.
Suggested change in wording because FEM can use node_module resources lib => lib-classifier => app-project, and an example is whenever the repo requires lib-react-components => lib-classifier => app-project. However, in this case OrbitControls is a ES Module, and FEM is not pure ESM (hence the cjs export scripts in all package.json), so trying import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
throws the error ESM packages (three/examples/jsm/controls/OrbitControls) need to be imported
in lib-subject-viewers/dist/cjs/VolumetricViewer/components/Cube.js
.
NOTE: Webpack has trouble importing from a node_module package from dependent package chains (`lib-subject-viewers` => `lib-classifier` => `app-project`), therefore we have inlined `OrbitControls.js` file so that it works without Webpack issues. When updating the `three` dependency in `package.json` make sure to copy the file from `node_modules/three/examples/jsm/controls/OrbitControls.js` to `lib-subject-viewers/src/VolumetricViewer/helpers/OrbitControls.js`. | |
NOTE: OrbitControls are typically imported as `import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'` but that syntax throws an error due to FEM not being pure ESM, therefore we have inlined `OrbitControls.js` file so that it works without bundling issues. When updating the `three` dependency in `package.json` make sure to copy the file from `node_modules/three/examples/jsm/controls/OrbitControls.js` to `lib-subject-viewers/src/VolumetricViewer/helpers/OrbitControls.js`. |
/* RAW SVG FOR SLIDER | Needs to be URL encoded to view | ||
const SVGSlider = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'> | ||
<rect width='100%' height='100%' rx='8' ry='8' style='fill: rgb(0,93,105);' /> | ||
<path d='M16 10 l-7 6 l7 6;' style='stroke:rgb(173, 221, 224); stroke-width:2; fill: none;'/> | ||
<path d='M24 10 l7 6 l-7 6;' style='stroke:rgb(173, 221, 224); stroke-width:2; fill: none;'/> | ||
</svg>` | ||
*/ |
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.
I noticed this is commented-out, did you want to keep it in the Slider.js code?
@@ -14,7 +14,7 @@ export const ModelViewer = () => { | |||
planesAbsoluteSets: [[], [], []], | |||
planeFrameActive: [0, 0, 0], | |||
points: [], | |||
threshold: { min: 0, max: 255 }, | |||
threshold: { min: 5, max: 255 }, // min of 5 cuts out missing data noise |
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.
Out of curiosity, will uploaded subjects possibly have missing data?
Package
Describe your changes
How to Review
lib-subject-viewers
Storybook locallyPlease Review
app-project
or on the branch deployDesign Review Notes (from meeting with Sean)
Future PR / Not Implemented
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedGeneral UX
Example Staging Project: i-fancy-cats