@oncokb/oncotree
Advanced tools
Comparing version 0.8.6 to 0.9.6
import * as d3_2 from "d3"; | ||
/** | ||
* Builds an OncoTree collapse tree item | ||
* @param itemId The DOM node that will be the parent of the collapse item | ||
* @param tree - An OncoTree instance associated with the collapse item | ||
*/ | ||
export declare function buildCollapseItem( | ||
itemId: string, | ||
tree: OncoTree, | ||
): Promise<void>; | ||
/** | ||
* Builds an OncoTree expand tree item | ||
* @param itemId The DOM node that will be the parent of the expand item | ||
* @param tree - An OncoTree instance associated with the expand item | ||
*/ | ||
export declare function buildExpandItem( | ||
itemId: string, | ||
tree: OncoTree, | ||
): Promise<void>; | ||
/** | ||
* Builds an OncoTree search bar | ||
@@ -5,0 +25,0 @@ * @param searchBarId The DOM node that will be the parent of the search bar |
@@ -1075,2 +1075,38 @@ import "./index.css"; | ||
} | ||
async function buildExpandItem(itemId, tree) { | ||
const item = getElementByIdOrThrow(itemId); | ||
const toolbarItem = document.createElement("div"); | ||
toolbarItem.className = "oncotree-toolbar-item inactive"; | ||
toolbarItem.id = getToolbarItemId( | ||
"expand", | ||
/* EXPAND */ | ||
); | ||
toolbarItem.innerHTML = | ||
TOOLBAR_ACTION_SVG[ | ||
"expand" | ||
/* EXPAND */ | ||
]; | ||
toolbarItem.onclick = () => { | ||
onExpandClick(tree); | ||
}; | ||
item.appendChild(toolbarItem); | ||
} | ||
async function buildCollapseItem(itemId, tree) { | ||
const item = getElementByIdOrThrow(itemId); | ||
const toolbarItem = document.createElement("div"); | ||
toolbarItem.className = "oncotree-toolbar-item inactive"; | ||
toolbarItem.id = getToolbarItemId( | ||
"collapse", | ||
/* COLLAPSE */ | ||
); | ||
toolbarItem.innerHTML = | ||
TOOLBAR_ACTION_SVG[ | ||
"collapse" | ||
/* COLLAPSE */ | ||
]; | ||
toolbarItem.onclick = () => { | ||
onCollapseClick(tree); | ||
}; | ||
item.appendChild(toolbarItem); | ||
} | ||
async function buildToolbarItem( | ||
@@ -1268,2 +1304,8 @@ toolbarId, | ||
}; | ||
export { buildSearchBar, buildToolbar, OncoTree as default }; | ||
export { | ||
buildCollapseItem, | ||
buildExpandItem, | ||
buildSearchBar, | ||
buildToolbar, | ||
OncoTree as default, | ||
}; |
{ | ||
"name": "@oncokb/oncotree", | ||
"version": "0.8.6", | ||
"version": "0.9.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/oncotree.js", |
Sorry, the diff of this file is not supported yet
112798
2751