Radial Partition Diagram doesn't work with setTimeout()

Hi team.

I downloaded the Radial Partition Diagram source code and easily run it. But my problem is when i put the generateGraph() function call into a setTimeout like following, it doesn’t show anything.


appreciate any help.

OK. I used setInterval instead of setTimeout and solved the problem

Are you sure you want to call setInterval?

Ah, there’s a bug in RadialLayout where it signals an error if there are no nodes to be laid out (or no vertexes in the Layout.network). We’ll fix that for the next release. Thanks for pointing out the problem.

Thank you walter.
Could you estimate the time of next release?

You can add this “no-vertexes” check to the RadialLayout.doLayout method in the extensions/RadialLayout.js file:

RadialLayout.prototype.doLayout = function(coll) {
  if (this.network === null) {
    this.network = this.makeNetwork(coll);
  // without this line there is an exception if there are no nodes:
  if (this.network.vertexes.count === 0) return;

  if (this.root === null) {
    . . .

Thank you again walter. It worked greatly.