Error: While bindig foam tree
FoamTree: visualization already embedded in the element
This issue comes when you try to re-render the foam tree. To solve this issue remove the data-foamtree attribute with following way :-
var portfolioExcessReturn = document.getElementById(
'foamTreeIdName'
) as any;
if (portfolioExcessReturn) {
portfolioExcessReturn.removeAttribute('data-foamtree');
}