Full screen mode for GeoGebra apps

776 views
Skip to first unread message

Bruce Bartlett

unread,
Apr 12, 2019, 7:34:13 PM4/12/19
to PreTeXt support
Hi,

GeoGebra apps, when embedded in an html page manually via an <iframe> element, have a "full screen" button in the lower right corner. 
See eg.


However when PreTeXt outputs html from the <interactive platform="geogebra"> mechanism, there is
no "full screen" functionality. 

Any chance of getting a full screen button for GeoGebra apps in PreTeXt? 
Does this break one of the design principles?

It's a very useful function because if you are interacting with the screen with a whole bunch of sliders and points, it 
helps to remove the clutter and to have the graphics and text elements nice and big. Especially on a phone, where you have
to move the sliders using your fingers. For instance, the above differential equations app doesn't seem very usable in a PreTeXt book, because
it will get compressed into a 600px wide window, with no option of a full screen. Maybe I am misunderstanding the situation, and there is a better way to do things.

Regards
Bruce



Alex Jordan

unread,
Apr 12, 2019, 8:38:19 PM4/12/19
to pretext...@googlegroups.com
There is a discussion/research/development about ending iframe use
with GeoGebra interactives. That is my bias, anyway. There are
considerations both ways. The discussion is dormant because after
some GeoGebra work earlier this year (the generic calculator and the
ability to code your own using API), I've had to focus on some local stuff.
And I'm not sure anyone else is active with PTX-GGB.

The iframe question is high level enough that I'd mostly like to settle that
before too much else is done with GeoGebra. If we don't use iframes,
many good things happen, but also we lose the safety from the isolation
of applets within each iframe. And we have to think about that with the
applet embedding code carefully, which gets into things like the fullscreen
button.

To your question, the show full screen button is controlled using an
app parameter
To date, we have not given PTX authors access to control the app
parameters. So far, we hard coded some choices, like not using the
full screen button. It's a tough one because there are good reasons
for and against.

Note we have given PTX authors access to API commands:
But the API command are different from the app parameters.

Most of the app parameters feel abstractly like publisher choices.
Some of them have corresponding API commands, but not, seemingly,
the full screen button.

If we eventually give PTX users access to app parameters, we
will need to decide which ones. showFullscreen would probably
be on the list if we got there. And we would have to decide what
is the mechanism. Is it really best to put it into source? Should
there be global switches instead? These kinds of questions.

Now back to the top, how do we feel about iframes?





--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To post to this group, send email to pretext...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/79346b8f-8268-4f0f-8dcc-b8258ad9562e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruce Bartlett

unread,
Apr 13, 2019, 1:02:38 AM4/13/19
to PreTeXt support
Hi Alex,

>There is a discussion/research/development about ending iframe use
with GeoGebra interactives.

Do you mind pointing me to this discussion, so that I can better understand
the issues? I don't really understand what's at stake, what are the alternatives.

One thing which confuses me is that, on the one hand, the GeoGebra documentation has the following method
of embedding apps, which doesn't seem to use an iframe:


But when you click on "Share", then it offers you a cut-and-paste text which 
uses an iframe:


What is the official method?

Kind regards
Bruce
To unsubscribe from this group and stop receiving emails from it, send an email to pretext...@googlegroups.com.

Bruce Bartlett

unread,
Apr 14, 2019, 2:03:52 PM4/14/19
to PreTeXt support
Hi all,

Just to motivate why I believe full screen mode will be a true game changer: take a look at these lovely use cases:

1. "Slope fields", by Malin Christersson:


2. Catenoid, by Tim Brzezinski


