Auar / flexvizgraphlib

Automatically exported from code.google.com/p/flexvizgraphlib
0 stars 0 forks source link

Changing the xml #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I'm new in the world of Flex, I'm running Flex Builder 2 and I'm not
really good in English (sorry).

I'm trying to use a notion of project with Relation Navigator Demo.
I want to be able to change ths Xml files or to add and remove node and
edges in those project. (like opening saving and closing a project).

But I can't change a xml (wich represent a project)!

I tried several things but I always have lots of error.
I tried to reload with new Xml : 
  initData(['Node','Edge','fromID','toID'],xmldata2);
  private function initData(xmlNames:Array,myXml:XML):void {
  graph = new
org.un.flex.graphLayout.data.Graph("XMLAsDocsGraph",false,myXml,xmlNames);

Like that but I've some errors when I want to change the xml (Xmldata2 for
example)

I tried to remove all edges and all nodes of the graph or the vnodes but 
I've a bug when it's empty.

I think I'm missing something. So, if you have and idea, I would be a great
help.

(I hope I've post it on the right place).
Thanks for your help.

Ps : For creating and removing node I was thinking of using createNode and
removeNode of the graph, but for now I'm loosing my hair for changing the XML

Original issue reported on code.google.com by lecontac...@gmail.com on 29 Aug 2007 at 10:19

GoogleCodeExporter commented 9 years ago
Hi,

the code was not tested thoroughly for dynamic insertion or deletion of nodes 
and
edges, although the VisualGraph class provides methods to do so (you already 
mentioned
them). Further the demo application itself is designed to always require a valid
graph object, so yes it would break if you have no more nodes or not even a root
node (the layouters all require a spanning tree and thus a root node). That is 
not a
strict limitation of the graphLayout library, but there are some bits and pieces
missing in order to fully generalise it that way.

If you want to use different graphs you can try the following:
 - create one or more GraphML files
 - you can obtain corresponding XML objects using <mx:HTTPService>, there is
   a commented section in the Demo application code.
 - if you want to switch the XML objects, you need to make sure you stop
   any existing layouting operations (or animations), the "resetAll();" 
   method of the Layouter should do it (in theory).
 - Then you would need to remove the existing Graph object from the VisualGraph
   and replace it with a new Graph object, that is being initialised with
   your other XML file.
 - repeat the initialisation of the VisualGraph (those you think are required), I
   think all the currently visible nodes and edges datastructures would need to
   be purged and there is not really any infrastructure there, yet, to do this....
 - reinit a layouter and then you would be able to display a different Graph.

As you can see, there are still some pieces missing to easily change out the
underlying data. We will continue to work on that of course, but we also invite
the community to send us patches for any improvements and enhancements you 
can imagine.

I keep this issue open until we have some progress here.

Thanks,
 Daniel

Original comment by spo...@gmail.com on 30 Aug 2007 at 7:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Trying to follow the methodology described

private function clearVGraph():void {
                myData.removeAll();
                layouter.resetAll();
                vgraph.clearHistory();
                vgraph.removeAllChildren();
                myHTTPService.send();
}

This doesn't seem to work, what would I be missing?

Original comment by marc.ris...@gmail.com on 7 Oct 2007 at 12:08

GoogleCodeExporter commented 9 years ago
Hi,

yes, there are issues related to the modification of the node base.
I will see if I find the time soon to look at it.

It would be very helpful to have a kind of demo application that explicitly
demonstrates the error/crash.

Marc, could you possibly provide one?

Original comment by spo...@gmail.com on 21 Mar 2008 at 3:14

GoogleCodeExporter commented 9 years ago
I am also working on something similar.  The graph works great until I try to 
change
the XML.  What I have done is changed the data provider to be a variable in the
actual program instead of an external file, then I dynamically rewrite the 
variable,
any attempt to reinitialize the graph, however, does not work.  Are there any 
more
updates or changes to this issue that I may be able to benefit from?

Thanks, and awesome work on this, its a really useful tool.

Original comment by landry.j...@gmail.com on 30 Jun 2008 at 6:08