equinor/webviz-config

Banner Image does not render

Opened this issue ยท 2 comments

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

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? ๐Ÿ™‚

It worked, thanks for the help!