从此例中终于实现了从外部xml文件读取数据使用Flare 生成有节点有连线的Graph

http://goosebumps4all.net/34all/bb/showthread.php?tid=127

 

reading graph from a graphml file
reading graph from a graphml file
Good morning flare users,

hope life is pleasing yet challenging ;-)

This demo reads the graph from a graphml file. It implements for that purpose a simple GraphMLReader class which seems to do the job and might be of use for some beings around.

One strange problem I discovered is that the GraphMLConverter seems to have troubles if the graphml tag is written like

Code:
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">

so for the time being I replaced it with

Code:
<graphml>

in the attached socialnet.xml file, on which this demo is based and which you need to download and place in the “execution” directory of your IDE in order to get this extremely mind blowing demo running

A GraphMLReader class would be of course a candidate for the flare lib, so please help with your feedback to make this first round attempt something mature.


Cheers


martin


requires flare version 2008.07.29 or higher


Attached File(s)
   socialnet.xml (Size: 3.84 KB / Downloads: 816)
   GraphMLFileDemo.as (Size: 6.49 KB / Downloads: 607)
17-04-2008, 11:03 AM (This post was last modified: 19-04-2008 10:10 AM by mightyx.)
Post: #2
RE: reading graph from a graphml file
Hi Martin,

why is it not possible to load data from an external source f.e.

Code:
gmr.read("http://iaf-ma.de/_dennis24/Projektarbeit/casa_data.xml");

This won't work, nor uploaded on a server:
http://www.mightyx.de/GraphMLFileDemo/GraphMLFile.html

edit: just found the solution of this problem: A crossdomain.xml is needed on the target server (f.e. http://www.youtube.com/crossdomain.xml)

greets Dennis
21-04-2008, 08:18 AM  
Post: #3
RE: reading graph from a graphml file
Hi Denis,

thanks for sharing the solution.

cheers

martin
25-05-2008, 01:20 AM  
Post: #4
RE: reading graph from a graphml file
34all Wrote:
Code:
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">

so for the time being I replaced it with

Code:
<graphml>

Hey Martin,

I thought I would point out that the reason you can't access the first example is because you need to set the namespace in AS3:
Code:
namespace ns= "http://graphml.graphdrawing.org/xmlns";
use namespace ns;

You can learn more about namespace here:
http://livedocs.adobe.com/flash/9.0/Acti...space.html

- Anthony
25-05-2008, 09:18 AM  
Post: #5
RE: reading graph from a graphml file
Hello Anthony,

thanks a lot for pointing that out.

Cheers

martin
27-02-2009, 11:25 PM  
Post: #6
RE: reading graph from a graphml file
How do you implement the ns namespace in a flex/ flash project?


(25-05-2008 01:20 AM)agraddy Wrote:  
34all Wrote:
Code:
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">

so for the time being I replaced it with

Code:
<graphml>

Hey Martin,

I thought I would point out that the reason you can't access the first example is because you need to set the namespace in AS3:
Code:
namespace ns= "http://graphml.graphdrawing.org/xmlns";
use namespace ns;

You can learn more about namespace here:
http://livedocs.adobe.com/flash/9.0/Acti...space.html

- Anthony
28-04-2009, 05:41 PM  
Post: #7
RE: reading graph from a graphml file
Hi:

First I want to thank this forum because it is helping me a lot. I have a question:

I use this class for learn the flare layouts and create a radial tree, but my file I think that is big because with a simple graph file i can see the radial tree but with the attach file (graphfile.xml) I have this error:

#1502: El tiempo de ejecución del script ha superado el tiempo de espera predeterminado de 15 segundos.

The time execution is more than 15 seconds and i can't load de graph file. I use flex builder 3 with flare because i want to create a interface to see the visualization of the users with some charts. But if i can't load the file i can't start the project.......

thank's a lot.

(10-04-2008 10:36 AM)34all Wrote:  Good morning flare users,

hope life is pleasing yet challenging ;-)

This demo reads the graph from a graphml file. It implements for that purpose a simple GraphMLReader class which seems to do the job and might be of use for some beings around.

One strange problem I discovered is that the GraphMLConverter seems to have troubles if the graphml tag is written like

Code:
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">

so for the time being I replaced it with

Code:
<graphml>

in the attached socialnet.xml file, on which this demo is based and which you need to download and place in the “execution” directory of your IDE in order to get this extremely mind blowing demo running

A GraphMLReader class would be of course a candidate for the flare lib, so please help with your feedback to make this first round attempt something mature.


Cheers


martin


requires flare version 2008.07.29 or higher
24-06-2009, 07:03 AM (This post was last modified: 24-06-2009 07:06 AM by prits23.)
Post: #8
RE: reading graph from a graphml file
(10-04-2008 10:36 AM)34all Wrote:  Good morning flare users,

hope life is pleasing yet challenging ;-)

This demo reads the graph from a graphml file. It implements for that purpose a simple GraphMLReader class which seems to do the job and might be of use for some beings around.

One strange problem I discovered is that the GraphMLConverter seems to have troubles if the graphml tag is written like

Code:
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">

so for the time being I replaced it with

Code:
<graphml>

in the attached socialnet.xml file, on which this demo is based and which you need to download and place in the “execution” directory of your IDE in order to get this extremely mind blowing demo running

A GraphMLReader class would be of course a candidate for the flare lib, so please help with your feedback to make this first round attempt something mature.


Cheers


martin


requires flare version 2008.07.29 or higher

Hi Martin,

In GraphMLFileDemo.as I am unable to load another xml file .

[gmr.read("http://10.74.65.142:8080/JSP2XMLNihar/test3.jsp")]

Please help.

thnks and regards
prits








(10-04-2008 10:36 AM)34all Wrote:  Good morning flare users,

hope life is pleasing yet challenging ;-)

This demo reads the graph from a graphml file. It implements for that purpose a simple GraphMLReader class which seems to do the job and might be of use for some beings around.

One strange problem I discovered is that the GraphMLConverter seems to have troubles if the graphml tag is written like

Code:
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">

so for the time being I replaced it with

Code:
<graphml>

in the attached socialnet.xml file, on which this demo is based and which you need to download and place in the “execution” directory of your IDE in order to get this extremely mind blowing demo running

A GraphMLReader class would be of course a candidate for the flare lib, so please help with your feedback to make this first round attempt something mature.


Cheers

martin


requires flare version 2008.07.29 or higher
24-06-2009, 09:46 AM (This post was last modified: 24-06-2009 09:48 AM by 34all.)
Post: #9
RE: reading graph from a graphml file
Hi Prits,

do you have a proper crossdomain.xml on the target server? (see mightyx's reply above)

martin

你可能感兴趣的:(Graph)