philogb / jit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web
http://thejit.org
Other
1.51k stars 297 forks source link

SpaceTree: On-Demand Nodes Aren't Loaded in Specific Circumstances #94

Open cjc343 opened 12 years ago

cjc343 commented 12 years ago

When dealing with a SpaceTree that dynamically loads content as a user drills down, there are certain sequences which fail to trigger a request when they should, and perhaps as a result, there are also certain sequences which trigger multiple requests when moving back up the tree and requests were not previously made.

To reproduce:

  1. Load: http://thejit.org/static/v20/Jit/Examples/Spacetree/example2.html
  2. Click on "1.3" at the top of the first column.
  3. Click on "3.5" on the new column that appears.

Result: "4.6" is displayed. Expected Result: "1.3", "1.25", "1.65", and "1.130" should be requested and appear after "4.6"

To see the expected result:

  1. Load the page.
  2. Click on "2.4"
  3. Click on "3.5"

To see the late requests:

  1. Load your favorite JS debugger's script panel.
  2. Set a breakpoint on line 119 of example2.js.
  3. Reproduce the error. Use "3.7" in place of "3.5" if you wish to see the 4 expected requests occur late as opposed to 1 request.
  4. Click on "2.4"
  5. Observe n requests, where n is the number of children of the previously selected node. (1 for "3.5" or 4 for "3.7")

If levelsToShow were 3 instead of 2, this bug could be reproduced by clicking on "2.4" and observing the lack of a final column being added, followed by moving back up to "1.3" at which point 12 requests can be observed (which should have occurred earlier).

It appears this bug occurs when moving down the tree by more than one level when doing so would cause the last column to require a data request.

Let me know if there's any other info you would find helpful. Thanks!