Both of these are beautiful, minimalist demonstrations with an artistic sense to them. (It's easy to create "bad" demonstrations. Lots of clutter, awkward to manipulate. What is hard is to create beautiful demonstrations.)

In both these cases, it is the "full screen mode" which really gives the "wow factor". And that's what we want to do with PreTeXt, right? A wow factor. This is really a chance for PreTeXt to shine!

It's not just that - it's the fact that going full screen removes the clutter. If you are on a phone or a tablet or using your mouse, and you are not in full screen mode, it is very awkward because scrolling or dragging with the mouse inevitably registers on the background "text" or "HTML" part of the page, and not in the GeoGebra demonstration, and so the page goes haywire. Also, the sliders are too small unless you go full screen etc. There are a 100 reasons.

Regards
Bruce

Bruce Bartlett

unread,
Apr 14, 2019, 2:11:28 PM4/14/19
to PreTeXt support
Hi Alex,

Having further motivated full screen mode above, I wanted to follow up further on the technicalities of iframe/non iframe discussion.

I'm a novice on this, but the way you speak it kind of gives the impression that
to get full screen mode, one will have to "not use an iframe". 

Also, you speak as if full screen mode is a switch solely controlled by an app parameter on Geogebra. 

But actually, full screen mode can be controlled simply by setting the allowfullscreen attribute of the HTML iframe call, and not via an app parameter. For instance, to place the Catenoid (by Tim Brzezinski) on a webpage with full screen option, one simply includes the line in the HTML: 

<iframe scrolling="no" title="Catenoid" allowfullscreen src="https://www.geogebra.org/..."> </iframe>

I don't mind it is decided that allowing full screen is a Publishers choice, via a stringparam or something. That is fine - but let's have that choice, I think it's a big deal. 

There are so many beautiful GeoGebra demonstrations out there. What has been missing is the technology for a beautiful mathematics book to contain them!! That is what PreTeXt does. Let's do it!

Regards
Bruce

Rob Beezer

unread,
Apr 14, 2019, 3:02:16 PM4/14/19
to pretext...@googlegroups.com
On 4/12/19 10:02 PM, Bruce Bartlett wrote:
> Do you mind pointing me to this discussion, so that I can better understand
> the issues? I don't really understand what's at stake, what are the alternatives.

All,

Here is why we have iframes:

1. Two interactives, authored with raw Javascript, or with a Javascript library
like JSXGraph, runs the very real risk of employing the same variable twice for
radically different purposes. Results are spectacular. An iframe provides a
sandbox so that these variables do not clobber each other.

2. Every applet/demonstration/material/YouTube has their own easy-to-use way of
embedding themselves onto a page. Just "copy this snippet into your HTML." All
slightly different. Some are already iframes. All can be wrapped by an iframe.
So as a way to harmonize the code, and write/maintain less code, an iframe
became a unifying device. It was/is a lot of work, so changing it will be even
more work.

So I am not wedded to iframes themselves. But a replacement needs to solve the
two problems above. And I'm not inclined towards "it is the author's
responsibility" on (1). We want novices to be able drop in other's work with a
minimum of technical skills.

Rob

Bruce Bartlett

unread,
Apr 14, 2019, 4:45:27 PM4/14/19
to PreTeXt support
Thanks for the explanation.

Just to be clear, from my side, I am happy with using iframes.

I simply want PreTeXt to insert the "allowfullscreen" attribute into the <iframe> element in the HTML code, i.e.

<iframe allowfullscreen src="...myfavouritegismo"/>

At least for Geogebra. But would surely be useful for all these applets/Youtube/gismos. And I don't see any downside.

Regards
Bruce

Alex Jordan

unread,
Apr 14, 2019, 5:56:55 PM4/14/19
to pretext...@googlegroups.com
I'm a novice on this, but the way you speak it kind of gives the impression that
to get full screen mode, one will have to "not use an iframe".

That's not what I mean. What I mean is, I wouldn't want to spend any time rewiring
any GeoGebra code if it would all be for nothing because a month or two later,
we might (or might not) scrap the top level approach to building them.
I think that iframes versus javascript div insertion should be figured out.
And after that, lower level details can be coded. Possibly allowing user options.

It may be a little difficult for me this week to participate in the forum.
If I'm quiet, it's definitely not because I'm disinterested in this. I'll try to catch up later.

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

To post to this group, send email to pretext...@googlegroups.com.

David Farmer

unread,
Apr 14, 2019, 6:25:01 PM4/14/19
to pretext...@googlegroups.com

Here is an actual example of what can go wrong if you don't use an iframe.

Alex and I (mostly Alex) got the GeoGebra calculator working. Yay!

But the GeoGebra calculator comes in several flavors. Alex tried
using another flavor, and there were problems. It turned out that
the new version had a div with class="toolbar". Well, so
does PreTeXt HTML, so the css we use to style our toolbar was also
styling (incorrectly) the .toolbar in the calculator.

Once identified, the problem was not too hard to fix, because I could
adjust the selectors to apply to our .toolbar and not theirs.

But if there had been two different outside applications on the page,
and they conflicted, then it could be difficult to find a non-iframe
solution.

It is possible that we could adopt a similar approach to how we
handle LaTeX packages: evaluate them carefully in numerous combinations
so that we know we are only using compatible ones. (This is a serious
problem which you will encounter quickly if you ever try to use
several packages.) Javascript plug-ins change faster than LaTeX
packages, so the situation is not exactly parallel.

The real purpose of this email is to bring attention to the hard
work involved in trying to ensure that everything in PreTeXt actually
works properly and does what it is supposed to do. What seems like
a simple change, might not be.

Regards,

David

ps. I favor the non-iframe solution if we can make it work,
because then we can style the included content. The iframe blocks both
directions: it does not have bad side-effects on the main content,
but you also cannot easily control how it looks.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/pretext-support/CA%2BR-jrcfDYKn4SXZ3YQNbSqDFuqhU6PLB1LJij0QAiB9qgE
> bcg%40mail.gmail.com.

Bruce Bartlett

unread,
Apr 14, 2019, 6:53:35 PM4/14/19
to PreTeXt support
While we are discussing fairly high level stuff, let me say that I really like the way
Malin Christersson displays her GeoGebra apps:


They are static with a relevant background image until the reader clicks "Load GeoGebra worksheet".
This is much more friendly to the reader, because if you have a lot of such embedded gismos on a page,
and they all want to load up the moment the page is opened, then the browser takes ages loading them all 
up and the text on the page jumps around while the browser tries to sort everything out. Moreover, the reader
is prone to inadvertently "zooming in" to some Geogebra embedded app by mistake while he/she is simply trying to scroll
down the page with a two finger scroll.

Technically, she does with a <div> enclosing an <iframe>. David - I don't understand your issue about not being
able to style an iframe because you can certainly style it with CSS.

So: methinks a good behaviour is "don't preload" the embedded GeoGebra apps but rather get the reader to click on them when
they want to engage with them. And then have a full screen button so when it's time for them to engage, they can immerse themselves properly.
Then they press (Esc), go out of full screen, and carry on reading the text.

Regards
Bruce








> To post to this group, send email to pretext...@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/pretext-support/1db126f6-6e02-4e8e-bbf7-cad01f7dd3a0%40googlegroup
> s.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to

David Farmer

unread,
Apr 14, 2019, 7:03:04 PM4/14/19
to PreTeXt support

I added the dynamic loading of GeoGebra and other resources
(including WeBWorK) as High Priority on the PreTeXt Roadmap.

> Technically, she does with a <div> enclosing an <iframe>. David - I don't understand your issue about
> not being
> able to style an iframe because you can certainly style it with CSS.

I meant that with CSS it is impossible to style what is *inside*
an iframe.

Alex Jordan

unread,
Apr 14, 2019, 7:33:47 PM4/14/19
to pretext...@googlegroups.com
The thread started with a GeoGebra specific question.
Rob is wisely trying to approach all "interactive" thingies with a similar
abstract framework in the XSL. One thing that may not be apparent
when there is a, say, GeoGebra-specific solution that seems like it
should be trivial to implement, is that actually we value the universal
approach to the other interactive things. It makes the XSLT easier
to maintain, enhance, and test.

There are some cited good reasons for using iframes.  I believe the
js contamination issue is not an issue in the specific case of GeoGebra,
but I still want to do more testing to prove that when I have time.

Missing yet in this thread is most of the reasons to not use iframes.
  • David pointed out how they make styling impossible.
  • For me, perhaps the biggest reason is that each iframe requires
    an entire copy of the js code base to be downloaded and loaded.
    Part of why this page
    https://pretextbook.org/examples/sample-article/html/section-interactive-authored.html#subsection-46
    takes so long to load is that it is loads deployggb.js once for
    each iframe.
  • All these things already have accessibility issues. The issues are
    compounded when the thing is inside an iframe. And for similar
    reasons to the styling, our hands are tied for addressing them.
I am interested in:
  1. Determining for sure that GGB through div injection is not going to
    cause the javascript clashes that Rob described.
  2. Changing things so that specifically GGB (among interactives) no longer
    uses iframes.
  3. But also keeping a uniform framework (no pun intended) for the XSLT
    surrounding interactives, for reasons mentioned in my opening paragraph.
    And by default continuing to use iframes for other interactives because
    item 1 is not going to work out for interactives in general.
For the record, I support the full screen button. I think it should be an intentional
choice by the author that "this particular interactive would benefit from having it".
(There are GGB examples where a full screen mode doesn't really make something
better, and the button or whatever is just in the way.) I am currently of the opinion
that it should eventually be an attribute of the interactive in source, set by the author,
and off by default. Note the word "currently", because sometimes these things
change the more thoroughly we think about them.

But how you enable fulls creen for GGB depends heavily on if you are using iframe
or not. Hence, why I want to spend more time figuring that out.


To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.

To post to this group, send email to pretext...@googlegroups.com.

Bruce Bartlett

unread,
Apr 15, 2019, 4:33:27 AM4/15/19
to PreTeXt support
Thank you for these explanations Alex. I understand the issue better now. 
There are good arguments for and against iframes. 

I don't mind either way, since it doesn't affect my issue (full screen mode), which for now I can just
manually tweak in the HTML to achieve.

> For me, perhaps the biggest reason is that each iframe requires
an entire copy of the js code base to be downloaded a

Agreed. But bear in mind that if we use dynamic loading, then this won't 
be a problem anymore; the page will load semi-immediately (MathJax
still being a performance issue).

Regards
Bruce


Reply all
Reply to author
Forward
0 new messages