You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the getClassJenks function, I ended up finding out that if I pass in a string value as the nbClass param, it will result in a very slow execution time. After looking at your source code, I noticed that it was appending a 1 to the end of the value instead of the expected addition.
For example, if I called getClassJenks("5") on a series with ~ 4000 rows, it was taking a very long time to return results. ~ 10 seconds
Here is a debugging image from chrome:
It looks like in my example, it is looping 51 times instead of 6 times.
Maybe the user should be smart enough to make sure to pass in a number type when calling this function, but I think it would be helpful to try to parse the nbClass value if it a string / log an error if the user passes in a string.
I would be happy to create a pull request to fix this issue if you want. I love this library, it has helped me out quite a bit in the last year.
The text was updated successfully, but these errors were encountered:
Thanks for reporting @Jfairfield1 , I just proposed a fix - implemented on all classification methods
I let you test it.
Come back to me if it does not work correctly. If you want to contribute to the project, you can have a look on issues #22 and / or #30.
Your solution seems to work great! Thanks so much for the quick response. I'd love to jump in and work on the project. I'll take a look at these issues and see how it goes.
When using the getClassJenks function, I ended up finding out that if I pass in a string value as the nbClass param, it will result in a very slow execution time. After looking at your source code, I noticed that it was appending a 1 to the end of the value instead of the expected addition.
For example, if I called getClassJenks("5") on a series with ~ 4000 rows, it was taking a very long time to return results. ~ 10 seconds
Here is a debugging image from chrome:
It looks like in my example, it is looping 51 times instead of 6 times.
Maybe the user should be smart enough to make sure to pass in a number type when calling this function, but I think it would be helpful to try to parse the nbClass value if it a string / log an error if the user passes in a string.
I would be happy to create a pull request to fix this issue if you want. I love this library, it has helped me out quite a bit in the last year.
The text was updated successfully, but these errors were encountered: