Closed y9c closed 1 year ago
It looks like there are three cells being emitted by bokeh if we run the corresponding .ipynb file:
{
"cells": [
{
"cell_type": "raw",
"id": "ff951fb8",
"metadata": {},
"source": [
"---\n",
"title: test webpage\n",
"format:\n",
" html:\n",
" code-fold: true\n",
"keep-md: true\n",
"keep-ipynb: true\n",
"---"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "fig-demo",
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"(function(root) {\n",
"...",
"}(window));"
],
"application/vnd.bokehjs_load.v0+json": "(function(root) {...",
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
" <div class=\"bk-root\" id=\"9107e47f-bdc3-4fc2-9fc5-fc860b2b3abe\" data-root-id=\"1003\"></div>\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"(function(root) {\n",
"...",
"})(window);"
],
"application/vnd.bokehjs_exec.v0+json": ""
},
"metadata": {
"application/vnd.bokehjs_exec.v0+json": {
"id": "1003"
}
},
"output_type": "display_data"
}
],
"source": [
"#| label: fig-demo\n",
"#| fig-cap: This is a demo figure for debug\n",
"\n",
"from bokeh.io import output_notebook\n",
"output_notebook(hide_banner=True)\n",
"\n",
"from bokeh.palettes import Spectral5\n",
"from bokeh.plotting import figure, show\n",
"from bokeh.sampledata.autompg import autompg as df\n",
"from bokeh.transform import factor_cmap\n",
"\n",
"df.cyl = df.cyl.astype(str)\n",
"group = df.groupby('cyl')\n",
"cyl_cmap = factor_cmap('cyl', palette=Spectral5, factors=sorted(df.cyl.unique()))\n",
"p = figure(height=350, x_range=group, title=\"MPG by # Cylinders\", toolbar_location=None, tools=\"\")\n",
"p.vbar(x='cyl', top='mpg_mean', width=1, source=group, line_color=cyl_cmap, fill_color=cyl_cmap)\n",
"show(p)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "36ad8b05",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
I think what's happening is that bokeh
or jupyter
is using the "output_type": "display_data"
entry in the output to denote that this is "not really" an output cell, and so we should treat these differently in our output.
Yes. The example in another issue will have the same problem when you set the figure label as fig-xxx
.
https://github.com/quarto-dev/quarto-cli/issues/1867 https://jja.quarto.pub/quarto-basics/
Hi @cscheid , can I set fig-subcap: false
? I try this option but it is not working.
No, it doesn't work like that; that option is for you to provide the different subcaptions, instead of enabling or disabling it
Thank @cscheid . I found fig-subcap: true
in the document (https://quarto.org/docs/authoring/cross-references.html). So I though there is a fig-subcap: false
option.
@y9c the documentation you linked says: "If you’d like subfigure captions that include only an identifier, e.g. “(a)”, and not a text caption, then specify fig-subcap: true
rather than providing explicit subcaption text:"
Thank you @cscheid .
I would like to know if there is a quick solution to fix this on the user side. Or I need to wait for a patch commit for this.
Hi @cscheid,
Is there a solution to remove subfigure caption?
Thanks.
You will see an update here when this issue is addressed.
This issue still remains after testing the last pre-release version. This is a warning message:
WARNING: jupyter-fixup: cells without output data. Will not fixup bokeh cell
You might need to update something else on your end. This is what I see:
I’m still getting the bug originally posted by @y9c. I tried it for two different Bokeh example figures. It did not show up in original example. It did, however, show up in a second example I used from a Bokeh tutorial.
Thanks in advance for your help. I really want to use Bokeh reliably within Quarto.
@prairie-guy We need more information about your installation. Can you please post the output of quarto check
?
Wow! Thanks for quick response @cscheid. Here you go:
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.58.3: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.450
Path: /home/cdaniels/mambaforge/envs/biop/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.13 (Conda)
Path: /home/cdaniels/mambaforge/envs/biop/bin/python
Jupyter: 5.4.0
Kernels: python3, julia-1.9, ir
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.3.2
Path: /usr/lib/R
LibPaths:
- /home/cdaniels/R/x86_64-pc-linux-gnu-library/4.3
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.45
rmarkdown: 2.25
[✓] Checking Knitr engine render......OK
1.3.450
Can you try this instead? https://github.com/quarto-dev/quarto-cli/releases/tag/v1.4.528
Not fixed. Same problem. Downloaded repo and installed most current version 1.4.529
with ./configure.sh
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
Path: /home/cdaniels/junk/quarto/quarto-cli/package/dist/bin
Check file:///home/cdaniels/junk/quarto/quarto-cli/src/resources/vendor/deno-land/x/puppeteer@9-0-2/mod.ts
[✓] Checking tools....................OK
TinyTeX: v2023.12
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/cdaniels/.TinyTeX/bin/x86_64-linux
Version: 2023
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.0 (Conda)
Path: /home/cdaniels/mambaforge/envs/quarto/bin/python
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with conda install jupyter
[✓] Checking R installation...........OK
Version: 4.3.2
Path: /usr/lib/R
LibPaths:
- /home/cdaniels/R/x86_64-pc-linux-gnu-library/4.3
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.45
rmarkdown: 2.25
[✓] Checking Knitr engine render......OK
Not sure why Jupyter is not installed. (Installed with both mamba and conda). It does shows up in correct env:
Selected Jupyter core packages...
IPython : 8.18.1
ipykernel : 6.26.0
ipywidgets : 8.1.1
jupyter_client : 8.6.0
jupyter_core : 5.5.1
jupyter_server : 2.12.1
jupyterlab : 4.0.9
nbclient : 0.8.0
nbconvert : 7.13.0
nbformat : 5.9.2
notebook : 7.0.6
qtconsole : 5.5.1
traitlets : 5.14.0
@cscheid @prairie-guy I can reproduce this, so I moved over to a new issue for 1.4 instead of continuing in this one.
@prairie-guy just FYI, you have a typo in embeded-resoures: true
(that should embed-resources
)
Thanks
Bug description
Code: