Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] export_svgs() function creats two files (one is empty) #10273

Closed
mosc9575 opened this issue Jul 9, 2020 · 2 comments · Fixed by #10274
Closed

[BUG] export_svgs() function creats two files (one is empty) #10273

mosc9575 opened this issue Jul 9, 2020 · 2 comments · Fixed by #10274

Comments

@mosc9575
Copy link
Contributor

mosc9575 commented Jul 9, 2020

software version info (bokeh, python)

Python: 3.6.10
Bokeh: 2.1.1

Description of expected behavior and the observed behavior

While generating a svg export in bokeh 2.1.1 an unnecessary empty file is created, too. The second file gets the same name as the first one with a suffix "_1" right before the file extension.
It was expected that only on file is created.

Minimal example

import numpy as np
import bokeh.plotting as bk_plt
import bokeh.io as bk_io

bk_plt.output_notebook()

N = 500
x = np.linspace(0, 10, N)
y = np.linspace(0, 10, N)
xx, yy = np.meshgrid(x, y)
d = np.sin(xx)*np.cos(yy)

p2 = bk_plt.figure(x_range=(0, 10), y_range=(0, 10))
p2.image(image=[d], x=0, y=0, dw=10, dh=10, palette="Spectral11", alpha = 0.5)
p2.output_backend = 'svg'
bk_io.export_svgs(p2, filename = 'asdf.svg')

Screenshots

code_svg_exports
svg_exports

@mosc9575 mosc9575 added the TRIAGE label Jul 9, 2020
@mattpap mattpap added this to the 2.2 milestone Jul 9, 2020
@mattpap
Copy link
Contributor

mattpap commented Jul 9, 2020

Broken in PR #9948. Since we have a canvas per layer, then multiple SVG files are produced, because of this code:

var svgs = document.getElementsByClassName('bk-root')[0].getElementsByTagName("svg");

Technically a regression, but even adding a SVG icon would break this.

@mattpap
Copy link
Contributor

mattpap commented Jul 9, 2020

Together with PR #9964, we will be able to generate a single SVG in most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants