Skip to content

Commit

Permalink
debugtools #15: renderTreeContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Aug 22, 2020
1 parent bf22dd6 commit a8cf45d
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/components/botch/botch-life-tree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class BotchLifeTree extends React.Component {
setFilteredDataRef (ref) {
this.filteredDataRef = ref;
}

renderTree (){
const levels = 3;

Expand All @@ -171,16 +172,11 @@ class BotchLifeTree extends React.Component {
const toth = deltah + (levh * levels);
const connectorStyle = {fill: 'lime', stroke: 'purple', strokeWidth: 5, fillRule: 'nonzero'};

return (<div
className={classNames(styles.libraryScrollGrid, {
[styles.withFilterBar]: this.props.filterable || this.props.tags
})}
ref={this.setFilteredDataRef}
>
{this.state.loaded ? this.getFilteredData().map((dataItem, index) => (

return (
this.getFilteredData().map((dataItem, index) => (
<div key={typeof dataItem.name === 'string' ? dataItem.name : dataItem.rawURL}>


<svg
width={viewporth}
height={viewportw}
Expand All @@ -202,7 +198,19 @@ class BotchLifeTree extends React.Component {
</foreignObject>
</svg>
</div>
)) : (
)));
}

renderTreeContainer (){
const LOADED = this.renderTree();

return (<div
className={classNames(styles.libraryScrollGrid, {
[styles.withFilterBar]: this.props.filterable || this.props.tags
})}
ref={this.setFilteredDataRef}
>
{this.state.loaded ? <span>{LOADED}</span> : (
<div className={styles.spinnerWrapper}>
<Spinner
large
Expand Down Expand Up @@ -294,7 +302,7 @@ class BotchLifeTree extends React.Component {
>*/
<div>

{this.renderTree()}
{this.renderTreeContainer()}
</div>
);
}
Expand Down

0 comments on commit a8cf45d

Please sign in to comment.