Image zoom (and interaction with PreFigure)

30 views
Skip to first unread message

Andrew Scholer

unread,
Aug 17, 2026, 8:02:15 PM (9 days ago) Aug 17
to prete...@googlegroups.com
I am working on the accessibility of the image zoom feature (https://github.com/PreTeXtBook/pretext/issues/1504).

As part of that, I am looking at the following:
1) Expanding what is zoomed to include any associated figure if relevant. That way you can read any caption info while the image is open.

2) Allow SVGs or images that have large pixel dimensions to expand wider than they currently do.

3) Look at allowing expanding annotating prefigure diagrams (if that doesn't cause weird issues) and mermaid diagrams.

4) Possibly moving the activation to a separate button (like interactives use) so that we don't potentially try to do multiple things with an image activation (zoom and do PreFigure descriptions or something else similar)

5) Not offer to expand images that are already at (or above) their pixel dimensions. 


Anyone (especially David A) have thoughts on any of those, or other ideas/wishes? 

Andrew

Rob Beezer

unread,
Aug 17, 2026, 8:09:26 PM (9 days ago) Aug 17
to prete...@googlegroups.com
On 8/17/26 17:01, Andrew Scholer wrote:
> 5) Not offer to expand images that are already at (or above) their pixel
> dimensions.

Because they will be ugly (pixelated)?

Andrew Scholer

unread,
Aug 18, 2026, 10:40:50 AM (8 days ago) Aug 18
to prete...@googlegroups.com
Yes, it feels kind of like a lie to the reader.

"Want to see a more detailed version? Click here. ... Ha, made you look. Here is the same image but more pixelated."

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDA0TDhsb0VoOGw.1787011763%40pnsh.

Jeremy Sylvestre

unread,
Aug 18, 2026, 11:20:54 AM (8 days ago) Aug 18
to PreTeXt development
Not sure if this is the sort of thing you are looking for, but this could be an issue for users with tremors. 

It currently is possible to repeatedly trigger the zoom function on the same image. (Not sure if I can create a MWE but I have observed it when a quirk of the page layout causes the position of the zoomed image to not completely cover the original so that it's possible to click the original again. Could also become possible with keyboard navigation? Though currently images do not appear to be part of the tab list.)

If the zoom function is activated more than once on the same image, multiple zoomed images are stacked on top of one other. Then closing the zoomed images becomes "buggy" because clicking the zoomed image only closes the topmost image in the stack, and to the user it appears that their click did nothing at all (the next image in the stack is now visible in place of the first).

A possible solution (among others, obviously) would be to have the zoom function first automatically close any other currently open zoomed images. This would also address the case of multiple zoomed images of *different* original images overlapping/obscuring one another. (Though maybe there is a desire to preserve the user's ability to zoom multiple different images at the same time.)

Regards, 
Jeremy S

Andrew Scholer

unread,
Aug 18, 2026, 12:15:56 PM (8 days ago) Aug 18
to prete...@googlegroups.com
Thanks Jeremy, that is a great thing to add to the list. I'll make sure that isn't a possibility in the new code.

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.

David Austin

unread,
Aug 18, 2026, 12:22:01 PM (8 days ago) Aug 18
to prete...@googlegroups.com
Here's an example of what I was describing in dropin today, Andrew.  Click on the diagram to engage the annotation reader and the diagram extends very far down the page.


Andrew Scholer

unread,
Aug 18, 2026, 1:42:04 PM (8 days ago) Aug 18
to prete...@googlegroups.com
David - 

Yes, that issue is unconnected with the other zoom code.

It appears that the inspection zoom tries to maintain the same width on the figure and scale the focused item to fit. The height is auto determined to maintain the aspect ratio, resulting in the long image for something like that vertical line.

Do you have a non-RS HTML page where the same diagram works as intended? If so we might be able to figure out a CSS width or aspect-ratio that is being set there that is missing from the PTX presentation.

Alternatively, the zoom logic feels like it should respect the initial bounds of the image and scale so that the longest dimension of the focused element fills the available space. That way a tall item would not try to scale to fit the horizontal space.

Andrew

David Austin

unread,
Aug 18, 2026, 2:02:50 PM (8 days ago) Aug 18
to prete...@googlegroups.com
Thanks for having a look, Andrew.  Here's the same diagram in a non-PTX environment and just loading diagcess over the internet.  I agree with your proposed logic.

Andrew Scholer

unread,
Aug 18, 2026, 3:19:49 PM (8 days ago) Aug 18
to prete...@googlegroups.com
David -

It looks like the cleanest fix is to have the svg have an inline style with an `aspect-ratio` set based on the dimensions of the initial viewbox. It looks like PreFigure code generates that svg, so should be an easy fix for you to test.
 

David Austin

unread,
Aug 18, 2026, 4:30:41 PM (8 days ago) Aug 18
to prete...@googlegroups.com

Rob Beezer

unread,
Aug 23, 2026, 12:55:29 PM (3 days ago) Aug 23
to prete...@googlegroups.com
I took this for a drive (can't find the link to the full sample article build
again, but I have notes).

Looking good. Two nits.

1. Asymptote images in HTML are something like WebGL in a #canvas. Can they
enlarge as well? Seems they are unaffected. Sections 10.4 and 10.5, maybe
Figure 27.9 also.

2. See discussion below. The sample article example now has a screenshot as a
low-resolution image. Now I feel lied to. ;-) I hover on an image and don't
get an expand-button. No feedback. Why can't I expand this??? I'll just click
and hover and click some more. ;-)

And even for that crappy screenshot, I see value in expanding it for those with
low vision. I am also opposed to behavior varing by absolute pixel count. So
if somebody (author or publisher) does not like the look, then they should take
the necessary steps to improve the image, or just live with it.

Rob

On 8/18/26 07:40, Andrew Scholer wrote:
> Yes, it feels kind of like a lie to the reader.
>
> "Want to see a more detailed version? Click here. ... Ha, made you look. Here is
> the same image but more pixelated."
>
> On Mon, Aug 17, 2026 at 5:09 PM 'Rob Beezer' via PreTeXt development <pretext-
> d...@googlegroups.com <mailto:prete...@googlegroups.com>> wrote:
>
> On 8/17/26 17:01, Andrew Scholer wrote:
> > 5) Not offer to expand images that are already at (or above) their pixel
> > dimensions.
>
> Because they will be ugly (pixelated)?
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-dev...@googlegroups.com <mailto:pretext-
> dev%2Bunsu...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> MTAwMDA0TDhsb0VoOGw.1787011763%40pnsh <https://groups.google.com/d/msgid/
> pretext-dev/MTAwMDA0TDhsb0VoOGw.1787011763%40pnsh>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CACm44N8h1zM9bGprV2b2aw-Ux7xFssqbMK4Hx8Tit0JOAGXN6Q%40mail.gmail.com <https://
> groups.google.com/d/msgid/pretext-dev/CACm44N8h1zM9bGprV2b2aw-
> Ux7xFssqbMK4Hx8Tit0JOAGXN6Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Andrew Scholer

unread,
Aug 24, 2026, 8:05:00 PM (2 days ago) Aug 24
to prete...@googlegroups.com
1. Asymtote behavior is currently something between an interactive and an image. They have a standalone page like an interactive. Should we ditch that in favor of merging them more solidly into the image camp (with zoom behavior)? Or should we move them more towards interactives and use the pop out button? It feels like it should be one or the other. I'm agnostic.


2. OK, we will go with the author shaming low res zoom feature. ;)


To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDA0T0tUdTUwYng.1787504127%40pnsh.

Rob Beezer

unread,
Aug 25, 2026, 12:53:59 AM (yesterday) Aug 25
to prete...@googlegroups.com
1. The standalone page is definitely necessary for the links that make a "full
sized" version. Sean asked for this in 2021:

> Sometimes an Asymptote image gets clipped a bit by its bounding box when rotating it, and it would be nice to see the full size image in a new window…
primarily useful for 3D, where rotating a figure sometimes results in it getting
clipped.
I can use a mouse scroll-wheel to zoom in/out, and so avoid the clipping. So I
wonder how necessary this really is. Also, this is requested by a publisher switch.

I would prefer to see the 3D WebGL images inlined (2D is SVG, so can be in files
we point to). If they were inlined, I'd guess we could keep the standalone
page, and publisher choice.

2. Thank-you! A little author-shaming won't hurt too much - why should
developers get all the shaming for being over-helpful?

Rob


