Core writer class for GraphML.
Remarks
write
method which calls GraphMLWriter.write
. It should rarely be necessary to use this class directly.Type Details
- yfiles module
- view-graphml
- yfiles-umd modules
- view-graphml, view
- Legacy UMD name
- yfiles.graphml.GraphMLWriter
See Also
Properties
Gets the events in the internal IWriteEvents implementation.
Remarks
Methods
Create the initial IWriteContext instance.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that is written.
- writer - IXmlWriter
- The core IXmlWriter instance that does the actual writing of XML content.
Returns
- ↪IWriteContext
- An IWriteContext instance that is suitable for
graph
.
Dynamically retrieve all IOutputHandler that should be used for the current write process.
Remarks
Parameters
A map of options to pass to the method.
- context - IWriteContext
- The current write context.
- scope - KeyScope
- The scope to get output handlers for.
Returns
- ↪IEnumerable<IOutputHandler>
- A dictionary from handler definition ids to IOutputHandlers.
Retrieve a serialization property that has been set by setSerializationProperty.
Parameters
A map of options to pass to the method.
- key - string
- The key for the property.
See Also
Fires the HandleSerialization event.
Parameters
A map of options to pass to the method.
- evt - HandleSerializationEventArgs
- The arguments that get passed to the HandleSerialization event.
See Also
Fires the QueryOutputHandlers event.
Parameters
A map of options to pass to the method.
- evt - QueryOutputHandlersEventArgs
- The arguments that get passed to the QueryOutputHandlers event.
See Also
Fires the QueryReferenceId event.
Parameters
A map of options to pass to the method.
- evt - QueryReferenceIdEventArgs
- The arguments that get passed to the QueryReferenceId event.
See Also
Raises the Writing event.
Remarks
Parameters
A map of options to pass to the method.
- evt - WriteEventArgs
- The WriteEventArgs instance containing the event data.
See Also
Raises the Written event.
Remarks
Parameters
A map of options to pass to the method.
- evt - WriteEventArgs
- The WriteEventArgs instance containing the event data.
See Also
Remove a serialization property that has been set by setSerializationProperty.
Parameters
A map of options to pass to the method.
- key - string
- The key for the property.
See Also
Serialize item
.
Remarks
Type Parameters
- T
- The desired type of the result.
Parameters
A map of options to pass to the method.
- targetType - Class
- The desired type of the result.
- context - IWriteContext
- The current parse context.
- item - T
- The object that should be serialized.
Throws
- Exception({ name: 'SerializationNotSupportedError' })
SerializationNotSupportedException
ifitem
cannot be serialized.
See Also
Set a serialization property that allows to fine tune the write process.
Parameters
A map of options to pass to the method.
- key - string
- The key for the property.
- value - Object
- The property value.
See Also
Write the GraphML representation of graph
, using writer
for the actual XML generation.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph instance that is populated.
- writer - IXmlWriter
- The writer that actually writes the XML content.
See Also
Events
Occurs when XML content is about to be serialized.
Remarks
Subscribe to this event to provide custom serialization handling for XML content.
The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called earlier.
The current item is provided by item.
See Also
Event Registration
addHandleSerializationListener(function(this, HandleSerializationEventArgs):void)
Event Deregistration
removeHandleSerializationListener(function(this, HandleSerializationEventArgs):void)
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
Occurs when IOutputHandlers are queried.
Remarks
Subscribe to this event to dynamically register one or more IOutputHandler instance(s) for a given GraphML attribute key definition.
The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called earlier.
If you want to register an IOutputHandler for this GraphML attribute, you can add the handler with addOutputHandler.
See Also
Event Registration
addQueryOutputHandlersListener(function(this, QueryOutputHandlersEventArgs):void)
Event Deregistration
removeQueryOutputHandlersListener(function(this, QueryOutputHandlersEventArgs):void)
Signature Details
function(sender: this, evt: QueryOutputHandlersEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryOutputHandlersEventArgs
- An object that contains the event data.
Occurs when a reference is queried.
Remarks
This event can be used to provide names of external references for objects.
These reference targets are not serialized to the GraphML file.
See Also
Event Registration
addQueryReferenceIdListener(function(this, QueryReferenceIdEventArgs):void)
Event Deregistration
removeQueryReferenceIdListener(function(this, QueryReferenceIdEventArgs):void)
Signature Details
function(sender: this, evt: QueryReferenceIdEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryReferenceIdEventArgs
- An object that contains the event data.
Occurs when the writing of a document is just about to begin.
Remarks
See Also
Event Registration
addWritingListener(function(this, WriteEventArgs):void)
Event Deregistration
removeWritingListener(function(this, WriteEventArgs):void)
Signature Details
function(sender: this, evt: WriteEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - WriteEventArgs
- An object that contains the event data.
Occurs when the writing of a document has just been finished.
See Also
Event Registration
addWrittenListener(function(this, WriteEventArgs):void)
Event Deregistration
removeWrittenListener(function(this, WriteEventArgs):void)
Signature Details
function(sender: this, evt: WriteEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - WriteEventArgs
- An object that contains the event data.