Closed danieleguido closed 2 years ago
The default behaviour is that each figure has a fixed height of half browser height. This can be changed using cell tags:
h-<N>px
to have a specific height in px of the content box, that is h-250px
to have a 250px height;aspect-ratio-<w>-<h>
to maintain a correct aspect ratio. You can use here the original dimension, the ratio being calculated as w/h
; for instance, aspect-ratio-1234-200
correctly scale your image of 1234px width and 200px height@danieleguido problem by using the fingerprint functionnality and by trying to dispaly the article: http://localhost:3000/en/article/JJszM3GwAYDs http://localhost:3000/en/article/JJszM3GwAYDs?idx=101&layer=hermeneutics
ok for h-valuepx need to look at: for aspect-ratio- http://localhost:3000/en/notebook-viewer/JTJGcHJveHktZ2l0aHVidXNlcmNvbnRlbnQlMkZqZG[…]RLQmpSJTJGZmVhdHVyZS1yYXRpbyUyRkpESF9BcnRpY2xlLmlweW5i?idx=13
This PR aims at fixing the scrollintoView bug when dynamic content is present. Scenario: user click on the ToC or click to on one cell in the article fingerprint vis to reach a specific paragraph in the article. If there is dynamically added content above the desired paragraph, like images and javascript powered datavis, the scrollIntoView() method does not work, as it would align to the wrong position.
Solution I've added a rule of thumb of 50% window height to each Figure in the article and the possibility of setting the aspect ratio or the height in px directly from cell tags (more details below in a comment of this PR).
For dynamic content this fixed height is applied as
minHeight
to avoid the presence of a scrollbar, then there's basically no difference from what we got before. In most cases, those scripts set a fixed height themselves that they more or less respect (with the annoying message "bokeh is loaded." that add random vertical height to the box); in other cases, the .5% of window height is enough to make the desired paragraph visible on the page. Instead, for images. The result is this below, with floating images in the middle of the fixed height box (in grey, just to make it visible here):