Welcome to Kap Lab Store

Topic "Lazy load/build of graphs"

8 Item(s)

per page
I managed to solve this problem with many hack-arounds using Visualizer 1.6

I'm now upgrading to Kalileo 2.1 and have hit my first stumbling block. Basically, I need to intercept the "node expand" action (double-click typically) and dynamically add nodes to the graph as child nodes of the expanding node. Our graphs are often very large data sets and thus, cannot be loaded all up front. Also, we sometime generate data on the fly as the user explores the graph.

Seems that the events have changed and I no longer get the opportunity to handle the expand/collapse event intelligently.

Documentation pointers or examples appreciated!
Posted : 18 May 2011 05:37
You should be able to do this as you have done with the visualizer 1.6. For this you can use these events :
*VisualizerEvent.ELEMENTS_EXPANDED_COLLAPSED: dispatched when a node is expanded/Collapsed
*VisualizerEvent.ELEMENT_CLICKED: dispatched when a node is clicked ( simple click)
*VisualizerEvent.ELEMENT_DOUBLE_CLICKED: dispatched when a node is double clicked
*VisualizerEvent.ELEMENTS_CREATED: dispatched when an element was created.
You can have access to the list of your created nodes using the visualizer.nodesMap.
Posted : 24 May 2011 14:28
Sorry. I should have been clearer.

What I really need is events such as ELEMENT_WILL_EXPAND and ELEMENT_WILL_COLLAPSE

i.e. "advance notice" so that I can dynamically add nodes to the graph.

The DOUBLE_CLICK isn't logically what I want since it doesn't tell me whether the result of the double click will be to expand or to collapse.

The ELEMENTS_EXPANDED_COLLAPSED is similarly a problem since it only gets sent *after* the animation is done which is too late for my purpose. Also, it conflates both expand and collapse into a single event whereas I really need to know the difference.

I had previously modified the Visualizer / GenericSprite source somewhere to do this in the 1.6 version.
Posted : 23 June 2011 14:56
Worse, the ELEMENTS_EXPANDED_COLLAPSED event *always* passes an empty array [] as the "items". No way to find out what expanded or collapsed!!
Posted : 23 June 2011 16:54
Hi there,

I have the very same issues. When is KapLab going to find a solution? I'm on a tight schedule and these bugs are putting me ever so behind in my project.
Posted : 28 June 2011 10:07
Unfortunately, kalileo does not dispatch an event when clicking on the expand icon but we will try to include this improvement for next releasees. However, you can resolve your problem by using your custom node renderer and try to add an event listener when your custom expand or collapse button are clicked , it should not be very complicated to do ( you will have control on all elements and stats).
Wish that helps you.
Posted : 04 July 2011 10:28
I want just to inform you that we have added news events and fixed the others, some new events has been added like ELEMENTS_EXPAND_COLLAPSE_STATE_CHANGED.
This improvement will be available for the next minor release planned for the next two weeks at most.
I wish that it helps you
Posted : 03 August 2011 11:37

I ran into a similiar problem and i got stuck with the expand/collapse-Button.

I have a datastructure where i don't know how deep it's going to be, so i try a lazy loading approach to build the graph. Every node can only have two children, but these can link to already existing nodes.

I initialize the graph with the root-node and its two children. What i am trying to do is to show the expand-button for the nodes that i know have children, but are not children-nodes in the tree at that time. When the user clicks on the Button then my addNode()-Method retrieves the children for that parent-node and creates the child-nodes and the according links.

I tried the solution to extend the DefaultItemRenderer to always display the expand-Button but the nodes are not visible in the visualizer. What do i miss here?

thanks in advance!

Posted : 23 November 2016 09:59

8 Item(s)

per page