Closed will-moore closed 4 years ago
The scale bar is no longer in the info page.
Now the confusion starts, which scale corresponds to which image?
When all the scale bars are visible, scale order = image order in Figure contains the following images
.
Now user will not know with one corresponds to which image
That's kinda outwith the scope of this PR. If you can think of a nice way to indicate that, then it might be worth adding, but I think it's quite an edge-case.
Usually you only have a single size of scalebar in a figure and the figure legend will say "Scale bars are 10 microns". If you have multiple different sizes of scalebar users tend to add a label to each scalebar so this info is is not really needed in the figure legend, but it doesn't do any harm.
One option could be to have the scale bar length after the link of the image.
I don't think this is outside this PR, since now the user will be confused since one is hidden and have a different scale bar
This PR fixes a Bug: if I have 2 images, only 1 of them shows a scalebar of 10um (the other has scalebar 20 um but the scalebar is hidden), but the info-page says "Scalebar Lengths 10 um, 20 um". This is fixed so the info-page ignores the hidden scalebar and correctly says "Scalebar Lengths 10 um". That is less confusing than it was before.
but the user does not know which one is the scale bar
Discussed privately with @will-moore, changing the current layout of the PDF will be challenging. We have more urgent things to do and balancing the time vs feature probably not worth it. I am still not convinced of the need of the Scale bar feature in the PDF when we have the scale bars on the images (if not hidden)
This PR fixes the problem in the current implementation
This fixes a minor bug, brought to light by an error from user at #379. The error was a KeyError because 'length' was missing from the scalebar dict (don't know why). The error came from the "Info-page" code, where we add scalebars to the the info page, and I noticed that this code was not taking the visibility of the scalebar into account.
Now, we ignore the hidden scalebars on the info page AND access length with ```scalebar.get('length') to avoid KeyError. Fixes #379
To test: