Are you also experiencing issues with ipynb previe...
# datascience
h
Are you also experiencing issues with ipynb preview of kotlin-kernel rendered/computed notebook in gitlab? It shows text output but strips all images.
i
Yes, I don't see the output in notebooks with python kernel either.
h
Thanks, do you know if there's a corresponding ticket I could vote for?
i
@holgerbrandl sorry, my brain wasn't working 🙂 - I don't actually use gitlab .
h
@Ilya Muradyan would you consider this more a problem with gitlab or a kotlin-kernel-bug? I've just double-checked, and python kernel images are displayed correctly by gitlab ipynb renderer but images in notebooks rendered with the current kotlin kernel fail to display.
message has been deleted
i
I think that it depends on what the nature of this image. Some libraries (i.e. lets-plot) output divs with the JS for rendering. Other libraries output pure images. So, in the first case images more likely will not be displayed. But, I think there is the way to render the plot to BufferedImage, for example, an then it will be represented as image tag and will be displayed
@Igor Alshannikov is it possible to transform the plot to the no-js form?
i
Yes, there is is non-API class:
Copy code
import jetbrains.datalore.plot.Plot SvgExport
which you can use to obtain plot's SVG as a string, which then can be displayed in notebook as HTML:
Copy code
PlotSvgExport.buildSvgImageFromRawSpecs(spec)
@holgerbrandl do you know why Gitlab fails to load/execute JS?
h
I don't use svg here, but Base64 encoded image which is returned as
org.jetbrains.kotlinx.jupyter.api.MimeTypedResult
with type
image/jpeg
(also see https://github.com/holgerbrandl/kravis/blob/4631a555c22f33464e771675f3cf60a1a83ef759/src/main/kotlin/kravis/device/JupyterDevice.kt#L59-L59). I've checked and the data seems correctly inlined in the ipynb file:
Copy code
{
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "/9j/4AAQSkZJRgA
The images are correctly displayed on github and nbpreview so it seems just gitlab preview which is struggling. It's certainly just a minor flaw, I just wanted to make sure that I'm not doing it wrong.