niivue / ipyniivue

A WebGL-powered Jupyter Widget for Niivue based on anywidget
BSD 2-Clause "Simplified" License
25 stars 8 forks source link

div element does not get constrained to set dimensions #17

Closed AnthonyAndroulakis closed 1 year ago

AnthonyAndroulakis commented 1 year ago

Describe the bug Each NiivueView is a div element with a canvas as its child. The expected behavior is that the div element gets constrained to the same dimensions as the canvas (instead of taking the full width of the cell).

To Reproduce

  1. follow the installation instructions here: https://github.com/niivue/ipyniivue#installation
  2. run the example notebook

Expected behavior The widget dimensions should be constrained. If no width and height inputs are given, then the dimensions of the div element should be the default width and height (640 and 480).

Screenshots

screenshot2

As you can see in the screenshot, the canvas dimensions are constrained correctly, but the div dimensions are not.

AnthonyAndroulakis commented 1 year ago

fixed this visual issue by making the div transparent