Reads and writes graphs from/to the GraphML format.
Remarks
Type Details
- yfiles module
- view-graphml
- yfiles-umd modules
- view-graphml, view
- Legacy UMD name
- yfiles.graphml.GraphMLIOHandler
See Also
Constructors
Creates a new instance of GraphMLIOHandler.
Properties
Gets or sets a value indicating whether to clear an existing graph instance before reading
Remarks
If set totrue
, an existing graph instance will be cleared before the graph is read into this instance, otherwise the loaded graph will be merged into the existing one.
The default is true
.
Gets the mapper for the overrides of the deserialization properties.
Gets the mapper for the overrides of the serialization properties.
Methods
addGraphInputData
<TValue>(dataType: Class, name: string, graphData: function(IGraph, TValue):void, deserializationCallback?: function(Object, HandleDeserializationEventArgs):void, uri?: string)Register graphData
as an input data target for GraphML data that is present at the graph level.
Remarks
This method can optionally use a custom event handler for the actual deserialization.
This methods creates and configures the necessary handler itself.
Type Parameters
- TValue
- The type of the mapper values
Parameters
A map of options to pass to the method.
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
- graphData - function(IGraph, TValue):void
- Delegate that stores the graph data dynamically
- deserializationCallback - function(Object, HandleDeserializationEventArgs):void
- custom deserialization callback.
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
- uri - string
- The optional URI of the key definition to disambiguate keys.
addGraphInputData
<TValue>(dataType: Class, keyDefinitionPredicate: function(Element):boolean, graphData: function(IGraph, TValue):void, deserializationCallback?: function(Object, HandleDeserializationEventArgs):void)Register graphData
as an input data target for GraphML data that is present at the graph level.
Remarks
This method can optionally use a custom event handler for the actual deserialization.
This methods creates and configures the necessary handler itself.
Type Parameters
- TValue
- The type of the mapper values
Parameters
A map of options to pass to the method.
- dataType - Class
- The type of the mapper values
- keyDefinitionPredicate - function(Element):boolean
- Predicate function to select the correct GraphML attribute
Signature Details
function(obj: Element) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - Element
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- graphData - function(IGraph, TValue):void
- Delegate that stores the graph data dynamically
- deserializationCallback - function(Object, HandleDeserializationEventArgs):void
- custom deserialization callback.
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
addGraphOutputData
<TValue>(dataType: Class, name: string, graphData: TValue, serializationCallback?: function(Object, HandleSerializationEventArgs):void, declaredKeyType?: KeyType, uri?: string)Register graphData
as an output data source for data that is written at the graph level.
Remarks
This method can optionally use a custom event handler for the actual serialization.
This methods creates and configures the necessary handler itself.
Type Parameters
- TValue
- The type of the mapper values
Parameters
A map of options to pass to the method.
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
- graphData - TValue
- the data that is written at the top level
- serializationCallback - function(Object, HandleSerializationEventArgs):void
- custom serialization callback.
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
- declaredKeyType - KeyType
- The key type to write in the declaration. If this is omitted or
null
, the type is inferred automatically fromTValue
- uri - string
- The optional URI to add to the key definition to disambiguate keys.
addGraphOutputData
<TValue>(dataType: Class, name: string, graphData: function(IGraph):TValue, serializationCallback?: function(Object, HandleSerializationEventArgs):void, declaredKeyType?: KeyType, uri?: string)Register graphData
as an output data source for data that is written at the graph level.
Remarks
This method can optionally use a custom event handler for the actual serialization.
This methods creates and configures the necessary handler itself.
Type Parameters
- TValue
- The type of the mapper values
Parameters
A map of options to pass to the method.
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
- graphData - function(IGraph):TValue
- Delegate that retrieves the graph data dynamically
Signature Details
function(arg: IGraph) : TValue
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - IGraph
- The parameter of the method that this delegate encapsulates.
Returns
- TValue
- The return value of the method that this delegate encapsulates.
- serializationCallback - function(Object, HandleSerializationEventArgs):void
- custom serialization callback.
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
- declaredKeyType - KeyType
- The key type to write in the declaration. If this is omitted or
null
, the type is inferred automatically fromTValue
- uri - string
- The optional URI to add to the key definition to disambiguate keys.
addInputHandlerFactory
(keyDefinitionPredicate: function(Element):boolean, factory: IGenericInputHandlerFactory) : Future<IInputHandler>Create a Future<T> instance that wraps an IInputHandler that is dynamically created by factory
.
Remarks
keyDefinitionPredicate
. This methods creates and configures the necessary handler itself.Parameters
A map of options to pass to the method.
- keyDefinitionPredicate - function(Element):boolean
- The predicate that matches the key definition.
Signature Details
function(obj: Element) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - Element
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- factory - IGenericInputHandlerFactory
- A factory to create IInputHandler instances.
Returns
- ↪Future<IInputHandler>
- A Future<T> instance that wraps an IInputHandler that actually parses the data.
addInputMapper
<TKey,TData>(keyType: Class, dataType: Class, name: string, mapper: IMapper<TKey,TData>)Register a IMapper<K,V> instance for use as an input data target.
Remarks
Type Parameters
- TKey
- The type of the mapper keys
- TData
- The type of the mapper values
Parameters
A map of options to pass to the method.
- keyType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
- mapper - IMapper<TKey,TData>
- the mapper that serves as data source
See Also
addInputMapper
<TKey,TData>(keyType: Class, dataType: Class, keyDefinitionPredicate: function(Element):boolean, mapper: IMapper<TKey,TData>, deserializationCallback: function(Object, HandleDeserializationEventArgs):void)Register a IMapper<K,V> instance for use as an input data target.
Remarks
This method uses a custom event handler for the actual deserialization.
This methods creates and configures the necessary handler itself.
Type Parameters
- TKey
- The type of the mapper keys
- TData
- The type of the mapper values
Parameters
A map of options to pass to the method.
- keyType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper values
- keyDefinitionPredicate - function(Element):boolean
- The predicate function that will determine whether to create an IInputHandler for the given key definition.
Signature Details
function(obj: Element) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - Element
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- mapper - IMapper<TKey,TData>
- the mapper that serves as data source
- deserializationCallback - function(Object, HandleDeserializationEventArgs):void
- custom deserialization callback.
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
addInputMapperFuture
<TKey,TData>(keyType: Class, dataType: Class, name: string) : Future<IMapper<TKey,TData>>Create a Future<T> instance that wraps an IMapper<K,V> for use as an input data target.
Remarks
Type Parameters
- TKey
- The type of the mapper keys
- TData
- The type of the mapper values
Parameters
A map of options to pass to the method.
- keyType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
Returns
- ↪Future<IMapper<TKey,TData>>
- A Future<T> instance that wraps an IMapper<K,V> that actually holds the data.
addInputMapperFuture
<TKey,TData>(keyType: Class, dataType: Class, keyDefinitionPredicate: function(Element):boolean, deserializationCallback: function(Object, HandleDeserializationEventArgs):void) : Future<IMapper<TKey,TData>>Create a Future<T> instance that wraps an IMapper<K,V> for use as an input data target.
Remarks
Type Parameters
- TKey
- The type of the mapper keys
- TData
- The type of the mapper values
Parameters
A map of options to pass to the method.
- keyType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper values
- keyDefinitionPredicate - function(Element):boolean
- The predicate function that will determine whether to create an IInputHandler for the given key definition.
Signature Details
function(obj: Element) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - Element
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- deserializationCallback - function(Object, HandleDeserializationEventArgs):void
- custom deserialization callback.
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
Returns
- ↪Future<IMapper<TKey,TData>>
- A Future<T> instance that wraps an IMapper<K,V> that actually holds the data.
Adds a namespace to the header of a GraphML file.
Parameters
A map of options to pass to the method.
- namespaceURI - string
- The namespace URI
- shortName - string
- The namespace prefix
Throws
- Exception({ name: 'ArgumentError' })
- If
namespaceURI
isnull
.
addOutputMapper
<TModelItem,TValue>(modelItemType: Class, dataType: Class, name: string, mapper: IMapper<TModelItem,TValue>)Register a IMapper<K,V> instance for use as an output data source
Remarks
Type Parameters
- TModelItem
- The type of the mapper keys
- TValue
- The type of the mapper values
Parameters
A map of options to pass to the method.
- modelItemType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
- mapper - IMapper<TModelItem,TValue>
- the mapper that serves as data source
See Also
addOutputMapper
<TModelItem,TValue>(modelItemType: Class, dataType: Class, name: string, uri: string, mapper: IMapper<TModelItem,TValue>, serializationCallback: function(Object, HandleSerializationEventArgs):void, declaredKeyType: KeyType)Register a IMapper<K,V> instance for use as an output data source.
Remarks
This method uses a custom event handler for the actual serialization.
This methods creates and configures the necessary handler itself.
Type Parameters
- TModelItem
- The type of the mapper keys
- TValue
- The type of the mapper values
Parameters
A map of options to pass to the method.
- modelItemType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper values
- name - string
- The name of the attribute
- uri - string
- The URI to add to the key definition to disambiguate keys.
- mapper - IMapper<TModelItem,TValue>
- the mapper that serves as data source
- serializationCallback - function(Object, HandleSerializationEventArgs):void
- custom serialization callback.
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
- declaredKeyType - KeyType
- The key type to write in the declaration.
addRegistryInputMapper
<TKey,TData>(keyType: Class, dataType: Class, name: string) : Future<IMapper<TKey,TData>>Create a Future<T> instance that wraps an IInputHandler that stores the data in an IMapper<K,V> that will be created in the graph's IMapperRegistry.
Remarks
name
. This methods creates and configures the necessary handler itself and creates an IMapper<K,V> in the IMapperRegistry with name name
.Type Parameters
- TKey
- TData
Parameters
A map of options to pass to the method.
- keyType - Class
- dataType - Class
- name - string
- The name of the GraphML attribute and the key in the IMapperRegistry.
Returns
- ↪Future<IMapper<TKey,TData>>
- A Future<T> instance that wraps an IMapper<K,V> that actually holds the data.
addRegistryInputMapper
<TKey,TData>(keyType: Class, dataType: Class, tag: Object, keyDefinitionPredicate: function(Element):boolean, deserializationCallback: function(Object, HandleDeserializationEventArgs):void) : Future<IMapper<TKey,TData>>Create a Future<T> instance that wraps an IInputHandler that stores the data in an IMapper<K,V> that will be created in the graph's IMapperRegistry.
Remarks
tag
.Type Parameters
- TKey
- TData
Parameters
A map of options to pass to the method.
- keyType - Class
- dataType - Class
- tag - Object
- The name of the key in the IMapperRegistry.
- keyDefinitionPredicate - function(Element):boolean
- A predicate to determine whether the key definition is valid.
Signature Details
function(obj: Element) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - Element
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- deserializationCallback - function(Object, HandleDeserializationEventArgs):void
- The custom deserialization callback, can be
null
which will result in default deserialization.Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
Returns
- ↪Future<IMapper<TKey,TData>>
- A Future<T> instance that wraps an IMapper<K,V> that actually holds the data.
Use a registered IMapper<K,V> instance as source for the given GraphML attribute.
Remarks
Parameters
A map of options to pass to the method.
- name - string
- The GraphML name of the attribute
- tag - Object
- The tag name of the mapper in the IMapperRegistry
addRegistryOutputMapper
(name: string, uri: string, tag: Object, serializationCallback: function(Object, HandleSerializationEventArgs):void)Use a registered IMapper<K,V> instance as source for the given GraphML attribute.
Remarks
Parameters
A map of options to pass to the method.
- name - string
- The GraphML name of the attribute
- uri - string
- The optional URI of the attribute
- tag - Object
- The tag name of the mapper in the IMapperRegistry
- serializationCallback - function(Object, HandleSerializationEventArgs):void
- An optional serialization handler
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
addRegistryOutputMapper
<TModelItem,TValue>(modelItemType: Class, valueType: Class, name: string, tag: Object)Use a registered IMapper<K,V> instance as source for the given GraphML attribute.
Type Parameters
- TModelItem
- TValue
Parameters
A map of options to pass to the method.
- modelItemType - Class
- valueType - Class
- name - string
- The GraphML name of the attribute
- tag - Object
- The tag name of the mapper in the IMapperRegistry
addRegistryOutputMapper
<TModelItem,TValue>(modelItemType: Class, valueType: Class, name: string, uri: string, tag: Object, serializationCallback: function(Object, HandleSerializationEventArgs):void, declaredKeyType: KeyType)Use a registered IMapper<K,V> instance as source for the given GraphML attribute.
Type Parameters
- TModelItem
- TValue
Parameters
A map of options to pass to the method.
- modelItemType - Class
- valueType - Class
- name - string
- The GraphML name of the attribute
- uri - string
- The URI to add to the key definition to disambiguate keys.
- tag - Object
- The tag name of the mapper in the IMapperRegistry
- serializationCallback - function(Object, HandleSerializationEventArgs):void
- custom serialization callback.
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
- declaredKeyType - KeyType
- The key type to write in the declaration.
Adds a schema location to the header of a GraphML file.
Parameters
A map of options to pass to the method.
- schemaNamespace - string
- The namespace URI for this schema location
- schemaLocation - string
- The schema location
Throws
- Exception({ name: 'ArgumentError' })
- If
schemaNamespace
isnull
.
Add a namespace mapping between a fully qualified XML name (consisting of xmlNamespace
and tagName
) and a type.
Remarks
Either of xmlNamespace
or tagName
may be null
, meaning that the default rules for determining the namespace and/or tag name of type
are used.
This is used both for writing and parsing objects.
Parameters
A map of options to pass to the method.
- xmlNamespace - string
- The XML namespace that corresponds to
type
. Ifnull
, the namespace will be determined based on the JavaScript module that containstype
- tagName - string
- The XML tag name that corresponds to
type
. Ifnull
, the name will be determined from the type name automatically. - type - Class
- The type that is mapped to the fully qualified XML name.
See Also
Add a namespace mapping between an XML namespace and a JavaScript module
.
Remarks
The module is an object where the keys are XML tag names and the values are the types to be mapped.
This is used both for writing and parsing objects.
Parameters
A map of options to pass to the method.
- xmlNamespace - string
- The XML namespace that corresponds to
module
. - module - Object
- The module that is mapped to the XML namespace. The keys are the names of the XML tags. The values are the types.
See Also
Configure the predefined handlers for the HandleDeserialization event.
Remarks
Except for text content and primitive types, this implementation delegates all work to handleXamlDeserialization
This method is called for each parse process.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that will be parsed.
- parser - GraphMLParser
- The parser to configure.
See Also
Configures the deserialization property overrides for the given parser.
Remarks
Parameters
A map of options to pass to the method.
- parser - GraphMLParser
- The parser to set the deserialization properties.
Configures a given instance of GraphMLParser that can handle the given graph.
Remarks
Parameters
A map of options to pass to the method.
- parser - GraphMLParser
- The parser to configure
- graph - IGraph
- The graph that should be filled by the parser
Configures a given GraphMLWriter that is used for writing graph
.
Remarks
Parameters
A map of options to pass to the method.
- writer - GraphMLWriter
- The writer to configure
- graph - IGraph
- The graph that will be written.
Configures default event handlers for the QueryInputHandlers event.
Remarks
This implementation configures several input handlers for the standard yFiles for HTML GraphML attributes (styles, folding state, labels, geometry).
This method is called for each parse process.
Parameters
A map of options to pass to the method.
- parser - GraphMLParser
- The parser that should be configured.
Configures writer
to use the namespace declarations set with addNamespace.
Remarks
In addition to the namespace declarations provided with addNamespace, the default GraphMLWriter implementation also automatically places all namespace declarations that have occurred
This method is called for each write process.
Parameters
A map of options to pass to the method.
- writer - GraphMLWriter
- The writer to configure.
Configures default event handlers for the QueryOutputHandlers event.
Remarks
This implementation configures several output handlers for the standard yFiles GraphML attributes (styles, folding state, labels, geometry).
This method is called for each write process.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that will be written.
- writer - GraphMLWriter
- The writer that should be configured.
Configures the lookup of the given parser.
Remarks
Parameters
A map of options to pass to the method.
- parser - GraphMLParser
- The parser to configure.
Configures writer
to use the schema locations set with addSchemaLocation.
Remarks
Parameters
A map of options to pass to the method.
- writer - GraphMLWriter
- The writer to configure.
Configures the predefined handlers for the HandleSerialization event.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that will be written.
- writer - GraphMLWriter
- The writer to configure.
Configure important serialization properties from properties of GraphMLIOHandler.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph to write.
- writer - GraphMLWriter
- The writer to configure.
See Also
Configures the serialization property overrides for the given writer.
Remarks
Parameters
A map of options to pass to the method.
- writer - GraphMLWriter
- The writer to set the serialization properties.
Configure the lookup map of writer
.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that will be written.
- writer - GraphMLWriter
- The writer to configure.
See Also
Configure writer
.
Remarks
This method is called for each write process.
This implementation does nothing.
Parameters
A map of options to pass to the method.
- writer - IXmlWriter
- The writer to configure.
Creates the default value serializer context and returns it.
Remarks
Returns
- ↪IValueSerializerContext
- An implementation of the IValueSerializerContext interface.
Create an IGraphElementFactory instance that creates the graph elements for the graph
instance.
Remarks
Parameters
A map of options to pass to the method.
- parser - GraphMLParser
- The parser to use.
- graph - IGraph
- The graph that is populated.
Returns
- ↪IGraphElementFactory
- An IGraphElementFactory instance that is configured for the given parameters.
Create a suitable instance of GraphMLParser that can handle the given graph.
Remarks
This method is called for each parse process.
It delegates the configuration of the parser to configureGraphMLParser.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that should be filled by this instance
Returns
- ↪GraphMLParser
- a suitable instance of GraphMLParser that can handle the given graph
Create and configure a new GraphMLWriter that is used for writing graph
.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that will be written.
Returns
- ↪GraphMLWriter
- A new GraphMLWriter instance that is configured for
graph
.
createMapper
<TKey,TData>(keyType: Class, dataType: Class, context: IParseContext, registryTag: Object) : IMapper<TKey,TData>Called by addRegistryInputMapper and its overloads to creates the mapper instance.
Remarks
registryTag
but wrong types, it will be replaced.Type Parameters
- TKey
- The type of the keys.
- TData
- The type of the data.
Parameters
A map of options to pass to the method.
- keyType - Class
- The type of the keys.
- dataType - Class
- The type of the data.
- context - IParseContext
- registryTag - Object
- The tag for the mapper in the registry.
Returns
- ↪IMapper<TKey,TData>
- The mapper instance to use.
Configure mappings from CLR to XML names.
Remarks
Configure mappings from XML namespaces to prefixes.
Remarks
Factory method that creates and configures a suitable IXmlWriter implementation.
Remarks
Returns
- ↪IXmlWriter
- A suitable IXmlWriter instance for the serialization
See Also
Handle the serialization of arrays.
Remarks
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization for enums.
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handler for the HandleDeserialization event.
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleDeserializationEventArgs
- The event handler arguments.
Handle the serialization of plain JavaScript object that can be serialized to JSON.
Remarks
true
iff item can be converted to JSON data. This serializer is only called from element property syntax and is registered by default.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of IEnumerable<T> instances.
Remarks
true
iff item is an IEnumerable<T> instance. This handler is registered by default.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of MarkupExtension convertible instances.
Remarks
true
iff item can be converted to a MarkupExtension instance. This handler is registered by default.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of null
references.
Remarks
true
iff item is a null
reference. This handler is registered by default and is only used to write null
references in XML element syntax.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of primitive types, enums and strings.
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleDeserializationEventArgs
- The event handler arguments.
Handle the serialization of primitive types, enums and strings.
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of IReferenceHandle instances.
Remarks
true
iff item is a IReferenceHandle instance. This handler is registered by default and should not be removed if writeSharedReferences is enabled.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of instances that can be serialized through a ValueSerializer.
Remarks
true
iff item can be converted to a string with a ValueSerializer. This serializer is only called from element property syntax and is registered by default.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handler for the HandleDeserialization event.
Parameters
A map of options to pass to the method.
- source - Object
- The source of the event.
- evt - HandleDeserializationEventArgs
- The event arguments.
See Also
Handle the serialization of TypeExtensions.
Remarks
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of Types.
Remarks
Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handle the serialization of undefined
references.
Remarks
true
iff item is an undefined
reference. This handler is registered by default and is only used to write undefined
references in XML element syntax.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Handler for the HandleDeserialization event.
Parameters
A map of options to pass to the method.
- source - Object
- The source of the event.
- evt - HandleDeserializationEventArgs
- The event arguments.
See Also
Handle the serialization of complex objects that are not handled by other callbacks.
Remarks
true
iff item is not a null
reference. This handler is registered by default and uses XamlSerializer to create XAML output.Parameters
A map of options to pass to the method.
- sender - Object
- The origin of the event.
- evt - HandleSerializationEventArgs
- The event handler arguments.
Event handler for the HandleDeserialization event.
Remarks
Event handler for the QueryInputHandlers event.
Remarks
Event handler for the HandleSerialization event.
Remarks
Event handler for the QueryOutputHandlers event.
Remarks
Raises the HandleDeserialization event.
Parameters
A map of options to pass to the method.
- evt - HandleDeserializationEventArgs
- The arguments for the HandleDeserialization event.
Raises the HandleSerialization event.
Parameters
A map of options to pass to the method.
- evt - HandleSerializationEventArgs
- The arguments for the HandleSerialization event.
Fires the OverrideResolveReference event.
Parameters
A map of options to pass to the method.
- evt - ResolveReferenceEventArgs
- The arguments that get passed to the OverrideResolveReference event.
Raises the Parsed event.
Remarks
Parameters
A map of options to pass to the method.
- evt - ParseEventArgs
- The ParseEventArgs instance containing the event data.
See Also
Raises the Parsing event.
Remarks
Parameters
A map of options to pass to the method.
- evt - ParseEventArgs
- The ParseEventArgs instance containing the event data.
See Also
Raises the QueryInputHandlers event.
Parameters
A map of options to pass to the method.
- evt - QueryInputHandlersEventArgs
- The arguments for the QueryInputHandlers event.
Raises the QueryOutputHandlers event.
Parameters
A map of options to pass to the method.
- evt - QueryOutputHandlersEventArgs
- The arguments for the QueryOutputHandlers event.
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.
Throws
- Exception({ name: 'ArgumentError' })
args
is null.
See Also
Fires the ResolveReference event.
Parameters
A map of options to pass to the method.
- evt - ResolveReferenceEventArgs
- The arguments that get passed to the ResolveReference event.
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
Read GraphML from an existing XML document.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that is to be populated with nodes and edges as read from the document.
- document - Document
- The XML document. Note: If you are using Internet Explorer 9 and XMLHttpRequests to retrieve the document, you may not use the value from the XMLHttpRequest.responseXML property. Please parse XMLHttpRequest.responseText instead and use the result. For further reference see https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/hh180177(v=vs.85).
Throws
- Exception({ name: 'ArgumentError' })
document
is null.- Exception({ name: 'ArgumentError' })
graph
is null.
See Also
Convenience method that imports the graph
from an XML data provided in a string data
.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The Graph object that is to be populated with nodes and edges as read from the GraphML data.
- data - string
- A string that contains GraphML data.
See Also
Reads GraphML content from the given url
and populates the graph
.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that is to be populated with nodes and edges as read from the URL.
- url - string
- The URL of the file to be read.
Throws
See Also
Predefined input handler that reads edge bends.
Remarks
Predefined output handler that writes edge bends.
Remarks
Predefined input handler that reads edge labels.
Remarks
Predefined output handler that writes edge labels.
Remarks
Predefined input handler that reads edge styles.
Remarks
Predefined output handler that writes edge styles.
Remarks
Predefined input handler that reads IGraph graph default settings.
Remarks
Predefined output handler that writes the settings of a graph.
Predefined input handler that reads node labels.
Remarks
Predefined output handler that writes node labels.
Remarks
Predefined input handler that reads node layouts.
Remarks
Predefined output handler that writes node layouts.
Remarks
Predefined input handler that reads node styles.
Remarks
Predefined output handler that writes node styles.
Remarks
Predefined input handler that reads port labels.
Remarks
Predefined output handler that writes port labels.
Remarks
Predefined input handler that reads port locations.
Remarks
Predefined output handler that writes port locations.
Remarks
Predefined input handler that reads port styles.
Remarks
Predefined output handler that writes port styles.
Remarks
Predefined input handler that reads ITagOwner tags.
Remarks
Predefined output handler that writes ITagOwner tags.
Remarks
Events
Occurs when XML content is about to be deserialized.
Remarks
Subscribe to this event to provide custom deserialization 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 XML content is provided by xmlNode. If you want to return deserialized content, set the value of the result property.
See Also
Event Registration
addHandleDeserializationListener(function(this, HandleDeserializationEventArgs):void)
Event Deregistration
removeHandleDeserializationListener(function(this, HandleDeserializationEventArgs):void)
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
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 before inline references are evaluated.
Remarks
See Also
Event Registration
addOverrideResolveReferenceListener(function(this, ResolveReferenceEventArgs):void)
Event Deregistration
removeOverrideResolveReferenceListener(function(this, ResolveReferenceEventArgs):void)
Signature Details
function(sender: this, evt: ResolveReferenceEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - ResolveReferenceEventArgs
- An object that contains the event data.
Occurs when the document has been parsed.
See Also
Event Registration
addParsedListener(function(this, ParseEventArgs):void)
Event Deregistration
removeParsedListener(function(this, ParseEventArgs):void)
Signature Details
function(sender: this, evt: ParseEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - ParseEventArgs
- An object that contains the event data.
Occurs when the parsing of a document is just about to begin.
Remarks
See Also
Event Registration
addParsingListener(function(this, ParseEventArgs):void)
Event Deregistration
removeParsingListener(function(this, ParseEventArgs):void)
Signature Details
function(sender: this, evt: ParseEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - ParseEventArgs
- An object that contains the event data.
Occurs when a GraphML attribute is about to be read.
Remarks
Subscribe to this event to dynamically register one or more IInputHandler instance(s) for a given GraphML attribute key definition.
The current key definition is provided by keyDefinition. If you want to register an IInputHandler for this GraphML attribute, you can add the handler with addInputHandler method. Implementations should also consider the handled property.
See Also
Event Registration
addQueryInputHandlersListener(function(this, QueryInputHandlersEventArgs):void)
Event Deregistration
removeQueryInputHandlersListener(function(this, QueryInputHandlersEventArgs):void)
Signature Details
function(sender: this, evt: QueryInputHandlersEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryInputHandlersEventArgs
- An object that contains the event data.
Occurs when a name is queried.
Remarks
This event can be used to override name mappings to XML names in XAML.
If the event handler determines that it map resolve type to a xml name, it should place the result into the result property and thus mark the event as handled.
It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name determination rules are used for that part.
Event Registration
addQueryNameListener(function(this, QueryNameEventArgs):void)
Event Deregistration
removeQueryNameListener(function(this, QueryNameEventArgs):void)
Signature Details
function(sender: this, evt: QueryNameEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryNameEventArgs
- An object that contains the event data.
Occurs when a GraphML attribute is about to be written.
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 or internal references for objects.
The reference targets are not serialized to the GraphML file if they are set to EXTERNAL. To resolve these references when parsing, you typically have to subscribe to the ResolveReference event.
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 a type is queried.
Remarks
See Also
Event Registration
addQueryTypeListener(function(this, QueryTypeEventArgs):void)
Event Deregistration
removeQueryTypeListener(function(this, QueryTypeEventArgs):void)
Signature Details
function(sender: this, evt: QueryTypeEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryTypeEventArgs
- An object that contains the event data.
Occurs after references are evaluated.
Remarks
See Also
Event Registration
addResolveReferenceListener(function(this, ResolveReferenceEventArgs):void)
Event Deregistration
removeResolveReferenceListener(function(this, ResolveReferenceEventArgs):void)
Signature Details
function(sender: this, evt: ResolveReferenceEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - ResolveReferenceEventArgs
- 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 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.
Static Methods
createMapperInputHandler
<TKey,TData>(modelItemType: Class, dataType: Class, mapper: IMapper<TKey,TData>, deserializationCallback: function(Object, HandleDeserializationEventArgs):void) : MapperInputHandler<TKey,TData>Creates an IInputHandler implementations that matches the provided TKey
and TData
.
Remarks
TKey
and TData
.Type Parameters
- TKey
- The type of the mapper keys
- TData
- The type of the mapper entries
Parameters
A map of options to pass to the method.
- modelItemType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper entries
- mapper - IMapper<TKey,TData>
- The mapper to use.
- deserializationCallback - function(Object, HandleDeserializationEventArgs):void
- Optional deserialization callback for complex data.
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
Returns
- ↪MapperInputHandler<TKey,TData>
- A suitable MapperInputHandler<TKey,TData> implementation
createMapperOutputHandler
<TKey,TData>(modelItemType: Class, dataType: Class, name: string, mapper: IMapper<TKey,TData>, serializationCallback: function(Object, HandleSerializationEventArgs):void) : MapperOutputHandler<TKey,TData>Creates an IOutputHandler implementation that matches the provided TKey
and TData
.
Remarks
TKey
and TData
.Type Parameters
- TKey
- The type of the mapper keys
- TData
- The type of the mapper entries
Parameters
A map of options to pass to the method.
- modelItemType - Class
- The type of the mapper keys
- dataType - Class
- The type of the mapper entries
- name - string
- The name of the graphml attribute
- mapper - IMapper<TKey,TData>
- The mapper to use.
- serializationCallback - function(Object, HandleSerializationEventArgs):void
- Optional serialization callback for complex data.
Signature Details
function(sender: this, evt: HandleSerializationEventArgs)
Represents the method that will handle an event when the event provides data.Parameters
- sender - this
- The source of the event.
- evt - HandleSerializationEventArgs
- An object that contains the event data.
Returns
- ↪MapperOutputHandler<TKey,TData>
- A suitable MapperOutputHandler<TKey,TData> implementation
Checks whether the name
attribute in definition
matches name
Parameters
A map of options to pass to the method.
- definition - Element
- The key definition to check
- name - string
- The name that should be matched
Returns
- ↪boolean
true
if the name attribute indefinition
matchesname
Checks whether the scope
attribute in definition
matches scope
Parameters
A map of options to pass to the method.
- definition - Element
- The key definition to check
- scope - KeyScope
- The scope that should be matched
Returns
- ↪boolean
true
if the scope attribute indefinition
matchesscope
Checks whether the type
attribute in definition
matches type
Parameters
A map of options to pass to the method.
- definition - Element
- The key definition to check
- type - KeyType
- The type that should be matched
Returns
- ↪boolean
true
if the type attribute indefinition
matchestype
Checks whether the uri
attribute in definition
matches uri
Parameters
A map of options to pass to the method.
- definition - Element
- The key definition to check
- uri - string
- The uri that should be matched
Returns
- ↪boolean
true
if the uri attribute indefinition
matchesuri