On 8/24/26 17:04, Andrew Scholer wrote:
> 1. Asymtote behavior is currently something between an interactive and an image.
> They have a standalone page like an interactive. Should we ditch that in favor
> of merging them more solidly into the image camp (with zoom behavior)? Or should
> we move them more towards interactives and use the pop out button? It feels like
> it should be one or the other. I'm agnostic.
>
>
> 2. OK, we will go with the author shaming low res zoom feature. ;)
>
>
> On Sun, Aug 23, 2026 at 9:55 AM 'Rob Beezer' via PreTeXt development <pretext-
> d...@googlegroups.com <mailto:prete...@googlegroups.com>> wrote:
>
> I took this for a drive (can't find the link to the full sample article build
> again, but I have notes).
>
> Looking good.  Two nits.
>
> 1.  Asymptote images in HTML are something like WebGL in a #canvas.  Can they
> enlarge as well?  Seems they are unaffected.  Sections 10.4 and 10.5, maybe
> Figure 27.9 also.
>
> 2.  See discussion below.  The sample article example now has a screenshot as a
> low-resolution image.  Now I feel lied to.  ;-)  I hover on an image and don't
> get an expand-button.  No feedback.  Why can't I expand this???  I'll just
> click
> and hover and click some more.  ;-)
>
> And even for that crappy screenshot, I see value in expanding it for those with
> low vision.  I am also opposed to behavior varing by absolute pixel count.  So
> if somebody (author or publisher) does not like the look, then they should take
> the necessary steps to improve the image, or just live with it.
>
> Rob
>
> On 8/18/26 07:40, Andrew Scholer wrote:
> > Yes, it feels kind of like a lie to the reader.
> >
> > "Want to see a more detailed version? Click here. ... Ha, made you look.
> Here is
> > the same image but more pixelated."
> >
> > On Mon, Aug 17, 2026 at 5:09 PM 'Rob Beezer' via PreTeXt development
> <pretext-
> > d...@googlegroups.com <mailto:d...@googlegroups.com> <mailto:pretext-
> d...@googlegroups.com <mailto:prete...@googlegroups.com>>> wrote:
> >
> >     On 8/17/26 17:01, Andrew Scholer wrote:
> >      > 5) Not offer to expand images that are already at (or above) their
> pixel
> >      > dimensions.
> >
> >     Because they will be ugly (pixelated)?
> >
> >     --
> >     You received this message because you are subscribed to the Google Groups
> >     "PreTeXt development" group.
> >     To unsubscribe from this group and stop receiving emails from it, send an
> >     email to pretext-dev...@googlegroups.com <mailto:pretext-
> dev%2Bunsu...@googlegroups.com> <mailto:pretext- <mailto:pretext->
> > dev%2Bunsu...@googlegroups.com
> <mailto:dev%252Buns...@googlegroups.com>>.
> >     To view this discussion visit https://groups.google.com/d/msgid/
> pretext-dev/ <https://groups.google.com/d/msgid/pretext-dev/>
> >     MTAwMDA0TDhsb0VoOGw.1787011763%40pnsh <https://groups.google.com/d/
> msgid/ <https://groups.google.com/d/msgid/>
> >     pretext-dev/MTAwMDA0TDhsb0VoOGw.1787011763%40pnsh>.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "PreTeXt development" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> email
> > to pretext-dev...@googlegroups.com <mailto:pretext-
> dev%2Bunsu...@googlegroups.com> <mailto:pretext- <mailto:pretext->
> > dev+uns...@googlegroups.com
> <mailto:dev%2Bunsu...@googlegroups.com>>.
> > To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/ <https://groups.google.com/d/msgid/pretext-dev/>
> > CACm44N8h1zM9bGprV2b2aw-Ux7xFssqbMK4Hx8Tit0JOAGXN6Q%40mail.gmail.com
> <http://40mail.gmail.com> <https://
> > groups.google.com/d/msgid/pretext-dev/CACm44N8h1zM9bGprV2b2aw- <http://
> groups.google.com/d/msgid/pretext-dev/CACm44N8h1zM9bGprV2b2aw->
> > Ux7xFssqbMK4Hx8Tit0JOAGXN6Q%40mail.gmail.com?
> utm_medium=email&utm_source=footer <http://40mail.gmail.com?
> utm_medium=email&utm_source=footer>>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-dev...@googlegroups.com <mailto:pretext-
> MTAwMDA0T0tUdTUwYng.1787504127%40pnsh <https://groups.google.com/d/msgid/
> pretext-dev/MTAwMDA0T0tUdTUwYng.1787504127%40pnsh>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CACm44N_DCseio28eM1HTo%3Dr%3DkQ%3DfWcHMzH3L_9WdwXW2B_kHOg%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/
> CACm44N_DCseio28eM1HTo%3Dr%3DkQ%3DfWcHMzH3L_9WdwXW2B_kHOg%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages