Geogebra slate dimensions and xml:id

6 views
Skip to first unread message

D. Brian Walton

unread,
Jul 18, 2024, 1:08:12 PM (6 days ago) Jul 18
to pretext-dev
A thread on pretext-support from Anna Davis pointed out that Geogebra interactives that use material ids have dimension matching challenges.

The iframe dimensions and aspect ratio to match the page width of PreTeXt is different from the internally required dimensions of the slate's generated Geogebra applet parameters specifying width/height of the slate in Geogebra's coordinate system.

My proposal is that we add attributes to the #slate object, say @slate-width and @slate-height. I think if they are given, we can directly use them to set the aspect ratio.

Separately, the #slate is required to have @xml:id because we need to match the id of the slate with the call made by the applet loader. I have for a while now wondered if we might be able to have a new attribute like @id-extension (probably a bad name) that is added as a suffix to the parent's visible-id (?). This way, author's could just copy/paste demos directly without having to worry about changing the slate's id each time in order to avoid duplicate xml:id values.

I can prepare a solution and submit a PR for the first part.

Brian

dbrian...@gmail.com

unread,
Jul 18, 2024, 1:40:13 PM (6 days ago) Jul 18
to PreTeXt development
I've got the first part ready, but notice that I'm getting scrollbars (horizontal and vertical) even thought iframe dimensions are matching the embedded dimensions. Does anyone know what might be happening here? (I'm seeing evidence of some of the other interactives in the sample article showing a similar behavior where it acts like the iframe is 1 pixel bigger than it should be.

Brian

Rob Beezer

unread,
Jul 18, 2024, 1:50:07 PM (6 days ago) Jul 18
to prete...@googlegroups.com
These scrollbars have been a long running headache, and I thnk we might have had
them under control once. I hope it is not "extra" whitespace in the HTML, since
that is very hard to control.
> --
> 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...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/a6d5b34a-72af-470d-8490-d293d63d84c9n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-dev/a6d5b34a-72af-470d-8490-d293d63d84c9n%40googlegroups.com?utm_medium=email&utm_source=footer>.

dbrian...@gmail.com

unread,
Jul 18, 2024, 2:01:57 PM (6 days ago) Jul 18
to PreTeXt development
I'm noticing that #interactive[@geogebra] supports @material-width but does not have a corresponding @material-height. I'm going to introduce both names. For other geogebra applets (eg. user-authored), I don't know if the names @material-width/@material-height are the most natural choices, but hopefully its close enough that it's not a problem.

It occurs to me that maybe this should be an implementation for #interactive[@geogebra] with @material-width and @material-height to automatically implement the slate approach without requiring it be coded by the user?

#interactive[@geogebra="material-id"] creates an iframe using a URL that specifies things (does not support split view)
#interactive[@platform="geogebra]/slate[@material="material-id"]  creates an iframe embedding a geogebra applet that loads material (does support split view)

Or maybe the URL should always be replaced by using an applet?

I'll make a PR based on what I have and we can adjust if desired.

Brian

Rob Beezer

unread,
Jul 18, 2024, 2:05:21 PM (6 days ago) Jul 18
to prete...@googlegroups.com
Some quick replies.

Width is precious, height is not. Almost never do we specify height. A bit of
a fiction. Specify width and aspect ratio, compute height.

Why can't slate have existing @aspect-ratio and a @width? (Why say "slate-" on
a #slate?)

We have tried to keep embedded objects out of the right margin. Runestone has
broken the dam on that.

Rob
> --
> 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...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/CAH7VRoL5m9pmiYfVBnNEOVxmDKKZD8hz5SMnbD5L-PrNzAfxQA%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-dev/CAH7VRoL5m9pmiYfVBnNEOVxmDKKZD8hz5SMnbD5L-PrNzAfxQA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

D. Brian Walton

unread,
Jul 18, 2024, 2:14:22 PM (5 days ago) Jul 18
to prete...@googlegroups.com
It is easier for an author to find the height and width directly. The example where this originated had width=1368 and height=736. This reduces at best to an aspect ratio "171:92", so they would probably need to specify material-width="1368" aspect="1368:736". Why do this instead of material-width="1368" material-height="736".

Brian

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyOS5iZWV6ZXI.1721325919%40quikprotect.

dbrian...@gmail.com

unread,
Jul 18, 2024, 2:17:39 PM (5 days ago) Jul 18
to PreTeXt development
I missed the second half of the question (apologies for multiple messages).

The applet dimensions are different from the frame dimensions being used in the iframe. The iframe itself will continue to use the @width and @aspect from the interactive. There are separate parameters being sent as part of the applet creation, and these are the ones that need to match the source material.

dbrian...@gmail.com

unread,
Jul 18, 2024, 2:38:29 PM (5 days ago) Jul 18
to PreTeXt development
Submitted as PR #2214.

Rob Beezer

unread,
Jul 18, 2024, 8:20:55 PM (5 days ago) Jul 18
to prete...@googlegroups.com
Its a quirk, but I don't like ever specifying height. Yes, hiding it with an
aspect ratio is the same, but I like it that way.
> <mailto:pretext-dev%2Bunsu...@googlegroups.com>
> > <mailto:pretext-dev...@googlegroups.com
> <mailto:pretext-dev%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/pretext-dev/CAH7VRoL5m9pmiYfVBnNEOVxmDKKZD8hz5SMnbD5L-PrNzAfxQA%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-dev/CAH7VRoL5m9pmiYfVBnNEOVxmDKKZD8hz5SMnbD5L-PrNzAfxQA%40mail.gmail.com> <https://groups.google.com/d/msgid/pretext-dev/CAH7VRoL5m9pmiYfVBnNEOVxmDKKZD8hz5SMnbD5L-PrNzAfxQA%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pretext-dev/CAH7VRoL5m9pmiYfVBnNEOVxmDKKZD8hz5SMnbD5L-PrNzAfxQA%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-dev%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyOS5iZWV6ZXI.1721325919%40quikprotect <https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyOS5iZWV6ZXI.1721325919%40quikprotect>.
>
> --
> 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...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/CAH7VRoLwqVJxPiJkSiuBXounqC%2BZ_Nm9aWzcTCcan4qcc-oO3w%40mail.gmail.com <https://groups.google.com/d/msgid/pretext-dev/CAH7VRoLwqVJxPiJkSiuBXounqC%2BZ_Nm9aWzcTCcan4qcc-oO3w%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Jul 18, 2024, 8:21:48 PM (5 days ago) Jul 18
to prete...@googlegroups.com
On 7/18/24 11:17, dbrian...@gmail.com wrote:
> The applet dimensions are different from the frame dimensions being used in the
> iframe. The iframe itself will continue to use the @width and @aspect from the
> interactive. There are separate parameters being sent as part of the applet
> creation, and these are the ones that need to match the source material.

Thaks, I didn't understand that part.
Reply all
Reply to author
Forward
0 new messages