glue-viz / bqplot-image-gl

Jupyter widget for displaying images with a focus on astronomy
MIT License
19 stars 13 forks source link

bqplot figure does display in Accordion #79

Open swelborn opened 2 years ago

swelborn commented 2 years ago

Describe the bug ImageGL mark for a bqplot.Figure does not appear in ipywidgets.Accordion container. You can see it outside of the container, but not inside. I am using the beta version of ipywidgets v8.

To Reproduce Using the basic example script:

from ipywidgets import *
import numpy as np
from bqplot import Figure, LinearScale, Axis, ColorScale
from bqplot_image_gl import ImageGL
scale_x = LinearScale(min=0, max=1)
scale_y = LinearScale(min=0, max=1)
scales = {'x': scale_x,
          'y': scale_y}
axis_x = Axis(scale=scale_x, label='x')
axis_y = Axis(scale=scale_y, label='y', orientation='vertical')

figure = Figure(scales=scales, axes=[axis_x, axis_y])

scales_image = {'x': scale_x,
                'y': scale_y,
                'image': ColorScale(min=0, max=1)}

image = ImageGL(image=np.random.random((10, 10)), scales=scales_image)

figure.marks = (image,)
figure
Accordion(children=[figure])

Here is my environment: environment.txt

swelborn commented 2 years ago

After searching for about 2 hours on this issue, I found that if I did a ctrl + scroll (resizing browser magnification) after making the accordion, that the figure would show up. I'm using brave. This doesn't seem to happen in MS edge.

Update: it does, in fact, happen in MS edge.

Is there a property that I can set so that I don't need to do this?