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

SVG not displaying scatter output #8446

Closed
cphalpert opened this issue Nov 19, 2018 · 4 comments · Fixed by #10402
Closed

SVG not displaying scatter output #8446

cphalpert opened this issue Nov 19, 2018 · 4 comments · Fixed by #10402

Comments

@cphalpert
Copy link

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Bokeh: 1.0.1
IPython: 6.5.0

Description of expected behavior and the observed behavior

I expect the chart below to contain both navy and red circles. The red circles are displayed, but the navy circles created by the .scatter method do not appear.

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.plotting import figure, show
from bokeh.io.export import get_svgs
from IPython.display import SVG

p = figure(plot_width=400, plot_height=400)
p.scatter([-1, -2, -3, -4, -5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5, marker='circle')
p.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="red", alpha=0.5)
p.output_backend = 'svg'
# show the results
SVG(get_svgs(p)[0])

Screenshots or screencasts of the bug in action

image

@mattpap
Copy link
Contributor

mattpap commented Nov 19, 2018

Seems to be a problem with all circle-type markers and scatter():

image

Code to reproduce:

from bokeh.plotting import figure
from bokeh.io import save
from bokeh.layouts import row, column
from bokeh.core.enums import MarkerType as markers

def mkplot(marker, backend):
    p = figure(plot_width=300, plot_height=300, title="%s - %s" % (marker, backend))
    p.output_backend = backend
    p.toolbar_location = None
    p.scatter([-1, -2, -3, -4, -5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5, marker=marker)
    getattr(p, marker)([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="red", alpha=0.5)
    return p

def mkplots(marker):
    return row(mkplot(marker, "canvas"), mkplot(marker, "svg"))

p = column([ mkplots(marker) for marker in markers ])
save(p)

@mattpap
Copy link
Contributor

mattpap commented Nov 19, 2018

There are errors in JS console:

canvas2svg.js:536 Attempted to apply path command to node g
(...)

(hidden when using get_svgs() or export_svgs()). This may indicate a bug in the underlying library canvas2svg. The unfortunate part is that this library isn't maintained anymore, so we may need to fork it and fix things on our own.

@kawairine
Copy link

Hi,

I also ran into this problem, and I was wondering if there is a quick solution to this?

Thank you.

@bryevdv
Copy link
Member

bryevdv commented Sep 17, 2019

@kawairine I am afraid there is not. As mentioned above, Bokeh SVG output capability depends on a third party library and that library is no longer maintained at all. We will have to either re-do all of the SVG functionality, or find and integrate another new library that is maintained, or take ownership of the existing dependency. All of those are fairly heavy-lift tasks. I can't speculate when they might be gotten to with the current core team. We could really use help from new contributors to improve this situation faster.

@mattpap mattpap mentioned this issue Aug 16, 2020
8 tasks
@mattpap mattpap modified the milestones: short-term, 2.3, 2.2 Aug 16, 2020
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.

4 participants