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

Uncaught RangeError: Maximum call stack size exceeded at Array.sort (native) #3

Closed
cptolemy opened this issue Jan 24, 2018 · 5 comments

Comments

@cptolemy
Copy link

Good morning,

I think astrochart is a very well written piece of code - congrats.

Still, I'm calculating several charts making several calls and I get this error:

Uncaught RangeError: Maximum call stack size exceeded at Array.sort (native)

The error occurs in in these lines:

astrology.utils.assemble = function( locatedPoints, point, universe){
	
	// first item
	if(locatedPoints.length == 0){
		locatedPoints.push(point);
		return locatedPoints; //================>
	}
	
	var isCollision = false;
	locatedPoints.sort(astrology.utils.comparePoints); //<<<< ERROR HERE

To be honest, I can't find "astrology.utils.comparePoints". The error occurs in dates which really have many planets near each other.

Can you please advise?

Kind regards

Kepler

@Kibo
Copy link
Owner

Kibo commented Jan 24, 2018

Hi
thanks a lot for the report, there is a bug.

Please, can you send your complete code?

Thanks

@cptolemy
Copy link
Author

Good morning,

Thanks for the reply. Yes, of course. Exactly what code do you need? The data array for the natal and transit data?
Meanwhile, I've noticed that the error does not occur IF we increase the canvas of the chart and lower the scale of the glyphs (no collision issues...)

Kind regards,

@Kibo
Copy link
Owner

Kibo commented Jan 24, 2018

Exactly what code do you need?

Please, your JavaScript, if is it possible. For instance:

<script type="text/javascript">  
        
        	var dataRadix = {	
        				"planets":{"Moon":[45.930008627285154],"Venus":[263.2584780960899],"Jupiter":[173.07043720306802],"NNode":[174.6895307834239],"Mars":[217.97167231451178],"Lilith":[196.19480722950317],"Saturn":[252.92341772675047],"Chiron":[348.1157239728284],"Uranus":[16.7900184974611],"Sun":[297.68062428797253],"Mercury":[289.10132025725494],"Neptune":[338.01899718442604],"Pluto":[285.6473452237151, -0.123]},
        				"cusps":[348.20510089894015,38.108507808919654,65.20783751818992,84.96083001338991,103.77897207128007,127.1084408347092,168.20510089894015,218.10850780891965,245.20783751818993,264.9608300133899,283.77897207128007,307.1084408347092]
        	};
        	
		    var dataTransit = {
		    		"planets":{"Moon":[60.739220451080115],"Venus":[305.6996431634707],"Jupiter":[198.6565699576221],"NNode":[157.25592636170012],"Mars":[324.84013049518734],"Lilith":[232.88904207991555],"Saturn":[259.1015412368795, -0.2],"Chiron":[350.7285587924208],"Uranus":[20.678747795787075],"Sun":[260.94912160755536],"Mercury":[281.5699804920016],"Neptune":[339.3848859932604],"Pluto":[286.29683069280685]},
		    		"cusps":[296, 350, 30, 56, 75, 94, 116, 170, 210, 236, 255, 274]		    				    	
		    };
			                              	        	        	        	            
        	window.onload = function () {
            	var chart = new astrology.Chart( 'paper', 600, 600, {MARGIN:100, SYMBOL_SCALE:0.8});
            	var radix = chart.radix( dataRadix );
            	
            	// Aspect calculation
				// default is planet to planet, but it is possible add some important points:															
            	radix.addPointsOfInterest( {"As":[dataRadix.cusps[0]],"Ic":[dataRadix.cusps[3]],"Ds":[dataRadix.cusps[6]],"Mc":[dataRadix.cusps[9]]});
            	
				var transit = radix.transit( dataTransit );
				transit.aspects(); 																													 																																																            													            	        
			};
		</script>

Meanwhile, I've noticed that the error does not occur IF we increase the canvas of the chart and lower the scale of the glyphs (no collision issues...)

Please, try change:
astrology.COLLISION_RADIUS
https://github.com/Kibo/AstroChart/blob/master/project/src/settings.js#L161

For instance
var chart = new astrology.Chart( 'paper', 600, 600, {COLLISION_RADIUS:6});

Thanks

@cptolemy
Copy link
Author

Good morning,

I'm sorry for the late reply - thanks for your help.

Changing the Collision_radius does the job, along with increasing a a little the map. The problem is that in my own birthdate I had almost all the planets together in Taurus ;) Looking now at the Chrome debug console, the collisions are all solved without any error.

Clear skies

Kepler

@Kibo
Copy link
Owner

Kibo commented Jan 25, 2018

This issue was divided to

  1. Maximum call stack size exceeded
  2. Compare function does not exist

@Kibo Kibo closed this as completed Jan 25, 2018
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

2 participants