GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing maxgraph.github.io — Codec | @maxgraph/core
Class CodecXML codec for JavaScript object graphs. See ObjectCodec for a description of the general encoding/decoding scheme. This class uses the codecs registered in CodecRegistry for encoding/decoding each object. ReferencesIn order to resolve references, especially forward references, the Codec constructor must be given the document that contains the referenced elements. ExamplesThe following code is used to encode a graph model.
WARN: as of version 0.6.0, the codecs provided by maxGraph are no longer registered by default, they MUST be registered before
performing ExampleUsing the code below, an XML document is decoded into an existing model. The document may be obtained using parseXml for parsing an XML string.
ExampleThis example demonstrates parsing a list of isolated cells into an existing graph model. Note that the cells do not have a parent reference so they can be added anywhere in the cell hierarchy after parsing.
ExampleUsing the following code, the selection cells of a graph are encoded and the output is displayed in a dialog box.
Newlines in the XML can be converted to DebuggingFor debugging, I/O you can use the following code to get the sequence of encoded objects:
Note that the I/O system adds object codecs for new object automatically. For decoding those objects, the constructor should be written as follows:
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |