openmathdocs / precalc

Modelling-based approach to pre-calculus materials: exponential, logarithmic, polynomial, rational, piecewise-defined, and trigonometric functions; transformations and composition of functions; parametric curves. Emphasizing the rule of four: graphically, numerically, verbally, and algebraically
0 stars 1 forks source link

svg vs canvas elements for graphing #1

Closed cmhughes closed 9 years ago

cmhughes commented 10 years ago

The more I think about this, the more that I would like to try to use a canvas-based javascript tool for the html version of graphs in this project.

Certainly the svg graphs will look similar to the beautiful tikz graphics that we produce in the pdf but they won't be able to take advantage of all of the interactive things that we can do on a webpage, such as:

Alex, any thoughts?

PS: this isn't really an issue, but it seemed like a reasonable place to voice this conversation.

Alex-Jordan commented 10 years ago

Give it a go and see what you can do. Maybe start with a simple one of our tikz images, and then try one that is more intricate?

cmhughes commented 10 years ago

Indeed I will.

I'm getting ahead of myself, but eventually I would like to make a script called (something like) tikz2canvas.pl. For all of our 'simple' function graphs, I believe that my old code will be a good starting point.

On Mon, Jun 30, 2014 at 5:23 AM, Alex Jordan notifications@github.com wrote:

Give it a go and see what you can do. Maybe start with a simple one of our tikz images, and then try one that is more intricate?

— Reply to this email directly or view it on GitHub https://github.com/openmathdocs/precalc/issues/1#issuecomment-47493799.

cmhughes commented 10 years ago

See mwegraphing.html for a proof of concept; it remains to write it in xml and translate it, but this should motivate that the canvas element is useful

screenshot from 2014-07-01 22 08 41

screenshot from 2014-07-01 22 11 03 screenshot from 2014-07-01 22 12 17

Among the (many) things that remain:

cmhughes commented 10 years ago

The most recent commit uses MathJax for the tick labels - I think it looks a lot better. This will also allow for node labelling, e.g y=f(x).

Also on the to-do list is legends.

cmhughes commented 10 years ago

Alex - can you have a look at the latest mwegraphing.html, both the code and the output, and see if you think it's going in the right direction?

There is much more to do, which I will continue to implement. I hope to make it as similar to pgfplots (at least from an input point of view) as possible.

Once it has a few more features, I believe that it might be worth trying to get into WeBWorK - we could try and make it the graphing counterpart to your wonderful tables.

Alex-Jordan commented 10 years ago

I will as soon as I can---probably toward the end of this week. Classes, WeBWorK, the AHEAD conference, and home life are taking their shares. I'll get back to you.

On Mon, Jul 7, 2014 at 1:00 AM, cmhughes notifications@github.com wrote:

Alex - can you have a look at the latest mwegraphing.html, both the code and the output, and see if you think it's going in the right direction?

There is much more to do, which I will continue to implement. I hope to make it as similar to pgfplots (at least from an input point of view) as possible.

Once it has a few more features, I believe that it might be worth trying to get into WeBWorK - we could try and make it the graphing counterpart to your wonderful tables.

— Reply to this email directly or view it on GitHub https://github.com/openmathdocs/precalc/issues/1#issuecomment-48150266.

Alex Jordan Mathematics Instructor Portland Community College

cmhughes commented 9 years ago

Closing this--current work-flow is to use tikz and convert to svg; there's no way I have time to make a canvas-based equivalent to tikz.