wmi2

WebMathematics Interactive 2 bug tracking system.
Tasklist

FS#32 - Support for multivariable functions and 3D plots in gnuplot with zooming in and rotation

Attached to Project: wmi2
Opened by Kovacs Zoltan (kovzol) - Wednesday, 18 July 2007, 23:14 GMT+2
Last edited by Kovacs Zoltan (kovzol) - Sunday, 28 February 2010, 12:16 GMT+2
Task Type Feature Request
Category Backend / Core
Status Closed
Assigned To Fekete Arpad (arpad)
Kornel Csernai (csko)
Operating System All
Severity Medium
Priority Normal
Reported Version Development
Due in Version 2.2
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

1. The "," character should be allowed and WMI2 should allow function plotting inputs like "sin(x),cos(x)".

2. Probably he same gnuplot button type should allow the 3D function displaying.

3. Zooming in and rotation could be taken from WMI1.
This task depends upon

Closed by  Kovacs Zoltan (kovzol)
Sunday, 28 February 2010, 12:16 GMT+2
Reason for closing:  Implemented
Comment by Kovacs Zoltan (kovzol) - Wednesday, 15 August 2007, 21:02 GMT+2
The texts for plotting seems to be hardwired into WMI2. Is it really possible?
Comment by Fekete Arpad (arpad) - Thursday, 16 August 2007, 08:03 GMT+2
I see. I will fix it.
Comment by Fekete Arpad (arpad) - Tuesday, 21 August 2007, 11:20 GMT+2
I suggest the same "," character for preparing input for two-operand cas operations.
Comment by Fekete Arpad (arpad) - Tuesday, 21 August 2007, 11:22 GMT+2
When a "," is present, then there should be present pictures for both formulas.
Comment by Kovacs Zoltan (kovzol) - Saturday, 15 September 2007, 02:09 GMT+2
I'm trying to push these tasks to a new man (Ferenc Varajti).
Comment by Kovacs Zoltan (kovzol) - Saturday, 15 September 2007, 02:29 GMT+2
  • Field changed: Due in Version (Undecided → 2.1)
  • Field changed: Due Date (2007-09-08 → 2007-10-15)
+ complex plots
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 09:01 GMT+2
I have started this task with the 2D plot zooming, there are some problems, I think:

- image flickers when I load it. ...I think I can do it with Ajax.

- imagemap boundaries are not perfect, I think. (There is space at the top of the image)
...I can try to solve it.

- there is no zooming out now. We talked about this with Zoltán, and we talked about the following
possibilities:
* zooming out button as a part of the image map
* zooming out with the calculator back button
* separate icon(s) for zooming
I think now that calculator back button is not a good idea, because someone probably want to see the graph
from a bigger distance, and this can't be reached by undo.
If zooming link is a part of the image map, I think the best place of it is at the bottom left corner,
but with a custom cursor on mouseover, or custom icon over the image. But it might overlay something important.
I think we should do it with a separate icon next to the image, I think.
But we should hide it when the user wants to save the page...
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 09:43 GMT+2
Ok, I have commited the basic Ajax part of the complex and 3D plot. The Ajax works now, but I have a suggestion.
Only those buttons should have the gnuplot button type which actually use gnuplot for evaluation.
If complex plot doesn't use gnuplot, then the type of that button should be something other, I think.
Or the name of the gnuplot button type should be plotting instead.
Comment by Kovacs Zoltan (kovzol) - Thursday, 18 October 2007, 09:51 GMT+2
I am also extensively testing the new features. Indeed, the problems you mentioned are really important.

Flickering should be fixed, yes.

I can also see another problem: the numbers on the axes can be of variable width. This results that the graph part of the image hasn't got a fix part on the screen. Probably the axes should be hidden? Another possible solution can be that we write a simple function plotter using the libformconv library with our own texts printed on the image. (I'm not sure if the alternative solution, i.e. putting the text without gnuplot --- as in complex plotting in WMI1 --- would solve this problem.)

OK, the "undo" button is unacceptable for zooming out.

I'm looking forward to discuss other questions, if any.
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 10:09 GMT+2
I think if we check the gnuplot program, something could be done to the numbers on the axes. Sometimes, a big arrow appears also. Why would the method used at complex plots not solve our problem? I think plotting should be solved by gnuplot.

So is it good to make a separate icon for undo?
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 11:04 GMT+2
Ok, the flickering is solved for fast connections.

I found a new problem: what is it when a user enters a problem fast, and he presses the gnuplot button?
Then the Ajax begins to load for a long time.
We should not allow pressing the gnuplot button, if the formula is not yet entered...
I think this is my next task.
Comment by Kornel Csernai (csko) - Thursday, 18 October 2007, 11:06 GMT+2
I agree, the complex plot type should be different than the 3D and 2D plot. We also need new button images for 3D and complex.
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 11:07 GMT+2
But this solution should be tested on IE, I'm not sure that it will work.
In Opera, it's OK. (But in Opera, the mouse cursor didn't change.)
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 11:08 GMT+2
Ok, I will make the plot type and the code changes, Ok?
Comment by Kornel Csernai (csko) - Thursday, 18 October 2007, 11:08 GMT+2
Yes, I too have experienced cases when nothing showed up after a long wait. I usually test WMI2 by typing, not clicking.
Comment by Kornel Csernai (csko) - Thursday, 18 October 2007, 11:10 GMT+2
Ok you make the database changes but what else "code changes" do you mean? I can integrate complex plotting from WMI1. Well, first I have to figure out how it works.
Comment by Fekete Arpad (arpad) - Thursday, 18 October 2007, 11:18 GMT+2
javascript changes, because in calc.js it matters if something is a button type or a button name.
Comment by Kovacs Zoltan (kovzol) - Thursday, 18 October 2007, 12:48 GMT+2
My current experiences:

* Sometimes an axis is out of image. (This bug also appeared in WMI1.)
* Unzoom icon and IMG link remains in printable/savable version.
Comment by Fekete Arpad (arpad) - Friday, 19 October 2007, 08:45 GMT+2
Now there is function plotting in WMI2. Can gnuplot do two-variable equation plotting? (For example, equation of the circle? x^2+y^2=100) If so, I think we could make a button for that.
Comment by Fekete Arpad (arpad) - Friday, 19 October 2007, 10:49 GMT+2
I think the unzoom icon and IMG link in the printable/saveable version can be made disappear in the following ways:

- make them disappear in the document, make the saveable version, and the make them reappear in the document.
(now formula hints are made disappear this way) But I think it is too difficult to save the disappearing contents.

