Black Lives Matter. Please consider donating to Black Girls Code today.

Plotly runs out of memory while trying to plot

I made a GUI that does some statistical analysis on phylogenetic trees. When 2 nodes selected, it plots a some graphs using Plotly. It was working good until our last tree. When using this tree, it runs out of memory trying to plot the graphs needed.

Here, how it normally works:

But when we use the tree we want to use, it just gets stuck and after a while, browser warns me that it ran out of memory. The picture shows the stuck screen. Normally, after clicking “select as second node” it automatically does the statistical analysis and plots the graphs.

In the second tree, as you can see, leaves have a length of 0 from their parents. I thought it might be an issue with them having 0 length but when i checked the testing, we actually selected common ancestor of the nodes as a distance point so the data is not 0 but they are all the same for same node’s leaves. I thought this may be the reason so i made a codepen using my code that plots the charts and used same values to plot. Then it worked. As expected, it just plots a line.
Here is the codepen that works:

Then i tried using the data that my GUI using to plot the charts. It didn’t work. I made a separate codepen for that.
Here is the codepen that doesn’t work(the actual data that GUI using to plot):

Both data have equal amount of points to plot for each part. But difference is, one of them is float and other one is integer. However, the data in the first picture also have only floats and i don’t think that is a problem. However, i couldn’t figure out what is the problem. Can you help me figure out the problem?