[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Worksheet interface




On Tue, 25 Jan 2000, Nils Barth wrote:

> One interface that several general math applications use is a
> ``worksheet'' (Maple's name) or ``notebook'' (Mathematica) interface.
> Including the aforementioned program, I think MathCAD uses it too.

I just got my copy of mathematica about a week ago. I like the idea of a
notebook interface but I think that forcing anyone into a command-driven
context is funamentally wrong for an application such as this. This is
especially true when you consider the complexity and obscureness of
Mathematica's syntax and interface. For the plotting component of Dr.
Genius, I have been trying to steal the best ideas from mathematica while
salvaging most of the interface.

I'm sure it would be a nice alternative, but implementing this on
GTK/Gnome was damn _HARD_. Cloning mathematica's interface was my original
idea, but I asked several people who know what they were talking about
(including George) and they all said that it would be very hard to do. In
the end, i ended up designing a better interface anyway. I realize that a
fair amount of professionals will prefer to work at a command prompt.

> Worksheet is the better term, since it's basically one electronic sheet.
> 
> a screenshot of Mathematica's idea of a notebook is available at:
> http://www.fas.harvard.edu/~nbarth/mathematica_screen_shot.png
> the following discussion is easier to follow with the picture as a
> companion.
> Sorry I don't have screenshots of other applications -- I don't think
> Maple has an X interface (or at least our distribution doesn't) and I
> don't want to do screen-capture on windoze. Suffice to say that it
> looks like Mathematica only uglier.
> We don't have a license for MathCAD around here, and non-free software
> people are pretty stingy with screenshots (probably 'cause they're
> usually ugly). It looks vaguely similar to the above, as far as I can see.
> 
> Basically, a worksheet interface means:
> * a hierarchically structured document

Not very hard with GnomeCanvas and some work...

> * mixed data types in one document

GnomeCanvas excels at this, which is why I am using it for plotting.

> * execution blocks can be inserted/executed in any position

Kind of hard...

The hardest thing though is adding interactivity. You need to make a
command prompt thats part of a canvas. That was the thing I just couldn't
get, even when asking the advice of canvas pros.

> In more detail:
> Note the layers of right braces in the shot. The rightmost is for the
> worksheet (redundant? maybe a ``notebook'' can have several
> independent worksheets), the next one is for the title block, text
> block, or execution block. Within an execution block is the input,
> possible error, possible graphics, output.
> 
> There are several data types in the document, the most spectacular of
> which is the inline graphic. Also the inline equations/output (note
> the integral and Pi). Mathematical also has primitive stylesheet
> support, so you can change formating for assorted text (basically,
> change font (including color), background, justification, and
> boxing/frames -- would you like more screenshots/examples?)
> 
> ``Out of order'' execution ;-)
> Basically, you can insert a new block between any two blocks (text
> blocks, execution blocks, etc.) If you insert an execution block and
> execute it, then it runs with the existing context. So...
> if I execute x=3 at the bottom of the page, then delete it, go to the
> top of the page, and execute x+1, I'll get 4.
> This has the problem that (if abused), it can make the current
> state/context unclear, and the flow of execution/reasoning very
> tortuous; this doesn't happen too often in practice, and if we want,
> we could add an option to only allow insertion at the end of the
> document (maybe useful for students?).

This feature is really cool and I think it is one of the good interface
descisions that wolfram made. What I _don't_ like is the complexity of the
syntax and UI, for example using shift-enter to evaluate an expression,
and using a completely infix-incompatible parser.

I plan to strive to remain infix compatable so that the technology is
accessible to students and newbies. If new operators are necessary, why
not reserve "+-()!*/|" as operators for infix and make all the new
operators use other characters. I don't know how compatible Genius
currently is with infix.

> 
> What I'm suggesting is:
> * I think a worksheet-style interface would be a welcome addition to
>   Dr. Genius, and not too hard to implement.

As I said, it seems very difficult. Of course, that's for me, a
9th grader and a relative newbie to gnome development.

> * A worksheet-type thing would likely make for a good approach to a
>   general file-type/session log -- I think some XML type would be
>   ideal.

I'm planning to use XML for everything that gets saved. I think this is
pretty consistant with the current GNOME status quo and makes a lot of
sense.

>   (though I'm not sure about graphics -- UUencode or some such? Is
>   there a good XML solution to inline graphics, other than SVG?)

Well, you could have it recaucluate all plots when the notebook is loaded.
The perspective and zoom information could be saved easilly in XML. I know
mthematica allows you to import images, but I am not yet convinced that
this is usefull.

> * Style-sheets should be CSS (if GNOME supports this) or XSL when it
>   gets standardized/supported.
>   We could hack a simple CSS parser if we get desperate, but I doubt
>   that'll be necessary/useful. Stylesheet are not a high priority, but
>   they should be easy to integrate later.
> * The canvas could probably do any rendering easily; I'm not familiar
>   with implementation details, but this looks really easy with the
>   GNOME framework.

Rendering the plots is easy. I have been working on this extensively for
awhile now and am making a lot of progress. BTW, what would you think
about trying to rewrite the 3d plotter to use OpenGL? It's what the guppi
folks have suggested and sounds fun, although it is not a high priority
for me.

> * A worksheet should NOT be the only document type; you'll often want
>   a graphic or geometry object in a separate window. Basically we
>   could just add: New->Worksheet

An example of an alternative place to store things would be my Canvas. So
far this has been designed to avoid a command line and give you more
flexibility than Notebooks, moving and resizing the graphs as you want and
double-clicking (right-click contectual menu?) to set settings. The
metaphor behind it is incomplete and I feel like it needs some
development. For example, how would you evaluate an expression on the
canvas? Just type something and it would show up in a new equation editor
on the canvas, and when you hit enter, a text item (in a scrolled window
if necessary) pops up below it with the result? Sounds kind of cool. All
the widgets should have a close box on them.

> * Once we get an equation editor component, we can integrate that for
>   graphical equation entry.

You know, that may make the command prompt problem a lot easier. I had
been thinking of linear, field-based text entry until now. Unfortunately I
have not seen any equation editors in a usable state.

> * We do not need to be bound by specifics of this implementation; I
>   show it only as a starting point.
> 
> Last note: Mathematica also retains the console interface, as we do
> via the genius executable. This is definitely a Good Idea (TM).
> Worksheets are basically a really nice UI feature, but don't add any
> essential functionality.

Seperation of the Kernel and Frontend seems like a good idea but I am
unaware of the specifics of our or Wolfram's implementation.

By the way, how is Genius' mathematics support doing? Is it getting
anywhere near mathematica yet? That would really be awesome.

Aaron

> So. . .anyone interested in this?
> 
> -- 
>   -nils
>