[Rd] Graphics-Device-Size vs. Window-Size: R design flaw
Wed, 15 Nov 2000 11:31:47 +0100
Dear R developers,
> Yes a window (x11 or win32) is a device.
> R treats a change in window size as a change in the (absolute) physical
size of the device.
Well, as to be expected by Murphy's law, this is the worst possible case.
> With respect to the par("din") inconsistency, that _is_ undesirable
> behaviour. The correct behaviour is the second one. Could you please
> submit a bug report for this (including your example).
Paul, I'd not like to submit a bug report to resolve the par("din")
inconsistency by making it consistently 'the second one'. Rather I try to
convince you (and r-devel) making it consistently 'the first one'. I
consider the following features to be indispensable:
1) presentation-layer vs. representation-layer
Keep physical size of the device striktly seperated from window size,
i.e. do not change par("din") with window resizing.
2) Text size
Keep text size stable with respect to device size,
i.e. resize text size with window size
3) strwidth() and strheight()
those should consistently refer to the representation layer, or to be more
general: the R-user/R-programmer should always work within the context of
the representation layer, and he should be isolated against the presentation
layer (where obvioulsy some C-Coding is acting, to put things on screen).
Here is the resoning for this:
Let's start with a rather abstract reason: proper separation of 'layers' is
one of the cornerstones of professional software design. A good example is
the current/old thrive for seperation of content and layout (XML/LaTeX).
Currently R blends representation and presentation, which is no good.
For a more practical reason. Seperating the layers gives more options, more
degrees of freedom to use the software. Currently there is no way to layout
a big device like DIN A3, because the windows always is smaller and it gets
impossible to create a DIN A3 device which can be changed INTERACTIVELY
(i.e. x11()). Seperating layers allows everything which currently works plus
more. For example Font sizes. You argue, that resizing fonts with window
size could result in smalls too small to read. Well, it could. But you would
be free to create a device of exactly the window size, and you would be free
to specify any font size when creating the device. To put ot more
provocative: Currently R has an MS like approach of software trying to be
more intelligent than it's user, something I always hated about products
like MS Word. Currently there are situations without any resonable
workaround in R. Seperating layers gives you every option and full control.
As you suggest, adding something like scrolling or zooming to windows would
be a nice extension. However, proper seperation of layers should have
priority: it's a must.
For a reason of authority and compatibility: the prototype DOES layer
seperation, DOES rescaling of fonts with window size. Let's dare to be as
good as the prototype, or better ...
I hope all this is convincing. As the graphics flexibility of R is one of
the reasons to use it, having reduced degrees of freedom is disappointing.
To put it provocative:
tool or toy, that's the question here
Please give feedback
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: firstname.lastname@example.org