-
Notifications
You must be signed in to change notification settings - Fork 22
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
Reorder genes plots #742
Reorder genes plots #742
Conversation
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖
|
Page | Size (compressed) |
---|---|
global |
521.31 KB (🟡 +28 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Thirteen Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/data-management |
301.08 KB (🟡 +45 B) |
822.38 KB |
/experiments/[experimentId]/data-exploration |
535.3 KB (🟡 +6 B) |
1.03 MB |
/experiments/[experimentId]/data-processing |
499.88 KB (-3 B) |
1021.19 KB |
/experiments/[experimentId]/plots-and-tables |
14.89 KB (🟡 +1 B) |
536.2 KB |
/experiments/[experimentId]/plots-and-tables/dot-plot |
476.66 KB (🟡 +2 B) |
997.96 KB |
/experiments/[experimentId]/plots-and-tables/embedding-categorical |
473.28 KB (🟡 +2 B) |
994.58 KB |
/experiments/[experimentId]/plots-and-tables/embedding-continuous |
473.97 KB (🟡 +2 B) |
995.28 KB |
/experiments/[experimentId]/plots-and-tables/frequency |
475.07 KB (🟡 +2 B) |
996.38 KB |
/experiments/[experimentId]/plots-and-tables/heatmap |
547.24 KB (🟡 +4 B) |
1.04 MB |
/experiments/[experimentId]/plots-and-tables/marker-heatmap |
572.04 KB (🟡 +22.43 KB) |
1.07 MB |
/experiments/[experimentId]/plots-and-tables/violin |
474.11 KB (🟡 +2 B) |
995.42 KB |
/experiments/[experimentId]/plots-and-tables/volcano |
477.46 KB (🟡 +2 B) |
998.76 KB |
/settings/profile |
25.37 KB (-1 B) |
546.68 KB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
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 took a look overall since you mentioned it is a work in progress. It looks good!
One suggestion I would make to get rid of the lag between dropping a gene and the list updating would be having onGeneReorder
call
setGeneTreeData(composeGeneTree(newOrder));
debouncedUpdatePlotConfig(newOrder)
with debouncedUpdatePlotConfig
being something like this:
const debouncedUpdatePlotConfig = useCallback(
_.debounce((newOrder) => dispatch(updatePlotConfig(plotUuid, { selectedGenes: newOrder })), time), [],
);
(time
here can be pretty small probably, it's just about it updating a little bit later).
With these 2 changes it should no longer need to wait for redux to finish updating before setting the gene in its new place in the list, so it might look faster (with the plot updating a little bit later).
If you search for _.debounce
you should find some places where similar things were done in case you want to check other examples. I think it was done a lot in "Data Processing".
Codecov Report
@@ Coverage Diff @@
## master #742 +/- ##
==========================================
+ Coverage 82.79% 82.93% +0.13%
==========================================
Files 481 483 +2
Lines 8249 8302 +53
Branches 1628 1633 +5
==========================================
+ Hits 6830 6885 +55
+ Misses 1357 1356 -1
+ Partials 62 61 -1
Continue to review full report at Codecov.
|
src/__test__/pages/experiments/[experimentId]/plots-and-tables/marker-heatmap/index.test.jsx
Outdated
Show resolved
Hide resolved
src/__test__/pages/experiments/[experimentId]/plots-and-tables/marker-heatmap/index.test.jsx
Outdated
Show resolved
Hide resolved
src/__test__/pages/experiments/[experimentId]/plots-and-tables/marker-heatmap/index.test.jsx
Outdated
Show resolved
Hide resolved
src/__test__/pages/experiments/[experimentId]/plots-and-tables/marker-heatmap/index.test.jsx
Outdated
Show resolved
Hide resolved
src/__test__/pages/experiments/[experimentId]/plots-and-tables/marker-heatmap/index.test.jsx
Show resolved
Hide resolved
// Introduce testing for drag and drop if possible | ||
// In Jest (jsdom) DragEvent and properties to do with rendering (widths, coordinates) | ||
// don't exist -> not possible to test? |
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.
If you want to test it one option could be to get the onDrop
prop your HierarchicalTreeGenes
component passed to Tree
and then trigger it yourself.
const tree = component.find('HierarchicalTreeGenes Tree');
tree.getElement().props.onDrop(dropInfo);
component.update();
It would involve using enzyme (which kind of breaks a little bit the idea/philosophy of using rtl, but since rtl doesn't support drag and drop I think it makes sense in this case).
This is just and idea because I read this comment, but it's not necessarily something you need to do.
src/pages/experiments/[experimentId]/plots-and-tables/marker-heatmap/index.jsx
Outdated
Show resolved
Hide resolved
src/components/plots/hierarchical-tree-genes/HierarchicalTreeGenes.jsx
Outdated
Show resolved
Hide resolved
src/components/plots/hierarchical-tree-genes/HierarchicalTreeGenes.jsx
Outdated
Show resolved
Hide resolved
…lenics/ui into reorder-genes-plots
@jszpila314, before implementing a new interface for the genes reorder functionality, did you try to make the existing I was looking at the Select component examples in Antd: https://ant.design/components/select/, this specific type: |
My suggestion in my previous comment should work. I did a couple of small trials here: https://codesandbox.io/s/eager-archimedes-6uj4fk?file=/index.js What you need to do is to make each entry in
You can create a new state variable
and have a function that populates the entries in this new variable and call it:
Then you pass
And you should get the same UI, but draggable and reorderable. Afterwards, you will need to take a look and see if the backend takes this order into an account and if not, fix it. This is just a pseudo-code, it won't compile if you paste it, but I hope that it helps with getting the idea of what I mean. I think that it is worth a try, it should work. There is no point implementing a brand new separate interface just for ordering genes if we can make the existing interface reorder them. |
Description
Added a separate tab under gene selection in the marker heatmap plot to allow reordering of genes.
Details
URL to issue
https://biomage.atlassian.net/browse/BIOMAGE-1918
https://ui-jakub-ui742.scp-staging.biomage.net/
Link to staging deployment URL (or set N/A)
N/A
Integration test branch
master
Merge checklist
Your changes will be ready for merging after all of the steps below have been completed.
Code updates
Have best practices and ongoing refactors being observed in this PR
Manual/unit testing
Integration testing
You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.
Documentation updates
Optional