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

Banner Image does not render #620

Open
Vikaparra opened this issue Aug 30, 2022 · 2 comments
Open

Banner Image does not render #620

Vikaparra opened this issue Aug 30, 2022 · 2 comments
Labels
bug 🐛 Something isn't working

Comments

@Vikaparra
Copy link

Vikaparra commented Aug 30, 2022

Description

I'm running webviz from Windows 10, and every time I try to use the Banner feature, the image doesn't render, instead, only the title appears on the screen.
When I inspect the element using developer tools in the browser, this is what it shows:

When I'm using the non-portable version:
nonportableerror

When I'm using the portable version:
portableerror

I've tried running in edge and firefox, and it doesn't work in either.
Looking at the '"background-image" of the banner tag, it seems like the '/' is being removed and the image path is not found.

How to reproduce
My .yaml file looks like this:

options:
  menu:
    show_logo: true
    bar_position: left
    drawer_position: left
    initially_pinned: true
    initially_collapsed: true

# ------------------------------
layout:
  - section: Webviz Boilerplate
    content:
      # ------------------------------

      - page: Front page
        icon: home
        content:
          - This is a `webviz` instance created from a configuration file.
          - Open menu on the left to select page for demo plugins.
          - BannerImage:
              image: ./image.png
              title: My banner image

I've tried putting the .png file in "./examples", "./plugins", in the plugin folder, and when I use the portable version, the file is in the "./assets" folder as it should.

When I try to use other features, like the tablePlotter, it works normally

@anders-kiaer anders-kiaer added the bug 🐛 Something isn't working label Sep 7, 2022
@anders-kiaer
Copy link
Collaborator

Thanks @Vikaparra for the detailed report 👍👏

I would expect this to somehow be related to this line

return str(pathlib.Path(self._base_folder()) / assigned_id)

Maybe, in order to be compatible with Windows, it needs to use as_posix, i.e. instead be:

return (pathlib.Path(self._base_folder()) / assigned_id).as_posix()

I don't easily have available Python environment + Windows 10, could you try changing the referenced line and see if that fixes the problem you see on Windows? 🙂

@Vikaparra
Copy link
Author

It worked, thanks for the help!

@anders-kiaer anders-kiaer moved this to Small improvement 🔧 / bug fix 🐛 in Webviz Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
Status: Small improvement 🔧 / bug fix 🐛
Development

No branches or pull requests

2 participants