Skip to content

Commit

Permalink
🚧 newFocus → focus
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Oct 21, 2024
1 parent 5433d74 commit 37d69ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/tree/phyloTree/change.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export const change = function change({
/* change these things to provided value (unless undefined) */
newDistance = undefined,
newLayout = undefined,
newFocus = undefined,
updateLayout = undefined, // todo - this seems identical to `newLayout`
newBranchLabellingKey = undefined,
showAllBranchLabels = undefined,
Expand All @@ -271,6 +270,7 @@ export const change = function change({
tipRadii = undefined,
branchThickness = undefined,
/* other data */
focus = undefined,
scatterVariables = undefined
}) {
// console.log("\n** phylotree.change() (time since last run:", Date.now() - this.timeLastRenderRequested, "ms) **\n\n");
Expand Down Expand Up @@ -324,7 +324,7 @@ export const change = function change({
}

if (changeNodeOrder) {
setDisplayOrder({nodes: this.nodes, focus: newFocus});
setDisplayOrder({nodes: this.nodes, focus});
this.setDistance();
}

Expand Down Expand Up @@ -361,7 +361,7 @@ export const change = function change({
/* distance */
if (newDistance || updateLayout) this.setDistance(newDistance);
/* focus */
if (updateLayout) setDisplayOrder({nodes: this.nodes, focus: newFocus});
if (updateLayout) setDisplayOrder({nodes: this.nodes, focus});
/* layout (must run after distance and focus) */
if (newDistance || newLayout || updateLayout || changeNodeOrder) {
this.setLayout(newLayout || this.layout, scatterVariables);
Expand Down
6 changes: 3 additions & 3 deletions src/components/tree/reactD3Interface/change.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ export const changePhyloTreeViaPropsComparison = (mainTree, phylotree, oldProps,
/* explode! */
if (oldProps.explodeAttr !== newProps.explodeAttr) {
args.changeNodeOrder = true;
args.newFocus = newProps.focus;
args.focus = newProps.focus;
}

/* enable/disable focus */
if (oldProps.focus !== newProps.focus) {
args.newFocus = newProps.focus;
args.focus = newProps.focus;
args.updateLayout = true;
}
/* re-focus on changes */
else if (oldProps.focus === true &&
newProps.focus === true &&
(zoomChange || dateRangeChange || filterChange)) {
args.newFocus = true;
args.focus = true;
args.updateLayout = true;
}

Expand Down

0 comments on commit 37d69ba

Please sign in to comment.