Skip to content

Expose createArrayFromView and getAxisOffsets#2024

Merged
axelboc merged 1 commit into
silx-kit:mainfrom
DiamondLightSource:expose-more-functions
Jul 10, 2026
Merged

Expose createArrayFromView and getAxisOffsets#2024
axelboc merged 1 commit into
silx-kit:mainfrom
DiamondLightSource:expose-more-functions

Conversation

@PeterC-DLS

Copy link
Copy Markdown
Contributor
  1. @h5web/lib does not handle views of ndarray so can end up using the wrong portion of the underlying 1D typed array and passing it to WebGL. Exposing createArrayFromView allows devs to handle this case.
  2. The space left when displaying images, etc is a problem when a dev wants to pack in several plots close together in an UI. Exposing getAxisOffsets allows them to control the aspect ratio and match the length of the scale axes to the image.

@axelboc
axelboc merged commit 54ea89a into silx-kit:main Jul 10, 2026
4 checks passed
@axelboc

axelboc commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

I've pushed a commit to document createArrayFromView and move getAxisOffsets to the experimental section: b35a934

Could you please expand on the second problem you're facing (packing several plots close together)? Maybe we can find a solution to save you from implementing what seems like a complicated workaround.

@PeterC-DLS
PeterC-DLS deleted the expose-more-functions branch July 10, 2026 11:30
@PeterC-DLS

Copy link
Copy Markdown
Contributor Author

Thanks for the quick merge!

Please see DiamondLightSource/davidia#226 for the change we added so page resizes do not add padding to a RgbVis - this is demonstrated here.

@axelboc

axelboc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

I see, thanks a lot. This was the initial equal-sizing behaviour right at the start but we ended up removing it to avoid the container measuring step and because we wanted to maximise the space available to the visualization when zooming in.

I considered bringing this sizing behaviour back, but looking at DiamondLightSource/davidia#226, your toolbar complicates things a bit. Let's keep the getAxisOffsets export then. I'll document it. EDIT: done in 079c700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants