The TaxonomyViewer class is responsible for visualizing a taxonomy using the It uses vis-network library vis.js. It initializes and manages two taxonomy visualizations: one for the entire taxonomy and one for a detailed view of a subtree.

Constructors

Methods

  • Focus on a node. The node is selected using its id or its label

    Parameters

    • nodeId: string | number

      Id (or the label) of the node to focus on

    Returns void

  • Resets the taxonomy viewer and display an empty taxonomy, if the taxonomy viewer was previously initialized.

    Parameters

    • data: null | Data = null

      The data needed to visualize the empty taxonomy or null, if the data was previously uploaded

    Returns void

  • Updates the subtree visualization of two cases identified by their taxonomy labels. Case ids are also employed to show them on hover The node root of the subtree will be the lowest common ancestor (LCA) of these nodes.

    Parameters

    • leftCaseLabel: string

      The taxonomy label of the left item.

    • leftCaseId: string

      The identifier of the left item.

    • rightCaseLabel: string

      The taxonomy label of the right item.

    • rightCaseId: string

      The identifier of the right item.

    • similarityValue: null | number

    Returns void