- the other way is to make the saveable version, and after it loaded, make some elements of it disappear.
There are two problems with this: 1. view source shows too much;
2. there should be put something to wait the loading of the page, I am going to do this by putting the alert in that place.
I hope this second way will be good, even on Internet Explorer.
Comment by Fekete Arpad (arpad) - Friday, 19 October 2007, 11:07 GMT+2
The second is not good at the first try... :-(
Comment by Fekete Arpad (arpad) - Friday, 19 October 2007, 11:17 GMT+2
I have got an another idea for making things disappear:

- save the innerHTML contents of the whole worksheet in a javascript variable
- make the disappearings
- pop-up the printable/saveable worksheet
- reload the contents of the whole worksheet from the javascript variable

I am going to try it next.
Comment by Fekete Arpad (arpad) - Friday, 19 October 2007, 11:45 GMT+2
Ok, unzoom icon and IMG link don't remain in printable/saveable version now.
Comment by Fekete Arpad (arpad) - Friday, 19 October 2007, 12:49 GMT+2
I have tried to solve the problem of the gnuplot axis, and calculated the coordinates in PHP,
the axis are in the graph now always, but PHP didn't compute the values properly,
so the axis are sometimes not exactly at 0. :-(
I am going to fix it tomorrow.
Or we can put the arrows always at the bottom and the left...
Comment by Kovacs Zoltan (kovzol) - Friday, 19 October 2007, 22:58 GMT+2
Parametric plot: yes, gnuplot has such feature, but it is not straightforward how to do that. I'm not sure we should use gnuplot in general in future. Later I prefer an own function plotter which is quite easy to implement using the libformconv library. (Other plotting programs may be considered as well, e.g. asymptote --- which has a C-like syntax.)

0: it is very interesting. I have never understood why this can happen... anyone has any clue?
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 08:11 GMT+2
I didn't call it parametric plot, but x-y equation displayer, which is in coordinate geometry. (equation of circle, oval, parabola, etc. lines)

0: axis are defined using coordinates, many types of coordinates are there.
In the "first" coordinate system (the default, which was in WMI1) the coordinates are $xmin, 0, $xmax (x-axis)
I tried to use the "graph" coordinate system. The coordinates are 0, placeof0, 1 (x-axis)
And if placeof0 is not between 0 and 1, then let it be on the border.
But it don't display the placeof0 correctly.
Now I'm going to find out that it is (and was) a PHP number precision bug, or an internal gnuplot bug.
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 09:15 GMT+2
I think I managed to solve the axis problem. Because the problem occured when the axis are out of the graph,
I have written some if statements in PHP to check if the axis are out of the graph, and if so,
then let the coordinates of the axis be at the border of the graph.
I tested it, and it worked.
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 09:34 GMT+2
http://www.gnuplot.info/docs/node142.html
This don't support coordinate geometry equations in an easy way, as I see.
But it is more than nothing.
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 10:26 GMT+2
I'm now searching a solution to the numbers on the axes problem. And I found this about the previous problem:
http://t16web.lanl.gov/Kawano/gnuplot/plot2-e.html
Better late than never...
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 11:40 GMT+2
http://www.gnuplot.info/docs/node295.html
I have studied this, and I have found nothing very good. Setting rmargin to 0, for example, don't clip the area on the right. It should work, but don't work!
Perhaps a newer gnuplot version?
Perhaps very nasty hacks could help, for example:
- rotate the text with 90 degrees (to the bad 90 direction) and then set rmargin to 1 characters, and compute the imagemap coordinates according to the fix top right coordinates, and we should not crop and trim our image.
- display coordinates not with gnuplot, only in php.
- set numberformat (as in printf) to short, and set a fix short margin. (and don't crop our image)
...
Should I try any of these?
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 11:43 GMT+2
Or simply make margins big enough, do not crop and trim, and it would be OK.
Comment by Fekete Arpad (arpad) - Saturday, 20 October 2007, 11:55 GMT+2
Or, an another idea is to print the return value of the "show margin" command in a text file,
process it, and from the margins, compute the imagemap boundaries.
Comment by Kovacs Zoltan (kovzol) - Monday, 10 December 2007, 23:54 GMT+2
Now I drop this task to 2.2. What is left are:

* complex plots,
* rotating, zooming in/out for 3D,
* probably a little bit bigger 3D would be better.
Comment by Fekete Arpad (arpad) - Wednesday, 19 December 2007, 10:33 GMT+2
I tried to make complex plots, but some files are missing. I think that is a task of Kornél.
Whose task is the rotating, zooming in 3D and the bigger 3D?
Comment by Fekete Arpad (arpad) - Friday, 21 December 2007, 12:02 GMT+2
Rotating is done : 180 degrees.
Comment by Fekete Arpad (arpad) - Friday, 28 December 2007, 09:19 GMT+2
I think 3D is ok.
Comment by Fekete Arpad (arpad) - Saturday, 29 December 2007, 09:09 GMT+2
I think 3D is OK, (perhaps the code could be put into a function in plot.inc ?),
complex plot shall be Kornél's task.
Comment by Fekete Arpad (arpad) - Saturday, 29 December 2007, 09:14 GMT+2
I started to make it capable of using parametric plots not now, but it is not done.
Perhaps this could be done by someone.

Loading...