src/app/core/models/flat-node.ts
Node type used by ontology tree component.
Properties |
|
Methods |
|
Accessors |
constructor(original: OntologyTreeNode, level: number)
|
||||||||||||
Defined in src/app/core/models/flat-node.ts:36
|
||||||||||||
Creates an instance of flat node.
Parameters :
|
Optional numResults |
Type : number
|
Defined in src/app/core/models/flat-node.ts:11
|
Optional opacity |
Type : number
|
Default value : 20
|
Defined in src/app/core/models/flat-node.ts:9
|
Optional visible |
Type : boolean
|
Default value : true
|
Defined in src/app/core/models/flat-node.ts:7
|
Static create | ||||||||||||
create(original: OntologyTreeNode, level: number)
|
||||||||||||
Defined in src/app/core/models/flat-node.ts:34
|
||||||||||||
Creates a flat node from a ontology node object and a level in the tree.
Parameters :
Returns :
FlatNode
The newly created flat node. |
label |
getlabel()
|
Defined in src/app/core/models/flat-node.ts:16
|
Gets this node's label.
Returns :
string
|
expandable |
getexpandable()
|
Defined in src/app/core/models/flat-node.ts:23
|
Indicates whether this node has children.
Returns :
boolean
|
import { OntologyTreeNode } from 'ccf-database';
/**
* Node type used by ontology tree component.
*/
export class FlatNode {
visible?: boolean = true;
opacity?: number = 20;
numResults?: number;
/**
* Gets this node's label.
*/
get label(): string {
return this.original.label;
}
/**
* Indicates whether this node has children.
*/
get expandable(): boolean {
return this.original.children.length > 0;
}
/**
* Creates a flat node from a ontology node object and a level in the tree.
*
* @param original The original ontology node object.
* @param level The level of the new flat node in the tree.
* @returns The newly created flat node.
*/
static create(original: OntologyTreeNode, level: number): FlatNode {
return new FlatNode(original, level);
}
/**
* Creates an instance of flat node.
*
* @param original The original ontology node object.
* @param level The level of the new flat node in the tree.
*/
constructor(
readonly original: OntologyTreeNode,
readonly level: number,
) {}
}