google-deepmind / google-deepmind/treescope

Consider limiting the max html width of a slider when slicing tensors

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
474
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Thanks again for this library, it is a joy to use (especially with penzai's named arrays).

I have a small quality of life fix I corrected locally, and would suggest to backport upstream:
When slicing a tensor, the html length of the slider is currently calculated (in `arrayviz.js`) as:
```js
slider.style.width = `calc(max(40ch, ${size}px))`;
```
but this means that if that dimension along which you're slicing is high (in my example it represents time for about ~25000 steps), you have to scroll laterally to interact with the bar. I suggest a maximum size for the bar, like:
```js
slider.style.width = `calc(min(500px, max(40ch, ${size}px)))`;
```
Thanks again!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.