OncoTree
OncoTree is a visualisation tool for displaying the hierarchical structure of cancer types, displaying these relationships in tree format. This library comes with an OncoTree
object
to be used for displaying and interacting with the tree as well as utility methods to build default UI components that may be used to interact with the tree (the functionality exposed by
these UI components was created completely using the public APIs exposed by the OncoTree
object).
Installation
npm install oncotree
# or
yarn add oncotree
Usage
import OncoTree, { buildSearchBar, buildToolbar } from 'oncotree';
import treeData from 'tree-data.json';
const oncoTree = new OncoTree('tree-id', treeData);
buildSearchBar('search-bar-id', oncoTree, searchBarOptions);
buildToolbar('toolbar-id', oncoTree);
For further documentation, see oncotree.d.ts.
Development
Before you begin, make sure you have the following installed
- NPM
- node >=20.12.2
Since this is a library, this package simply exports functionality i.e. the code shipped in this package is not intended to be executed independently. However, index.html
provides a sandbox environment to use during development. To begin, simply run the following:
npm install && npm run dev
Note: This project uses eslint to find issues. While there is a GitHub action to make sure the code passes the linting process, it is recommended to install an extension that shows these errors in your editor to view these issues before making a commit.
Buildling & Releasing
-
Bump version number in package.json, and commit changes.
-
Run the following:
npm run build && npm publish --access public
Testing
npm run test