microbiomedata / metaMAGs

Workflow for metagenome assembled genomes generation.
5 stars 4 forks source link

Graphic in documentation is vertically stretched (deviating from native proportions) #58

Open eecavanna opened 2 hours ago

eecavanna commented 2 hours ago

Broken version

image

Underlying code (in .rst file):

.. image:: mags_workflow2024.png
   :scale: 65%
   :alt: Metagenome assembled genomes generation 

Fixed version

image

Underlying code (in .rst file):

.. image:: mags_workflow2024.png
   :alt: Metagenome assembled genomes generation 

Remarks

When scale is specified, the resulting HTML markup includes some inline styles, as shown here:

<img ... style="width: 1248.0px; height: 409.5px;">

That is forcing the web browser to show the image with a height that is some predefined number of pixels (in this case, 409.5; but any other constant would cause the same issue).

Meanwhile, the web browser is setting the width to be whatever its container allows it to be, which (a) depends on the page layout, (b) can vary as the viewport width varies, and (c) is generally not 1248.0 pixels (although it may happen by coincidence).

I will open a PR containing the fix.

eecavanna commented 2 hours ago

Note: I used these commands to build the documentation locally (for testing).

git clone https://github.com/microbiomedata/metaMAGs.git
cd ./metaMAGs/docs
docker run --rm -it -v .:/docs sphinxdoc/sphinx sphinx-build -M html . _build

Then, I opened file:///path/to/metaMAGs/docs/_build/html/index.html in my web browser (to preview the result).

image