-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add color mapping to the bar chart #1218
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1218 +/- ##
=======================================
Coverage 59.39% 59.39%
=======================================
Files 64 64
Lines 4692 4692
Branches 372 372
=======================================
Hits 2787 2787
Misses 1813 1813
Partials 92 92
Continue to review full report at Codecov.
|
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 great to me; thanks Matt!
Coloring of Histrogram based up the x axis instead of y axis.
* Only color histograms that are selected for colorby * Add some small refactors to BrushableHistogram's componentDidUpdate
* Reuse binning functions from util/dataframe/histogram.js; this fixes an issue with there being near-zero width bins * Fix color mapping so that it matches the scale in the legend * Do not attempt to plot bins if the calculated binWidth is zero; this can happen if all values are the same * Refactor the function that draws the histogram a bit
eef9aff
to
8b083e8
Compare
Codecov Report
@@ Coverage Diff @@
## master #1218 +/- ##
=======================================
Coverage 59.40% 59.40%
=======================================
Files 64 64
Lines 4707 4707
Branches 374 374
=======================================
Hits 2796 2796
Misses 1819 1819
Partials 92 92
Continue to review full report at Codecov.
|
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.
Brief testing shows that this PR has introduced a bug with brush display in histograms.
Test case:
- load a dataset (I used TM_facs, and will refer to it throughout - although the bug should manifest in any dataset)
- brush select a continuous selection (I did n_counts):
Note that the main graph shows the subset of selected cells.
- Click color-by (droplet) button on same histogram. Note that the brush selection is gone, but that the cells are (correctly) still selected in the main graph.
The cells should stay selected (color-by changes do not modify the selection). What is very likely happening is that the changes to componentDidUpdate()
fail to correctly recognize when the brush needs to be re-rendered.
I have noted the line where this bug is located.
cfd1ebd
to
9bffe3d
Compare
Finishing up #1035
Changes made on top of @Donaldpherman's PR:
util/dataframe/histogram.js
; this fixes an issue with d3 generating near-zero width binsIllustration of fixes to color mapping are below. Each shows the legend scaled against the colored histogram bins.
Before (source @liaprins-czi):
After (source this PR):