There are various possibilities to read and write GraphML data in yFiles FLEX:
API Excerpt 4.1. GraphCanvasComponent support for GraphML import and export
// Reading a graph into the GraphCanvasComponent loadGraphFromURL(URL:String, ioHandler:IOHandler = null, theGraph:IGraph = null):void loadGraphFromXML(xml:XML, ioHandler:GraphMLIOHandler = null, theGraph:IGraph = null):void // Writing a graph to XML writeGraph( ioHandler:GraphMLIOHandler=null ):XML
More control over the serialization or deserialization process is provided by class
GraphMLIOHandler.
The I/O handler can read and write graphs to/from GraphML through the
methods listed in API Excerpt 4.2, “GraphMLIOHandler read and write methods”.
Most applications will use a preconfigured
DefaultGraphMLIOHandler,
JavaCompatGraphMLIOHandler
, or
DotnetCompatGraphMLIOHandler
subclass of GraphMLIOHandler
.
A "plain" GraphMLIOHandler instance registers no additional
IInputHandler
s,
IOutputHandler
s,
ISerializer
s,
IDeserializer
s or
IRealizerSerializer
s.
Hence, only structural data will be read and written if the handler is not
configured before reading or writing.
Note that the read and readURL methods require an
existing IGraph instance
which will be populated by the GraphMLIOHandler.
Copyright ©2007-2015, yWorks GmbH. All rights reserved. |