Skip to content

Doc

Doc

Extends

Constructors

new Doc()

new Doc(): Doc

Returns

Doc

Overrides

Obj.constructor

Source

shapes.ts:1111

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:1109

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:106


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:119


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:132


fromJSON()

fromJSON(json): void

Parameters

json: any

Returns

void

Overrides

Obj.fromJSON

Source

shapes.ts:1123


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:142


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:47


toJSON()

toJSON(recursive, keepRefs): any

Parameters

recursive: boolean= false

keepRefs: boolean= false

Returns

any

Overrides

Obj.toJSON

Source

shapes.ts:1117


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:60


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:74


traverseDepthFirstSequence()

traverseDepthFirstSequence(): Obj[]

Returns an array of shapes in order of traverse sequence.

Returns

Obj[]

Inherited from

Obj.traverseDepthFirstSequence

Source

core/obj.ts:97


traverseSequence()

traverseSequence(): Obj[]

Returns an array of shapes in order of traverse sequence.

Returns

Obj[]

Inherited from

Obj.traverseSequence

Source

core/obj.ts:88