Home Reference Source
public class | source

Lyph

Extends:

ResourceVisualResourceShape → Lyph

Class that models lyphs

Static Method Summary

Static Public Methods
public static

clone(lyphs: *, sourceLyph: *, targetLyph: *): Lyph

Copy the properties and layer structure of the source lyph to the target lyph

public static

expandTemplate(lyphs: *, template: *)

Generate new layers for subtypes and replicate template properties

public static

fromJSON(json: *, modelClasses: {}, entitiesByID: undefined): *

Member Summary

Public Members
public get
public get
public get
public get

axis: Link: *

Get lyph axis

public get
public get

Get lyph visibility

public get

offset: *

public get

radialTypes: Array[2]: boolean[]

Get border types based on the lyph's topology

public get

size: {height: number, width: number}: *

Defines size of the conveying lyph based on the length of the link

Inherited Summary

From class Resource
public static get

Model: *

public static

fromJSON(json: Object, modelClasses: Object, entitiesByID: Map<string, Resource>): Resource

Creates a Resource object from its JSON specification

public

id: *

public

assignPathProperties(modelClasses: Object)

Assign properties to the objects specified with the help of JSON path expressions in the resource 'assign' statements

public

assignPathRelationships(modelClasses: Object, entitiesByID: Map<string, Resource>)

Create relationships defined with the help of JSON path expressions in the resource 'assign' statements

public

containsMaterial(materialID: *): * | void | T

Checks if the current resource carries a material.

public

Assign properties to resources specified with the help of JSON path expressions in the resource 'interpolate' statements

public

isSubtypeOf(supertypeID: *): boolean

Checks if the current resource is derived from The method makes more sense for lyphs, but it is useful to be able to test any resource, this simplifies filtering

public

replaceIDs(modelClasses: Object, entitiesByID: Map<string, Resource>)

Replace IDs with object references

public

Waiting list keeps objects that refer to unresolved model resources.

public

syncRelationship(key: string, spec: Object, modelClasses: Object)

Synchronize a relationship field of the resource with its counterpart (auto-fill a field that is involved into a bi-directional relationship based on its partial definition, i.e., A.child = B yields B.parent = A).

public

syncRelationships(modelClasses: Object, entitiesByID: Map<string, Resource>)

Synchronize all relationship properties of the resource

public

toJSON(depth: *, initDepth: *): *

Prepare a circular resource object to be serialized in JSON.

From class VisualResource
public get

Determines whether the resource should appear in the scheme based on its 'hidden' attribute and other resource dependencies

From class Shape
public static

fromJSON(json: Object, modelClasses: Object, entitiesByID: Map<string, Resource>): Shape

Create a Shape resource from its JSON specification together with resources to model shape borders.

Static Public Methods

public static clone(lyphs: *, sourceLyph: *, targetLyph: *): Lyph source

Copy the properties and layer structure of the source lyph to the target lyph

Params:

NameTypeAttributeDescription
lyphs *

a set of existing model/group lyphs

sourceLyph *

the lyph to clone

targetLyph *

the cloned lyph instance

Return:

Lyph

the target lyph

public static expandTemplate(lyphs: *, template: *) source

Generate new layers for subtypes and replicate template properties

Params:

NameTypeAttributeDescription
lyphs *

lyph set that contains target subtypes

template *

lyph template

public static fromJSON(json: *, modelClasses: {}, entitiesByID: undefined): * source

Create a Shape resource from its JSON specification together with resources to model shape borders.

Override:

Shape#fromJSON

Params:

NameTypeAttributeDescription
json *
modelClasses {}
  • optional
  • default: {}
entitiesByID undefined
  • optional
  • default: undefined

Return:

*

Public Members

public get allContainers: * source

public get avgLength: * source

public get avgThickness: * source

public get axis: Link: * source

Get lyph axis

Return:

Link

public get container: * source

public get isVisible: boolean: * source

Get lyph visibility

Override:

VisualResource#isVisible

Return:

boolean

public get offset: * source

public get radialTypes: Array[2]: boolean[] source

Get border types based on the lyph's topology

Return:

Array[2]

public get size: {height: number, width: number}: * source

Defines size of the conveying lyph based on the length of the link

Return:

{height: number, width: number}