File

src/app/core/models/flat-node.ts

Description

Node type used by ontology tree component.

Index

Properties
Methods
Accessors

Constructor

constructor(original: OntologyTreeNode, level: number)

Creates an instance of flat node.

Parameters :
Name Type Optional Description
original OntologyTreeNode No

The original ontology node object.

level number No

The level of the new flat node in the tree.

Properties

Optional numResults
Type : number
Optional opacity
Type : number
Default value : 20
Optional visible
Type : boolean
Default value : true

Methods

Static create
create(original: OntologyTreeNode, level: number)

Creates a flat node from a ontology node object and a level in the tree.

Parameters :
Name Type Optional Description
original OntologyTreeNode No

The original ontology node object.

level number No

The level of the new flat node in the tree.

Returns : FlatNode

The newly created flat node.

Accessors

label
getlabel()

Gets this node's label.

Returns : string
expandable
getexpandable()

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,
  ) {}
}

results matching ""

    No results matching ""