Skip to content

Doc

Doc

Extends

Constructors

new Doc()

new Doc(): Doc

Returns

Doc

Overrides

Obj.constructor

Source

shapes.ts:1152

Properties

children

children: Obj[]

Inherited from

Obj.children

Source

core/obj.ts:14


id

id: string

Inherited from

Obj.id

Source

core/obj.ts:11


parent

parent: null | Obj

Inherited from

Obj.parent

Source

core/obj.ts:13


type

type: string

Inherited from

Obj.type

Source

core/obj.ts:12


version

version: number

Source

shapes.ts:1150

Methods

find()

find(pred): null | Obj

Find an shape in breath-first order

Parameters

pred

Returns

null | Obj

Inherited from

Obj.find

Source

core/obj.ts:147


findDepthFirst()

findDepthFirst(pred): null | Obj

Find an shape in depth-first order

Parameters

pred

Returns

null | Obj

Inherited from

Obj.findDepthFirst

Source

core/obj.ts:160


findParent()

findParent(pred): null | Obj

Find a shape along with the parent-chain

Parameters

pred

Returns

null | Obj

Inherited from

Obj.findParent

Source

core/obj.ts:173


fromJSON()

fromJSON(json): void

Parameters

json: any

Returns

void

Overrides

Obj.fromJSON

Source

shapes.ts:1168


getJson()

getJson(json, field, defaultValue): any

Get a field from the JSON object, return defaultValue if the field is not defined.

Parameters

json: any

field: string

defaultValue: any

Returns

any

Inherited from

Obj.getJson

Source

core/obj.ts:53


isDescendant()

isDescendant(obj): boolean

Test whether the given shape is a descendant

Parameters

obj: Obj

Returns

boolean

Inherited from

Obj.isDescendant

Source

core/obj.ts:183


resolveRefs()

resolveRefs(idMap, nullIfNotFound): void

Resolve references

Parameters

idMap: Record<string, Obj>

id to object map

nullIfNotFound: boolean= false

assign null if not found

Returns

void

Inherited from

Obj.resolveRefs

Source

core/obj.ts:88


setJson()

setJson(json, field, value, defaultValue, enforce): void

Set a field in the JSON object only if the value is defined and not equal to the default value.

Parameters

json: any

The JSON object to set the field in.

field: string

The field name to set.

value: any

The value to set.

defaultValue: any

The default value to compare against.

enforce: boolean= false

If true, the field will be set even if it is equal to the default value.

Returns

void

Inherited from

Obj.setJson

Source

core/obj.ts:31


toJSON()

toJSON(recursive, keepRefs, enforce): any

Parameters

recursive: boolean= false

keepRefs: boolean= false

enforce: boolean= false

Returns

any

Overrides

Obj.toJSON

Source

shapes.ts:1158


traverse()

traverse(fun, parent): void

Traverse all objects in breath-first order

Parameters

fun

parent: null | Obj= null

Returns

void

Inherited from

Obj.traverse

Source

core/obj.ts:101


traverseDepthFirst()

traverseDepthFirst(fun, parent): void

Traverse all shapes in depth-first order

Parameters

fun

parent: null | Obj= null

Returns

void

Inherited from

Obj.traverseDepthFirst

Source

core/obj.ts:115


traverseDepthFirstSequence()

traverseDepthFirstSequence(): Obj[]

Returns an array of shapes in order of traverse sequence.

Returns

Obj[]

Inherited from

Obj.traverseDepthFirstSequence

Source

core/obj.ts:138


traverseSequence()

traverseSequence(): Obj[]

Returns an array of shapes in order of traverse sequence.

Returns

Obj[]

Inherited from

Obj.traverseSequence

Source

core/obj.ts:129