Skip to content
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

cdnjs.cloudflare.com delivering 1.1.0 instead of 1.2.1 #341

Closed
drlippman opened this issue Jan 30, 2021 · 8 comments
Closed

cdnjs.cloudflare.com delivering 1.1.0 instead of 1.2.1 #341

drlippman opened this issue Jan 30, 2021 · 8 comments

Comments

@drlippman
Copy link

Certain functions aren't showing with a functiongraph.

Minimal reproduction example:

var board = JXG.JSXGraph.initBoard('jxgboard', {boundingbox: [-5,5,5,-5], axis:true});
var f = function(x) {  return 2*(x-3)*(x+1); }
var graph = board.create('functiongraph', [f]);

Expected behavior: a graph of the function
Actual behavior: a blank grid
No javascript errors are logged

The graph will appear if the function is changed to 2.1*(x-3)*(x+1), so it seems to be some specific characteristic of that function.

This issue does not exist in 0.99.7, but does starting in 1.0.0, and still exists in 1.2.1.

@alfredwassermann
Copy link
Member

I can confirm this bug for 1.0.0 and 1.1.0, but not for 1.2.1 (and 1.2.0), see https://jsfiddle.net/oe01k4f6/
Can provide a jsfiddle example?
Best wishes,
Alfred

@drlippman
Copy link
Author

drlippman commented Jan 30, 2021

See https://jsfiddle.net/dlippman/fq9n0kju/

Perhaps the cdnjs.cloudflare.com repo isn't loading the right version? Ahh, yeah, it appears it's delivering 1.1.0 instead of 1.2.1.

I'll edit the issue to reflect that. Thanks, and sorry for not catching that earlier.

@drlippman drlippman changed the title Specific function won't graph cdnjs.cloudflare.com delivering 1.1.0 instead of 1.2.1 Jan 30, 2021
@drgrice1
Copy link

drgrice1 commented Feb 10, 2021

I am still seeing this with some graphs with version 1.2.1 (not the incorrect version 1.1.0 from cloudflare).
Here is a minimal example:

var board = JXG.JSXGraph.initBoard('box', { boundingbox: [-8, 1600, 8, -1600] });
board.create('curve', [
	function(t) { return t; },
	function(t) { return Math.pow(t, 2) * (t + 5) * Math.pow(t - 5, 2); },
	-8, 8
]);

With that example no graph appears. If you remove the -8, 8 domain or change that to -7.95, 7.95 the graph appears, but there are messages in the console of the form "TODO _findStartPoint ..."

alfredwassermann added a commit that referenced this issue Feb 11, 2021
Do not attempt to find intersections of the function graph with
the borders of the canvas.
This affects plotVersion:2
See #341.
@alfredwassermann
Copy link
Member

OK, you are right. Thanks for your patience.
I removed this part of _findStartPoint, because it is too unstable numerically.
It will be available in today's nightly build.
You also might experiment with the upcoming new plotting algorithm, plotVersion:4:

board.create('curve', [
  function(t) { return t; },
  function(t) { return Math.pow(t, 2) * (t + 5) * Math.pow(t - 5, 2); },
  -8, 8], 
  {plotVersion: 4});

Version 4 of the plot algorithm is not affected by this bug.
Best wishes, Alfred

@drgrice1
Copy link

I will look into the new plot algorithm.
Thanks.

@alfredwassermann
Copy link
Member

Well, it still has its shortcomings. But it has a promising fresh approach.

@alfredwassermann
Copy link
Member

The bug in the title is now fixed since 1.2.2. It was a bug in the update process.

@drgrice1
Copy link

Sounds good. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants