-
Notifications
You must be signed in to change notification settings - Fork 54
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
Missing widget for some categorical values #65
Comments
The duplication of colours with the The legend widget is currently set to only be created for categorical data with 20 categories or less. It is not uncommon for people to pass in data with very large numbers of categories (hundreds) without thinking about it, and getting a ridiculous legend that is both unreadable and far larger than the plot. I was trying to avoid this, and 20 categories seemed like about the reasonable limit. So in general it doesn't show a legend for anything with too many categories. The fact that you do get one at all with Of course you seem to want a legend regardless, so perhaps it would be best if there was a way to override that behaviour and force a legend to appear (e.g. adding If you do just want an immediate fix then there are a couple of lines in datamapplot/static/js/colormap_selector.js that you can change: if (((colorMap.kind === "categorical") && (colorMap.colors.length <= 20) && Object.hasOwn(colorMap, "colorMapping")) || (colorMap.kind === "continuous") || (colorMap.kind === "datetime")) {
and if ((colorMap.kind === "categorical") && (colorMap.colors.length <= 20) && Object.hasOwn(colorMap, "colorMapping")) {
If you just set that 20 to a value larger than however many categories you have for your other classes it should work. Making this chance and the re-installing from the changed source should work. If you want an easier option then set I know that's a little messy, but it should provide immediate results -- otherwise you'll have to wait until I get time to implement an override option for displaying the legend. |
Thank you so much @lmcinnes for such a swift reply. I will try with your above pointers. But thanks so much for such a cool package! Edit: Just a thought, it would be nice, if we can scroll the legend. That way there is no need to make figure size bigger or make the font size of the text in the legend smaller. |
Hi,
Thanks for wonderful visualization package! I am having some issue with interactive visualization.
All 3 cell_ontology_class, mouse_sex, tissue are categorical values but I am able to generate widget only for mouse_sex but not for the other 2.
Also, when I try colormaps parameter, multiple cell_ontology_class or tissue has same color assigned and some of the labels are cutoff from the bottom.
May I know how to resolve these?
Many thanks in advance!
Datta
The text was updated successfully, but these errors were encountered: