Doc
Doc
Extends
Constructors
new Doc()
new Doc():
Doc
Returns
Overrides
Source
Properties
children
children:
Obj
[]
Inherited from
Source
id
id:
string
Inherited from
Source
parent
parent:
null
|Obj
Inherited from
Source
type
type:
string
Inherited from
Source
version
version:
number
Source
Methods
find()
find(
pred
):null
|Obj
Find an shape in breath-first order
Parameters
• pred
Returns
null
| Obj
Inherited from
Source
findDepthFirst()
findDepthFirst(
pred
):null
|Obj
Find an shape in depth-first order
Parameters
• pred
Returns
null
| Obj
Inherited from
Source
findParent()
findParent(
pred
):null
|Obj
Find a shape along with the parent-chain
Parameters
• pred
Returns
null
| Obj
Inherited from
Source
fromJSON()
fromJSON(
json
):void
Parameters
• json: any
Returns
void
Overrides
Source
isDescendant()
isDescendant(
obj
):boolean
Test whether the given shape is a descendant
Parameters
• obj: Obj
Returns
boolean
Inherited from
Source
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
Source
toJSON()
toJSON(
recursive
,keepRefs
):any
Parameters
• recursive: boolean
= false
• keepRefs: boolean
= false
Returns
any
Overrides
Source
traverse()
traverse(
fun
,parent
):void
Traverse all objects in breath-first order
Parameters
• fun
• parent: null
| Obj
= null
Returns
void
Inherited from
Source
traverseDepthFirst()
traverseDepthFirst(
fun
,parent
):void
Traverse all shapes in depth-first order
Parameters
• fun
• parent: null
| Obj
= null
Returns
void
Inherited from
Source
traverseDepthFirstSequence()
traverseDepthFirstSequence():
Obj
[]
Returns an array of shapes in order of traverse sequence.
Returns
Obj
[]
Inherited from
Obj
.traverseDepthFirstSequence
Source
traverseSequence()
traverseSequence():
Obj
[]
Returns an array of shapes in order of traverse sequence.
Returns
Obj
[]