-
Notifications
You must be signed in to change notification settings - Fork 43
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
Update to new raster schema and add multi-image demo #515
Conversation
eef0a1b
to
df3a046
Compare
hmm this seems related to travis issue: storybookjs/storybook#10477 |
.travis.yml
Outdated
@@ -2,7 +2,7 @@ sudo: false | |||
|
|||
language: node_js | |||
node_js: | |||
- 13 | |||
- 12 |
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.
Temporary fix for issue with babel storybookjs/storybook#10477
First and foremost, holy smokes! This is it! The overlay is gorgeous and I love how the opacity works. The controllers are gorgeous and intuitive. A few questions and observations before I start reviewing code:
I would not say any of these are blockers, though, especially if Nils has given the OK to each or any of them. On to code! |
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, I think: Most of the comments are in the json schema. Almost all about trees and not the forest... if there's a bigger picture I should try to think about, let me know?
"examples": ["quantitative", "nominal", "ordinal", "temporal"] | ||
}, | ||
"values": { | ||
"type": ["array", "null"], |
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.
Less special case checking down stream if this is always an array, perhaps of zero length?
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.
Currently what we decided in in vitessce-data
is that null is allowed. Ilan and I have been talking about how to represent dimensions better, but I think we should allow this for the time being. vitessce/vitessce-data#90
} | ||
} | ||
}, | ||
"imageDimensions": { | ||
"type": "array", |
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 the length typically be 2? Add a constraint for that? -- Or I may be misunderstanding the purpose.
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.
image dimensions are defined as and array of {name, type, values}
. So for N-dimensional images [time, z, channel, y, x]
the dimensions would be of length 5?
Should the "Add Image Layer" button press also automatically add one (the first) channel? Is there a case in which you would want an image layer but not at least one channel? Unrelated: is the goal for the Layers > molecules, cells, neighborhoods to eventually be moved into this component? |
We hadn't discussed a heuristic, and I didn't think there was an "obvious" choice. Making a small PR to add layers automatically based on said heuristic should be very straight-forward to implement, but I wanted to include others in the discussion. On top of that, I think it would be great to have a declarative way to specify this (which would override any heuristic we have). Perhaps something in the raster schema, but again, I think that's beyond the scope of this PR.
Yes, this was removed in the most recent raster schema. I think mostly because when we get image data with more than 1 extra dimension, we will need some type better structure to storing these pre-calculated ranges (i.e. a simple array of ranges doesn't work, unless we also use a notion of strides and offsets). I think this is something we should also discuss in a separate PR (since the data source no longer has the information and changing would require a change there as well).
Totally agree. When we come up with a way of storing these ranges, we can use some sensible heuristics.
This feels coupled to the CSS solution. I could spend a lot of time hashing out how to make this combination of Material just right, but I'd rather come up with a standard way of how we are going to do CSS (my vote is for |
"image": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["name", "url", "type", "metadata"], |
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.
Not sure there is an action item here, but I think metadata
will be optional (might change when I integrate CODEX) since I anticipate OMEXML capturing most of that for pyramids/CODEX.
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.
Yeah definitely good to have on our radar, but I think right now the machinery in vitessce is set up expecting these metadata. In the next cycle, I think vitessce should get these data from the loaders after initialized:
const { dimensions } = loader;
instead of:
const { metadata } = raster_json;
const { dimensions } = metadata;
@manzt Agreed on styled components. I'll share the config momentarily. I agree with Mark about adding one channel |
I believe this config will work for the static layout:
|
Ok, I changed the Linnarsson layout and tried to address many of the comments above. Now pressing "Add Image Layer" will automatically add a channel (and have the layer panel open by default). I think the slider ranges should be addressed in a separate PR, along with exploring |
* Change rectangle selection to dragging (#520) * Update to new raster schema and add multi-image demo (#515) * Add Material UI Icons * Change `Channels` component to `LayerController` * Use raster schema v0.0.1 * Migrate to functional subscribers and allow for multiple layers * Reduce size of PubSub `LAYER_CHANGE` events * Memoize derived data in Subscribers * Change Linnarsson static layout * Add a higlass component (#523) * Initial higlass commit * Update styles, use onReady function * Update (#482) * Change height calculation * Changelog * Lazy load higlass component * Lint * Minor update * Merge * Clean up higlass integration, update styles, move higlass viewconfig into vitessce viewconfig * Whitespace * Styles * Comments * Remove bootstrap * Remove more bootstrap * Update src/components/higlass/HiGlassSubscriber.js Co-authored-by: Trevor Manz <[email protected]> * Lint * Clean up css * Clean up css again * Remove weird line height value * Figure out react.lazy Co-authored-by: Sehi L'Yi <[email protected]> Co-authored-by: Trevor Manz <[email protected]> * 0.1.1 * Revert "0.1.1" This reverts commit 88eb6a0. * Clear rectangle or lasso selection on click (#530) * Handle clicks during rectangle and lasso * Use constants for edit types rather than strings/nulls * viv 0.2.2 (#531) * Upgrade viv to 0.2.2 * Changelog * Changelog version * 0.1.1 * Changelog * Changelog Co-authored-by: Trevor Manz <[email protected]> Co-authored-by: Sehi L'Yi <[email protected]>
* Change rectangle selection to dragging (#520) * Update to new raster schema and add multi-image demo (#515) * Add Material UI Icons * Change `Channels` component to `LayerController` * Use raster schema v0.0.1 * Migrate to functional subscribers and allow for multiple layers * Reduce size of PubSub `LAYER_CHANGE` events * Memoize derived data in Subscribers * Change Linnarsson static layout * Add a higlass component (#523) * Initial higlass commit * Update styles, use onReady function * Update (#482) * Change height calculation * Changelog * Lazy load higlass component * Lint * Minor update * Merge * Clean up higlass integration, update styles, move higlass viewconfig into vitessce viewconfig * Whitespace * Styles * Comments * Remove bootstrap * Remove more bootstrap * Update src/components/higlass/HiGlassSubscriber.js Co-authored-by: Trevor Manz <[email protected]> * Lint * Clean up css * Clean up css again * Remove weird line height value * Figure out react.lazy Co-authored-by: Sehi L'Yi <[email protected]> Co-authored-by: Trevor Manz <[email protected]> * 0.1.1 * Revert "0.1.1" This reverts commit 88eb6a0. * Clear rectangle or lasso selection on click (#530) * Handle clicks during rectangle and lasso * Use constants for edit types rather than strings/nulls * viv 0.2.2 (#531) * Upgrade viv to 0.2.2 * Changelog * Changelog version * 0.1.1 * Changelog * Changelog * Fix horizontal scroll bug (#534) * Fix horizontal scroll bug * Changelog * Update CHANGELOG.md Co-authored-by: Trevor Manz <[email protected]> Co-authored-by: Sehi L'Yi <[email protected]>
I'd wished that a more general solution for our CSS could be a part of this PR, but I think that it's beyond the scope of the PR and would rather have the model for adding/changing/removing image layers from a spatial component in place before tackling that.
The primary changes in this PR are:
raster.json
at the top level and changingChannels
component toLayerController
which is responsible for adding/removing/changing vivImage layers in the Spatial component.RASTER_ADD
events are now subscribed to in theLayerController
, which can publishLAYER_ADD
/LAYER_REMOVE
/LAYER_CHANGE
events (which are subscribed to in theSpatialSubscriber
).v0.2.0
I've tried to add comments and be clear about things on the horizon after this PR, which include:
styled-componets
.