Matplotlib max-h fix so that plots are not cut off (#1550)

`object-fit:contain` only works with `max-h` if they are set on the same element. I moved `max-h` to `img` and also increased the height a bit such that the plot has enough space and can adapt to the container height.

Fixes #1546
This commit is contained in:
Simon Duerr 2022-06-14 01:32:17 +02:00 committed by GitHub
parent 4048ac11b7
commit fdbecafffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,11 +67,11 @@
<div id="bokehDiv"/>
{:else if value && value["type"] == "matplotlib"}
<div
class="output-image w-full max-h-80 flex justify-center items-center relative"
class="output-image w-full flex justify-center items-center relative"
{theme}
>
<!-- svelte-ignore a11y-missing-attribute -->
<img class="w-full h-full object-contain" src={value["plot"]} />
<img class="w-full max-h-[30rem] object-contain" src={value["plot"]} />
</div>
{:else}
<div class="h-full min-h-[15rem] flex justify-center items-center">