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

Y-axis labels of HoloViews plot in Fast Template does not position them selfes well #2426

Closed
MarcSkovMadsen opened this issue Jun 24, 2021 · 7 comments
Labels
bokeh Request is for change in bokeh has workaround type: bug Something isn't correct or isn't working

Comments

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Jun 24, 2021

I'm on the current master branch of Panel (pre 0.12 release)

image

import panel as pn
import pandas as pd
import holoviews as hv

pn.extension(sizing_mode="stretch_width")
hv.extension("bokeh")

ACCENT_COLOR = "#FDAC53"
data = pd.DataFrame(
    {
        "x": [1,2,3,4],
        "y": ["A"*10, "B"*4, "C"*6, "D"*3]
    }
)
plot = hv.Points(data).opts(color=ACCENT_COLOR, marker="o", size=25)
plot_panel = pn.pane.HoloViews(plot)

template=pn.template.FastListTemplate(
    title="Fast HoloViews",
    main=[plot_panel],
    header_background=ACCENT_COLOR,
    header_accent_base_color="white",
    accent_base_color=ACCENT_COLOR,
)
template.servable()

Additional Context

Changing the template to pn.template.VanillaTemplate fixes the problem

image

@MarcSkovMadsen MarcSkovMadsen added the TRIAGE Default label for untriaged issues label Jun 24, 2021
@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Jun 24, 2021

Cause/ Workaround

By removing a line from the the Panel file theme.py I can work around the problem.

image

image

A few questions for you @philippjfr

  • Is this a bug in Bokeh? Can Bokeh not place the axis labels correctly if the font-size is changed? Should this be filed as a bug with Bokeh?
  • Is there a better workaround that can make this work without going back to very small font sizes?

@MarcSkovMadsen MarcSkovMadsen added need input from Philipp type: bug Something isn't correct or isn't working and removed need input from Philipp TRIAGE Default label for untriaged issues labels Jun 24, 2021
@MarcSkovMadsen MarcSkovMadsen changed the title Y-axis labels of HoloViews plot in Fast Template does not position it self well Y-axis labels of HoloViews plot in Fast Template does not position them selfes well Jun 24, 2021
@philippjfr
Copy link
Member

Is this a bug in Bokeh? Can Bokeh not place the axis labels correctly if the font-size is changed? Should this be filed as a bug with Bokeh?

@mattpap Does bokeh not like relative sizes like em?

@mattpap
Copy link
Collaborator

mattpap commented Jun 24, 2021

Possibly this is related to bokeh/bokeh#11110, though there were other regressions to text rendering in 2.3.x. What version of bokehjs is being used and what's the content of JS console?

@mattpap mattpap added the bokeh Request is for change in bokeh label Jun 24, 2021
@MarcSkovMadsen
Copy link
Collaborator Author

Thanks @mattpap.

bokeh py

image

console

image

bokeh js

image

@mattpap
Copy link
Collaborator

mattpap commented Jun 24, 2021

This is definitively bokeh/bokeh#11110 and it will be fixed 2.3.3.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Jun 27, 2021

Thanks @mattpap

FYI @philippjfr. I wanted to create a fix to temporarily workaround this problem. Unfortunately I pushed it directly to master. It's here 630a71c. I don't believe it will cause any problems. Please check it out and let me know. Thanks. I also added back tick marks and grid line. I've been thinking about doing it for a long time. I believe its needed.

image

image

import panel as pn
import pandas as pd
import holoviews as hv

pn.extension(sizing_mode="stretch_width")
hv.extension("bokeh")

ACCENT_COLOR = "#FDAC53"
data = pd.DataFrame(
    {
        "x": [1,2,3,4],
        "y": ["A"*10, "B"*4, "C"*6, "D"*3]
    }
)
plot = hv.Points(data).opts(color=ACCENT_COLOR, marker="o", size=25, show_grid=True)
plot_panel = pn.pane.HoloViews(plot)

template=pn.template.FastListTemplate(
    title="Fast HoloViews",
    main=[plot_panel],
    header_background=ACCENT_COLOR,
    header_accent_base_color="white",
    accent_base_color=ACCENT_COLOR,
)
template.servable()

@philippjfr
Copy link
Member

Resolve in bokeh, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bokeh Request is for change in bokeh has workaround type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

3 participants