New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with JXG.Dump and element/curve #71

Open
sebablanco opened this Issue Nov 21, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@sebablanco
Copy link
Contributor

sebablanco commented Nov 21, 2013

When running JXG.Dump.toJessie on a board containing a curve, I get a JavaScript TypeError.

Example: http://goo.gl/XSUWXu (open the developer console to see the actual error)

The error is thrown here: https://github.com/jsxgraph/jsxgraph/blob/4c756f6/src/utils/dump.js#L216

It tries to read length from element.parents, but it seems to be undefined for the curve element.

@migerh

This comment has been minimized.

Copy link
Member

migerh commented Nov 21, 2013

Thanks for pointing this out. I just pushed 120f536 to GitHub which will fix the exception thrown but it won't fix the underlying issue. We can't dump any curve that displays a function implemented in JavaScript. We can only plot some special curves like plots of functions implemented in JessieCode but I haven't had the time to implement this yet.

@sebablanco

This comment has been minimized.

Copy link
Contributor

sebablanco commented Nov 22, 2013

Yeah I imagined dumping a curve could be problematic.

I discovered this when I was trying to see if it was possible to dump curves that were fully defined by data arrays.

I am guessing it should still be possible if we marked the curve as "dumpable" if the parents are data arrays?

@migerh

This comment has been minimized.

Copy link
Member

migerh commented Nov 22, 2013

Yes, curves defined by static data arrays are perfectly dumpable. Also, all plot curves defined by GEONExT/JessieCode formatted strings are theoretically dumpable but that might require some work in the JC interpreter.

@sebablanco

This comment has been minimized.

Copy link
Contributor

sebablanco commented Nov 23, 2013

Right.

Implementing it would bring even more power to JSXGraph I think. While it won't cover all cases, it bring is one step closer. Specially for anyone adding interactivity to their constructions and wanting to provide a simple way of saving the construction by dumping the board as JessieCode.

@alfredwassermann

This comment has been minimized.

Copy link
Member

alfredwassermann commented Jan 13, 2016

With commit 1aa1f14 some types of curves, e.g. plots with static array data, can be dumped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment