Talk:Graph Object Wishlist

From WeBWorK_wiki
Revision as of 17:31, 3 December 2008 by Dpvc (talk | contribs) (New section: Comments on the proposal)
Jump to navigation Jump to search

Hi Darwyn,

Looks good to me. I think we need a more general specification for ""labels" and "stamps". These are text or images that appear in the graph at specified position.

I use them to implement the open and filled circles in piecewise graphs, and also as labels of points "a", "b". They can also be used to plot discrete data. It would be nice if the text could include math symbols such as \alpha.

One "label" you refer to might be called a "legend" or "caption" or "title" for the entire graph. There are also labels for axes, but not in general.

references:

http://webwork.maa.org/doc/cvs/pg_HEAD/lib/Label.html
http://webwork.maa.org/doc/cvs/pg_HEAD/lib/WWPlot.html see section "fn, lb, stamps"
          

Your thoughts? -- Mike

Mike, The labels are handled by string objects. I think this adds the benefit of having labels that can be "texed", like being able to label the graph of a trig function with multiples of pi. Of course that probably means more work for Davide.

The stamps would be circle objects. It might be a good idea to define the default radius of a circle so that it will appear as a stamp, circle objects can be filled or not.

This can be included in the graph of a function by putting the function, string, and circle all in a list object.

It might be appropriate to add in a method for invoking a certain type of graphing routine, in particular invoking a flash applet as opposed to the built in wwplot. I didn't add this functionality to the specs, waiting for input from the flash applets group.

Comments on the proposal

I like the use of List object as the container for graphs.

It is a bad idea to use String objects for labels, since they require the string to be added to the Context, and that makes the string available in student answers, which probably is not what you want. There should probably be a Label() object that is a string without the requirement that it be in the context.

Syntax problems: $x->{y=>z} should be $x->{y} = $z. You can also use Formula("...")->with(y=>z,...) or $x = $x->with(y=>z,...).

E.g., $graph = List($f1,$f2,String("Piecewise Defined")->with(position=>"header"));

Note that z may need quotation marks if it is a string constant: Something like $title->{position=>header} should be $title->{position} = "header";


Note: There is a PiecewiseFunction math object that could also be used.

You propose Circle and RegularPolygon as new types. Also should have Rectangle? Line? I might suggest Graph::Circle, Graph::RegularPolygon, etc.


For option size: "filesize" is probably a bad name (since it could be confused with storage space). "pixels" might be better.

I'm not sure I understand the texsize parameter. I would like to see two controls: a scaling factor to produce a new image at a higher resolution (for printing) and a scaling factor for use within the TeX document (perhaps relative to the \hsize?)

For option Axes: What does "the point of intersection of the two axes" mean? Are these within the coordinate space of the graph, or the pixel space of the image? (I.e., if the point is (10,5), does that mean that a vertical axis is drawn at x=10 and a horizontal one at y=5 within the coordinate space of the graph, or does it mean that the origin (0,0) is at 10 pixels in from the left of the image and 5 down from the top (or up from the bottom) of the image?) You may need controls for both.

Ticks might want to be specified as a delta as well.

Specifying fonts might be problematic. Not sure what fonts the system has.

For circles, the center and radius should be part of the object. (This is what $r->{center} and $r->{radius} will be anyway.) You can always change them once the object is set up, but just as a Real is a specific real, a Circle should be a specific circle.

You may also want to specify circles by bounding box?

For Formulas, not sure test_points and num_points are the right things for this. They are used for answer checking, and appropriate settings for them are not appropriate for graphing. E.g., num_points is usually 3. Might use plot_points, for example.

Should functions of two variables produce 3D plots using LiveGraphics3D (or something similar)? What about functions that produce points? Should they produce parametric plots?

ImplicitEquation is really only experimental, but could be used for this. I'm not sure what test_points and num_points will do in this case. Depending on the algorithm used to determine the implicit curves, they might or might not be useful. Do you want to have multiple levels (e.g., f(x,y) = k for different values of k?) Should you be able to color (or shade) the regions between? I think there need to be more options, here.

Intervals: graphics might want their own Context settings (not just flags). If not, "delimiters" is probably not descriptive enough. Perhaps GraphicDelimiters?

Points: Not sure "delimiter" is the right name for this. Perhaps "PointMark"? If you use "delimiters" for everything, you can't use the Context flag for this, as the different classes have different values that the delimiter can take.

The Set object is a finite set of Reals, so it should be the same as the graph of a list of Reals.

For Unions, it seems to me that the Interval options would override the Union options, if they are present, rather than taking the options from the last one.

For Vector: the use of limits is incompatible with the internal use of limits when the vector is parametric. (Note that this produces a Formula object anyway, so it is not a Vector object, and so should fall under the Formula catergory). This suggests that you may want to use "axesLimits" (or something similar) rather than "limits" throughout. Since limits are used in answer checking, and may not correspond to the appropriate visual limits, that might be a good idea anyway.