Skip to content
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 option to place bar plot legend on the bottom #2397

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

vladsavelyev
Copy link
Member

@vladsavelyev vladsavelyev commented Feb 27, 2024

Allow to place legend at the bottom of the bar plot with barplot_legend_on_bottom:

multiqc -fv test_data/data/modules -m star --cl-config "barplot_legend_on_bottom: true"
Screenshot 2024-02-27 at 22 21 46

Fixes #2390

Default is false and it's not recommended to set it, as it would look well only on medium-sized plots, but would overlap with ticks labels on shorter plots or create a huge gap on taller plots, e.g.:

Screenshot 2024-02-27 at 22 22 49 Screenshot 2024-02-27 at 22 22 35

Unfortunately, Plotly doesn't allow to control that gap between the plot and the legend.

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! If we could just have a mention of this in the docs that'd be great. With caveats as to why it's not set like this by default.

It'd fit well here: https://multiqc.info/docs/reports/customisation/#customising-plots

Copy link
Contributor

🚀 Deployed on https://mqc-pr-2397--multiqc.netlify.app

@vladsavelyev vladsavelyev merged commit d62d039 into main Feb 28, 2024
6 of 7 checks passed
@vladsavelyev vladsavelyev deleted the barplot_legend_on_bottom2 branch February 28, 2024 11:32
vladsavelyev added a commit to grst/MultiQC that referenced this pull request Feb 28, 2024
* Add option to place bar plot legend on the bottom

* [automated] Update CHANGELOG.md

* Update docs

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>
ewels added a commit that referenced this pull request Feb 28, 2024
* Init module from cellranger module

* Replace cellranger occurences

* Change data fields to match spaceranger report

* Add plots

* Make gDNA QC optional

* fix pre-commit

* Add empty doi reference

* Make saturation plot optional

* Update module documentation

* adjust color scales

* Hide some more columns by default

* Display integer columns as such

* Fix ruff

* Add add_software_version

* Add table ids

* Convert None to float

* Revert "Convert None to float"

This reverts commit 73d8d71.

* Convert str 'None' to None

* trigger ci

* Add sample name along with software version

* PyProject

* Merge artefact

* Do not shadow built-in str

* Add table titles

* Standardize gitignore

* Remove future from init

* Do not wrap entrie .plot() function in try-except just to check if a key is in a dictionary

* Changelog

* Update docs/modules/spaceranger.md

Co-authored-by: Phil Ewels <phil.ewels@seqera.io>

* Update docs/modules/spaceranger.md

Co-authored-by: Phil Ewels <phil.ewels@seqera.io>

* When checking for git SHA, make sure we are not inside another git repo (#2399)

* When checking for git SHA, make sure we are not inside another git repository

* [automated] Update CHANGELOG.md

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>

* Add export button for table (#2394)

* Violin plot export: use metric titles instead of IDs

* Add Export button for table. Do not prefix violin ID, instead prefix table.

* Violin save_data_file: use titles instead of metric ids as well

* [automated] Update CHANGELOG.md

* Fix

* Fix linting

* CSP

* Wrap table buttons in .col-xs-12 too to add some bottom padding

* Use Export as CSV wording

* Fix the edge case

* Fix the edge case - 2

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>

* Add option to place bar plot legend on the bottom (#2397)

* Add option to place bar plot legend on the bottom

* [automated] Update CHANGELOG.md

* Update docs

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>

* Use a padded span with `nowrap` instead of `&nbsp;` before suffixes in table cells (#2395)

* Violin plot export: use metric titles instead of IDs

* Add Export button for table. Do not prefix violin ID, instead prefix table.

* Violin save_data_file: use titles instead of metric ids as well

* [automated] Update CHANGELOG.md

* Fix

* Avoid &nbsp; in tables

* Fix linting

* Unnecessary nowrap

* Use a small space span before suffix

* [automated] Update CHANGELOG.md

* Also replace &nbsp; with a space in case if modules set it

* changelog

* Fix linting

* CSP

* Update old class name in the old highcharts theme

* Fix CSP

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>
Co-authored-by: Phil Ewels <phil.ewels@seqera.io>

* Fix megaqc warning (#2401)

* Move multiqc_data.json export out of megaqc.py and into util_functions

* Better error message

* [automated] Update CHANGELOG.md

* Keep script_path str

---------

Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>
Co-authored-by: Vlad Savelyev <vladislav.sav@gmail.com>

* Fix anchors/ids

* Merge artefact

* Violin: do not add namespace if there is only one

* Nice column title

* Less aggressive FAIL background

---------

Co-authored-by: Phil Ewels <phil.ewels@seqera.io>
Co-authored-by: Vlad Savelyev <vladislav.sav@gmail.com>
Co-authored-by: MultiQC Bot <multiqc-bot@seqera.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option for graphs to shift legend back to bottom instead of right
3 participants